clc
clear
%% 根据2014ceemdan论文中的信号重复其实验
x1=0:1:1000;
y_1=@(x)(x>=1&x<=500).*0+(x>=501&x<=750).*sin(2*pi*0.255*(x-501))+(x>=751&x<=1000).*0;
y_2=@(x)sin(2*pi*0.065*(x-1));
y1=y_1(x1)+y_2(x1);
%% eemd
addpath('c:/Users/rex18/Documents/MATLAB/eemd')
imfs=eemd(y1,0.2,500);
%plot imfs
plot_imfs(imfs,y1,x1);
%plot time-frequency-power spectra
samplerate=10;%取样率
freqsol=400;%频率轴分辨率
timesol=1000;%时间轴分辨率
hsp_fre1=1;
totalt=(length(imfs))/samplerate;
[nt,tscale,fscale]=...
nnspe(imfs(1:end-1,2:end-1), ...
0, totalt, freqsol, timesol, ...
0.00001, hsp_fre1, 0,totalt, ...
'hilbtm','spline',5);
q=fspecial('gaussian', 7, 0.6);
nsu=filter2(q, nt);
nsu=filter2(q, nsu);
figure;
imagesc(tscale, fscale,nsu.^.5);
axis xy;
%% ceemdan-eemd
rmpath('c:/Users/rex18/Documents/MATLAB/eemd')
addpath('c:/Users/rex18/Documents/MATLAB/CEEMDAN_V00')
%eemd
[modes its]=eemd(y1,0.2,500,5000);
imfs=modes';
plot_imfs(imfs,y1,x1)
%ceemdan
[modes its]=ceemdan(y1,0.2,500,5000,1);
imfs=modes';
plot_imfs(imfs,y1,x1)
%plot time-frequency-power spectra
addpath('c:/Users/rex18/Documents/MATLAB/eemd')
rmpath('c:/Users/rex18/Documents/MATLAB/CEEMDAN_V00')
samplerate=1;%取样率
freqsol=400;%频率轴分辨率
timesol=1000;%时间轴分辨率
hsp_fre1=1;
totalt=(length(imfs))/samplerate;
[nt,tscale,fscale]=...
nnspe(imfs(1:end-1,1:end), ...
0, totalt, freqsol, timesol, ...
0.00001, hsp_fre1, 0,totalt, ...
'hilbtm','spline',5);
q=fspecial('gaussian', 7, 0.6);
nsu=filter2(q, nt);
nsu=filter2(q, nsu);
figure;
imagesc(tscale, fscale,nsu.^.5);
axis xy;