[求助]清高手指点HHT中的疑惑
本帖最后由 wdhd 于 2016-3-11 11:13 编辑在程序中hspec(imf,N),N代表什么意思啊,按程序中翻译过来是频率cell的个数
但是不明白,请大虾解释一下!
还有当我运行程序后,出现了错误,系统提示如下:
??? Undefined function or variable 'instfreq'.
Error in ==> E:\EMD\hspec.m
On line 45 ==> freq(:,i) = instfreq(z(:,i)); % instantaneous frequency
这是怎么回事啊?
请大虾帮帮忙解释一下吧
多谢了
能不能把原来的程序一起传上来看看?
这就是原程序,
本帖最后由 wdhd 于 2016-3-11 11:14 编辑不知道为什么会出现错误,请高手指点一下吧
多谢了
% HSPEC: Hilbert Amplitude Spectrum
%
% =hspec(imf,N);
%
% S - Time-frequency-amplitude matrix
% Columns are indexed in time, rows in frequency, values are amplitudes
%
% freq- instantaneous frequencies of each component
%
% imf - Matrix of intrinsic mode functions (each as a row)
%
% N - Number of frequency cells
%
% See: Huang et al, Royal Society Proceedings on Math, Physical,
% and Engineering Sciences, vol. 454, no. 1971, pp. 903-995,
% 8 March 1998
%
% Remark: the graphical representation is the Hilbert Energy Spectrum
% that is: 20 * log ( S * S )
%
% Author: Ivan Magrin-Chagnolleau <ivan@ieee.org>
%
function = hspec(imf,N);
L = size(imf,1); % Number of components in the decomposition
%-------------------------------------------------------------------------
% loop for on each component
S = []; % Matrix which will contain the time-frequency-amplitude representation
clear x z m p freq
x = imf'; % now each column is a component
z = hilbert(x); % analytic signal
m = abs(z); % module of z
p = angle(z); % phase of z
for i = 1:L
freq(:,i) = instfreq(z(:,i)); % instantaneous frequency
% if the function instfreq is not available...
% p(:,i) = unwrap(p(:,i)); % unwrap phase
% freq(:,i) = abs(diff(p(:,i))); % derivative of the phase and absolute value
% to have always positive frequencies
ceilfreq(:,i) = ceil(freq(:,i)*N); % to have integer values - also do a smoothing given the number
% of frequency cells
for j = 1:length(x)-2
S(ceilfreq(j,i),j+1) = m(j+1,i);
end
end
eps = 0.00001; % to avoid zero values before the log
E = 20 * log ( S.^2 + eps ); % Hilbert energy spectrum
% plot S
figure;
t=1:length(x); % time sample
f=t/length(x)*0.5; % normalized frequency
imagesc(t,f,E); % !!! I am not sure it is the best way to visualize it !!!
colorbar;
set(gca,'YDir','normal');
xlabel('Time Sample');
ylabel('Normalized Frequency');
return
你没有instfreq.m这个函数,所以 没有办法使用,你只要把instfreq.m这个函数放在你现在的文件夹里面就可以了;如果没有instfreq.m这个函数,具体请看程序注释!对了着个程序我也在用,不过出来的hilbert谱图跟资料礼貌说的不一致,我正在找原因,有兴趣请加qq51500348!大家讨论!
回复:(龚英姬)你没有instfreq.m这个函数,所以 没...
本帖最后由 wdhd 于 2016-3-11 11:15 编辑以下是引用龚英姬在2006-3-25 10:41:49的发言:
你没有instfreq.m这个函数,所以 没有办法使用,你只要把instfreq.m这个函数放在你现在的文件夹里面就可以了;如果没有instfreq.m这个函数,具体请看程序注释!对了着个程序我也在用,不过出来的hilbert谱图跟资料礼貌说的不一致,我正在找原因,有兴趣请加qq51500348!大家讨论!
这个函数在论坛ftp提供的时频分析工具箱中有
/ebook/math/math_tools/Matlab/工具箱
真不知道为什么连Huang都用Hilbert,我觉得Hilbert就是垃圾,对于振动信号而言就是废物,只能选用替代算法 楼上的,请问一下,我也用hspec这个程序,可每次都提示我Undefined function or variable 'hilbert',我怀疑是缺少这个调用函数,不知道对不对,给点意见.要是的话,在哪能找到,你有的话给传一个上来,谢谢了.邮箱<a href="mailtxshp8935@163.com" target="_blank" >xshp8935@163.com</A>,希望能交流一下.
请问论坛的ftp在哪里?
谢谢
页:
[1]