资源简介
最近毕设在做基于VMD的算法,我花了一天时间翻遍了全网,才找到可以不用会员或者充值就能下载而且能用的VMD函数源代码,CSDN上都是付费的。省了后续有人做这个的时候再费尽周折,所以知识共享,上传并免费提供下载。
代码片段和文件信息
function [u u_hat omega] = VMD(signal alpha tau K DC init tol)
% Variational Mode Decomposition
% Authors: Konstantin Dragomiretskiy and Dominique Zosso
% zosso@math.ucla.edu --- http://www.math.ucla.edu/~zosso
% Initial release 2013-12-12 (c) 2013
%
% Input and Parameters:
% ---------------------
% signal - the time domain signal (1D) to be decomposed
% alpha - the balancing parameter of the data-fidelity constraint
% tau - time-step of the dual ascent ( pick 0 for noise-slack )
% K - the number of modes to be recovered
% DC - true if the first mode is put and kept at DC (0-freq)
% init - 0 = all omegas start at 0
% 1 = all omegas start uniformly distributed
% 2 = all omegas initialized randomly
% tol - tolerance of convergence criterion; typically around 1e-6
%
% Output:
% -------
% u - the collection of decomposed modes
% u_hat - spectra of the modes
% omega - estimated mode center-frequencies
%
% When using this code please do cite our paper:
% -----------------------------------------------
% K. Dragomiretskiy D. Zosso Variational Mode Decomposition IEEE Trans.
% on Signal Processing (in press)
% please check here for update reference:
% http://dx.doi.org/10.1109/TSP.2013.2288675
%---------- Preparations
% Period and sampling frequency of input signal
save_T = length(signal);
fs = 1/save_T;
% extend the signal by mirroring
T = save_T;
f_mirror(1:T/2) = signal(T/2:-1:1);
f_mirror(T/2+1:3*T/2) = signal;
f_mirror(3*T/2+1:2*T) = signal(T:-1:T/2+1);
f = f_mirror;
% Time Domain 0 to T (of mirrored signal)
T = length(f);
t = (1:T)/T;
% Spectral Domain discretization
freqs = t-0.5-1/T;
% Maximum number of iterations (if not converged yet then it won‘t anyway)
N = 500;
% For future generalizations: individual alpha for each mode
Alpha = alpha*ones(1K);
% Construct and center f_hat
f_hat = fftshift((fft(f)));
f_hat_plus = f_hat;
f_hat_plus(1:T/2) = 0;
% matrix keeping track of every iterant // could be discarded for mem
u_hat_plus = zeros(N length(freqs) K);
% Initialization of omega_k
omega_plus = zeros(N K);
switch init
case 1
for i = 1:K
omega_plus(1i) = (0.5/K)*(i-1);
end
case 2
omega_plus(1:) = sort(exp(log(fs) + (log(0.5)-log(fs))*rand(1K)));
otherwise
omega_plus(1:) = 0;
end
% if DC mode imposed set its omega to 0
if DC
omega_plus(11) = 0;
end
% start with empty dual variables
lambda_hat = zeros(N length(freqs));
% other inits
uDiff = tol+eps; % update step
n = 1; % loop counter
sum_uk = 0; % accumulator
% ----------- Main loop for iterative updates
while ( uDiff > tol && n < N ) % not converged and below iterations limit
% update first mode accumulator
k = 1;
sum_uk = u_hat_plus(n:K) + sum_uk - u_hat_plus(n:1);
% update spectrum of first mode through Wiener filter of residuals
u_hat_plus(n+1:k) = (f_hat_plus - sum_uk - la
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2020-03-24 22:18 VMD算法matlab函数\
文件 1549 2014-02-12 14:40 VMD算法matlab函数\license.txt
文件 4645 2013-12-13 04:53 VMD算法matlab函数\VMD.m
文件 3235 2013-12-13 04:51 VMD算法matlab函数\VMD_test.m
文件 0 2020-03-24 22:17 VMD算法matlab函数\冲.txt
- 上一篇:基于matlab的圆形线圈互感计算
- 下一篇:matlab的GAOT的工具箱
相关资源
- matlab的GAOT的工具箱
- 基于matlab的圆形线圈互感计算
- 电力系统14节点模型
- 直流电机双闭环matlab仿真
- 直流电机开环和比例控制闭环simuli<
-
MATLAB机械臂简单控制仿真Simuli
nk篇 - 降雨雷达的时空匹配matlab代码
-
simuli
nk的S函数实现多智能体一致性 - 电力电子各种电路Matlab仿真
- DTW动态时间规整matlab代码
- 用于生成ask2fsk4fskbpskqpskDLFM时频图数据
- 蚁群算法路径规划避障MATLAB源程序
- 计算一维信号计盒维数matlab程序
- 人工神经网络预测matlab
- 最小二乘法曲线拟合matlab代码
- MATLAB大作业
- 飞行轨迹仿真
- 三参数威布尔分布线性相关法拟合程
- Matlab读取TDMS文件并存储为mat格式
- FW交通均衡求解算法
- matlab打开电脑摄像头动态追踪人脸位
- 捷联惯导matlab程序
- 学生成绩查询系统
- 基于MATLAB的VANET仿真.zip
- PPL锁相环matlab
- 计算SINR的matlab程序,带入参数可以直
- 基于matlab的小车避障仿真
- 最全图像评价性能指标函数matlab
- 图像性能指标matlab版本
- RSSI指纹库
评论
共有 条评论