clear;
clc
fs=1000;
t=0:0.01:2;
N=length(t);
for i=1:N
if (t(i)>=0.5)&(t(i)<=0.8)
u(i)=[1+0.1*cos(2*pi*3*t(i))]*cos(2*pi*50*t(i));
elseif (t<0)&(t>2)
disp('erro');
else
u(i)=cos(2*pi*50*t(i));end
end
data=u;
imf=emd(data);
[A,f,t]=hhspectrum(imf);
[E,t,Cenf]=toimage(A,f);
cemd_visu(data,1:length(data),imf);
disp_hhs(E);
for k=1:size(E,1)
bjp(k)=sum(E(k,:))*1/fs;
end
figure(3); |