变分模式分解 (VMD) 算法
项目描述
vmdpy:Python 中的变分模式分解
根据变分模态分解 ( Dragomiretskiy and Zosso, 2014 ) 方法分解信号的函数。
这个包是原始VMD MATLAB 工具箱的 Python 翻译
安装
- 点安装 vmdpy
或者
- 从https://github.com/vrcarva/vmdpy下载项目,然后从项目文件夹运行“python setup.py install”
引文和联系方式
论文可在:https ://doi.org/10.1016/j.bspc.2020.102073
如果你觉得这个包有用,我们恳请你在你的工作中引用它:
Vinícius R. Carvalho、Márcio FD Moraes、Antônio P. Braga、Eduardo MAM Mendes,评估 EEG 信号癫痫检测和分类的五种不同自适应分解方法,生物医学信号处理与控制,第 62 卷,2020 年,102073 年,ISSN 1746-8094,
https: //doi.org/10.1016/j.bspc.2020.102073 。
如果您开发了新功能或修复了代码中的任何内容,只需向我提供相应的文件以及我应该在此自述文件中包含哪些功劳。
如需建议、问题、意见等:vrcarva@ufmg.br
Vinicius Rezende Carvalho
Programa de Pós-Graduação em Engenharia Elétrica – Universidade Federal de Minas Gerais, Belo Horizonte, Brasil
Núcleo de Neurociências - Universidade Federal de Minas Gerais
示例脚本
#%% Simple example
import numpy as np
import matplotlib.pyplot as plt
from vmdpy import VMD
#. Time Domain 0 to T
T = 1000
fs = 1/T
t = np.arange(1,T+1)/T
freqs = 2*np.pi*(t-0.5-fs)/(fs)
#. center frequencies of components
f_1 = 2
f_2 = 24
f_3 = 288
#. modes
v_1 = (np.cos(2*np.pi*f_1*t))
v_2 = 1/4*(np.cos(2*np.pi*f_2*t))
v_3 = 1/16*(np.cos(2*np.pi*f_3*t))
f = v_1 + v_2 + v_3 + 0.1*np.random.randn(v_1.size)
#. some sample parameters for VMD
alpha = 2000 # moderate bandwidth constraint
tau = 0. # noise-tolerance (no strict fidelity enforcement)
K = 3 # 3 modes
DC = 0 # no DC part imposed
init = 1 # initialize omegas uniformly
tol = 1e-7
#. Run actual VMD code
u, u_hat, omega = VMD(f, alpha, tau, K, DC, init, tol)