test.m
来自「希尔伯特黄变换的程序源码」· M 代码 · 共 29 行
M
29 行
clear all
clc
N=1024;
t=[0:0.001:0.001*63*20];
%y=sin(2*pi*10*t+pi/3);
% f=instfreq1(y')';
y=sin(2*pi*1*t)+0.1*sin(2*pi*100*t)+0.1*sin(2*pi*200*t);%+2*sin(2*pi*200*t)
y1=-2*pi*1*2*pi*1*sin(2*pi*10*t)-0.1*2*pi*100*2*pi*100*sin(2*pi*100*t)-0.1*2*pi*200*2*pi*200*sin(2*pi*200*t);
%y2=-2*pi*10*2*pi*10/(2*pi*100*2*pi*100)*sin(2*pi*10*t)-cos(2*pi*100*t);
y2=2*pi*1*cos(2*pi*10*t)+0.1*2*pi*100*cos(2*pi*100*t)+0.1*2*pi*200*cos(2*pi*200*t);
y3=((1+y2.*y2).^1.5);
yp=y1./y3;
plot(t,yp,t,1000*y)
%b = ones(1,10)/10; % 10 point averaging filter
%y1 = filtfilt(b,1,y); % Noncausal filtering
%yy = filter(b,1,y); % Normal filtering
%plot(t,y,t,y1,'--',t,yy,':')
%plot(t,y);
tp=1:length(t);[imf,ort,nbits] = emd(yp,tp);%,[1,1,0.5],2
[A,f,tt] = hhspectrum(imf,tp,3);
%plot(t(1:62),f,A)
%emd_visu(y,tp,imf)
%hgsave('all_imfs')
%pause
%close
im=toimage(A,f,tt);
disp_hhs(im,tt);
hgsave('HH_Spectrum')
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?