tianjb19.9;
time=20;
dt=0.01;
xs=70/max(abs(dzhbo));
x=dzhbo*xs;
N=length(x);
t=0:dt:dt*(N-1);
imf=emd(x); %EMD分解
i=1;
emd_visu(x,t,imf,i); %显示IMF分量
%---------------瞬时频率与瞬时振幅的求解------------------------%
z = hilbert(imf');
m = (abs(z)); %模即各分量的瞬时振幅
[row,imfgshu]=size(z);
revo=50;
sump=zeros(1,imfgshu-1);summ=zeros(1,imfgshu-1);
for i = 1:imfgshu-1 %对模态循环
freq(:,i) =instfreq(z(:,i))*revo; %求每个imf分量的瞬时频率
end
for i=1:imfgshu-1
for j=1:N-2
sump(i)=sump(i)+freq(j,i)*dt;
end
pjfreq(i)=2*pi*sump(i)/(time-2*dt); %求瞬时频率平均值
end
for i=1:imfgshu-1
for j=1:N-1
summ(i)=summ(i)+(m(j,i)+m(j+1,i))/2*dt;
end
pjm(i)=summ(i)/time; %求模的平均值
end |