声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2959|回复: 7

[HHT] [求助]清高手指点HHT中的疑惑

[复制链接]
发表于 2006-3-22 11:27 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
本帖最后由 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

  这是怎么回事啊?

  请大虾帮帮忙解释一下吧

  多谢了
回复
分享到:

使用道具 举报

发表于 2006-3-23 10:59 | 显示全部楼层
能不能把原来的程序一起传上来看看?
 楼主| 发表于 2006-3-24 13:57 | 显示全部楼层

这就是原程序,

本帖最后由 wdhd 于 2016-3-11 11:14 编辑

不知道为什么会出现错误,请高手指点一下吧
多谢了

  1. % HSPEC: Hilbert Amplitude Spectrum
  2. %
  3. % [S,freq]=hspec(imf,N);
  4. %
  5. % S - Time-frequency-amplitude matrix
  6. % Columns are indexed in time, rows in frequency, values are amplitudes
  7. %
  8. % freq- instantaneous frequencies of each component
  9. %
  10. % imf - Matrix of intrinsic mode functions (each as a row)
  11. %
  12. % N - Number of frequency cells
  13. %
  14. % See: Huang et al, Royal Society Proceedings on Math, Physical,
  15. % and Engineering Sciences, vol. 454, no. 1971, pp. 903-995,
  16. % 8 March 1998
  17. %
  18. % Remark: the graphical representation is the Hilbert Energy Spectrum
  19. % that is: 20 * log ( S * S )
  20. %
  21. % Author: Ivan Magrin-Chagnolleau <ivan@ieee.org>
  22. %

  23. function [S,freq] = hspec(imf,N);


  24. L = size(imf,1); % Number of components in the decomposition

  25. %-------------------------------------------------------------------------
  26. % loop for on each component

  27. S = []; % Matrix which will contain the time-frequency-amplitude representation


  28. clear x z m p freq

  29. x = imf'; % now each column is a component
  30. z = hilbert(x); % analytic signal
  31. m = abs(z); % module of z
  32. p = angle(z); % phase of z

  33. for i = 1:L

  34. freq(:,i) = instfreq(z(:,i)); % instantaneous frequency

  35. % if the function instfreq is not available...
  36. % p(:,i) = unwrap(p(:,i)); % unwrap phase
  37. % freq(:,i) = abs(diff(p(:,i))); % derivative of the phase and absolute value
  38. % to have always positive frequencies

  39. ceilfreq(:,i) = ceil(freq(:,i)*N); % to have integer values - also do a smoothing given the number
  40. % of frequency cells

  41. for j = 1:length(x)-2

  42. S(ceilfreq(j,i),j+1) = m(j+1,i);

  43. end

  44. end

  45. eps = 0.00001; % to avoid zero values before the log
  46. E = 20 * log ( S.^2 + eps ); % Hilbert energy spectrum

  47. % plot S
  48. figure;
  49. t=1:length(x); % time sample
  50. f=t/length(x)*0.5; % normalized frequency
  51. imagesc(t,f,E); % !!! I am not sure it is the best way to visualize it !!!
  52. colorbar;
  53. set(gca,'YDir','normal');
  54. xlabel('Time Sample');
  55. ylabel('Normalized Frequency');

  56. return
复制代码
发表于 2006-3-25 10:41 | 显示全部楼层
你没有instfreq.m这个函数,所以 没有办法使用,你只要把instfreq.m这个函数放在你现在的文件夹里面就可以了;如果没有instfreq.m这个函数,具体请看程序注释!对了着个程序我也在用,不过出来的hilbert谱图跟资料礼貌说的不一致,我正在找原因,有兴趣请加qq51500348!大家讨论!
发表于 2006-3-25 21:09 | 显示全部楼层

回复:(龚英姬)你没有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/工具箱
发表于 2006-4-3 09:15 | 显示全部楼层
真不知道为什么连Huang都用Hilbert,我觉得Hilbert就是垃圾,对于振动信号而言就是废物,只能选用替代算法[em05]
发表于 2006-5-19 09:18 | 显示全部楼层
楼上的,请问一下,我也用hspec这个程序,可每次都提示我Undefined function or variable 'hilbert',我怀疑是缺少这个调用函数,不知道对不对,给点意见.要是的话,在哪能找到,你有的话给传一个上来,谢谢了.邮箱<a href="mailtxshp8935@163.com" target="_blank" >xshp8935@163.com</A>,希望能交流一下.
发表于 2006-5-19 12:22 | 显示全部楼层

请问论坛的ftp在哪里?

谢谢
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-4-29 14:20 , Processed in 0.067341 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表