emdyanshi(2).m
来自「emd过程的详细演示 可以帮助刚刚接触hht的人了解 emd的过程」· M 代码 · 共 33 行
M
33 行
clear
f = [ 2/32 3/32 ];
T = 128;
t = 0:T-1;
s1 = cos(2*pi*f(1)*t);
s2 = cos(2*pi*(f(2)*t+f(2)/100*t.^2));
s = s1 + s2;
N = length(s);
figure(1);
subplot(3,1,1);
plot(s1)
subplot(3,1,2);
plot(s2)
subplot(3,1,3);
plot(s)
IMF = emd(s, 'display', 1);
fn = size(IMF,1);
eng = 0;
figure;
for k = 1:fn
eng = eng + sum(IMF(k,:).^2);
subplot(fn, 1, k); hold on;
plot(IMF(k,:))
end
title('Signal decomposition');
xlabel('time');
disp(sprintf('%f %f',eng,sum(s.^2)));
[A, fa, tt] = hhspectrum(IMF);
[E, tt1] = toimage(A,fa,tt,length(tt));
disp_hhs(E, tt1);
colorbar
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?