求助:瞬时频率的算法是如何实现的?
下面是用hilbert变换求瞬时频率的MATLAB程序,看了好久没懂,请教高手指导下这个算法是如何实现的。% this is a function to calculate instantaneous based on EMD method
%
% function omega = ifndq(vimf, dt)
%
% INPUT:
% vimf: an IMF;
% dt: time interval of the imputted data 输入数据的时间间隔
% OUTPUT:
% omega: instantanesous frequency, which is 2*PI/T, where T
% 瞬时频率
% is the period of an oscillation
%
% References can be found in the "Reference" section.
%
% The code is prepared by Zhaohua Wu. For questions, please read the "Q&A" section or
% contact
% zhwu@cola.iges.org
%
function omega = ifndq(vimf, dt)
Nnormal=5;
rangetop=0.90;
vlength = max( size(vimf) );
vlength_1 = vlength -1;
for i=1:vlength,
abs_vimf(i)=vimf(i);
if abs_vimf(i) < 0
abs_vimf(i)=-vimf(i);
end
end
for jj=1:Nnormal,
=extrema(abs_vimf);
dd=1:1:vlength;
upper= spline(spmax(:,1),spmax(:,2),dd);
for i=1:vlength,
abs_vimf(i)=abs_vimf(i)/upper(i);
end
end
for i=1:vlength,
nvimf(i)=abs_vimf(i);
if vimf(i) < 0;
nvimf(i)=-abs_vimf(i);
end
end
for i=1:vlength,
dq(i)=sqrt(1-nvimf(i)*nvimf(i));
end
for i=2:vlength_1,
devi(i)=nvimf(i+1)-nvimf(i-1);
if devi(i)>0 & nvimf(i)<1
dq(i)=-dq(i);
end
end
rangebot=-rangetop;
for i=2:(vlength-1),
if nvimf(i)>rangebot & nvimf(i) < rangetop
omgcos(i)=abs(nvimf(i+1)-nvimf(i-1))*0.5/sqrt(1-nvimf(i)*nvimf(i));
else
omgcos(i)=-9999;
end
end
omgcos(1)=-9999;
omgcos(vlength)=-9999;
jj=1;
for i=1:vlength,
if omgcos(i)>-1000
ddd(jj)=i;
temp(jj)=omgcos(i);
jj=jj+1;
end
end
temp2=spline(ddd,temp,dd);
omgcos=temp2;
for i=1:vlength,
omega(i)=omgcos(i);
end
pi2=pi*2;
omega=omega/dt;
高手何在?
请大家帮忙啊高手何在?
等的周期好长啊,高手何在? 容我说句话, 高手那有空当家教!回复 地板 ChaChing 的帖子
你啥意思?你算个球啊 楼主先勿生气! 楼主的帖子连续出现了三天, 楼主的急可想而知!楼主的求知欲望值得嘉许, 但方式的确值得商榷!
若能先搜索并试下, 再询问重点(不是全部解说), 或许楼主能够得到更多!
回复 6楼 ChaChing 的帖子
多谢,我知道了,我也是想把话朝简单方向说的,问题是这个程序其实就那么一两个公式,再抽象出来的话就没东西了。下来我自己再看看吧,不打扰大家了。 上述程序中for i=2:vlength_1,
devi(i)=nvimf(i+1)-nvimf(i-1);
if devi(i)>0 & nvimf(i)<1
dq(i)=-dq(i);
end
end
这段,为甚取负的平方根呢?
页:
[1]