声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 8698|回复: 24

[编程技巧] 求信息熵matlab程序!!!

  [复制链接]
发表于 2009-5-15 20:16 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 牛小贱 于 2014-2-28 11:10 编辑

哪位大侠有关于信息熵的matlab 程序,让俺参考一下呗!!急,急!!!!包括奇异谱商、功率谱熵、小波空间特征谱商和小波能谱商。请各位大侠把相关的程序发到我的邮箱:feic544@163.com.谢谢啦!!
回复
分享到:

使用道具 举报

发表于 2009-5-15 20:33 | 显示全部楼层
根据公式自己先编程试试
发表于 2009-5-15 20:41 | 显示全部楼层

回复 楼主 wy558558558 的帖子

你好!我这有本书你参考一下!
发表于 2010-12-15 11:10 | 显示全部楼层
给我也发一份谢谢!ye_zi204@163.com
发表于 2011-3-6 10:15 | 显示全部楼层
能不能把那本书也发给我呀,救急啊...谢谢啦
发表于 2011-5-27 23:12 | 显示全部楼层
我也需要,定重谢!!!!邮箱hcdhuang2008@163.com
发表于 2011-7-12 14:42 | 显示全部楼层
能不能把那本书的名称和作者留一下。。。。
发表于 2011-8-29 10:13 | 显示全部楼层
书的名字能说吗?
发表于 2011-10-17 16:51 | 显示全部楼层
楼主  麻烦问下  你这程序搞定了吗?
发表于 2012-6-11 20:58 | 显示全部楼层
也给我发一下吧,谢谢!
发表于 2012-11-27 09:56 | 显示全部楼层
同求啊,我想问hilbert谱熵的求解
发表于 2012-11-27 10:28 | 显示全部楼层
可以参考下面的函数

  1. function [estimate,nbias,sigma,descriptor]=entropy(x,descriptor,approach,base)
  2. %ENTROPY   Estimates the entropy of stationary signals with
  3. %          independent samples using various approaches.
  4. %   [ESTIMATE,NBIAS,SIGMA,DESCRIPTOR] = ENTROPY(X) or
  5. %   [ESTIMATE,NBIAS,SIGMA,DESCRIPTOR] = ENTROPY(X,DESCRIPTOR) or
  6. %   [ESTIMATE,NBIAS,SIGMA,DESCRIPTOR] = ENTROPY(X,DESCRIPTOR,APPROACH) or
  7. %   [ESTIMATE,NBIAS,SIGMA,DESCRIPTOR] = ENTROPY(X,DESCRIPTOR,APPROACH,BASE)
  8. %
  9. %   ESTIMATE    : The entropy estimate
  10. %   NBIAS       : The N-bias of the estimate
  11. %   SIGMA       : The standard error of the estimate
  12. %   DESCRIPTOR  : The descriptor of the histogram, seel alse ENTROPY
  13. %
  14. %   X           : The time series to be analyzed, a row vector
  15. %   DESCRIPTOR  : Where DESCRIPTOR=[LOWERBOUND,UPPERBOUND,NCELL]
  16. %     LOWERBOUND: Lowerbound of the histogram
  17. %     UPPERBOUND: Upperbound of the histogram
  18. %     NCELL     : The number of cells of the histogram      
  19. %   APPROACH    : The method used, one of the following ones:
  20. %     'unbiased': The unbiased estimate (default)
  21. %     'mmse'    : The minimum mean square error estimate
  22. %     'biased'  : The biased estimate
  23. %   BASE        : The base of the logarithm; default e
  24. %
  25. %   See also: http://www.cs.rug.nl/~rudy/matlab/

  26. %   R. Moddemeijer
  27. %   Copyright (c) by R. Moddemeijer
  28. %   $Revision: 1.1 $  $Date: 2001/02/05 08:59:36 $



  29. if nargin <1
  30.    disp('Usage: [ESTIMATE,NBIAS,SIGMA,DESCRIPTOR] = ENTROPY(X)')
  31.    disp('       [ESTIMATE,NBIAS,SIGMA,DESCRIPTOR] = ENTROPY(X,DESCRIPTOR)')
  32.    disp('       [ESTIMATE,NBIAS,SIGMA,DESCRIPTOR] = ENTROPY(X,DESCRIPTOR,APPROACH)')
  33.    disp('       [ESTIMATE,NBIAS,SIGMA,DESCRIPTOR] = ENTROPY(X,DESCRIPTOR,APPROACH,BASE)')
  34.    disp('Where: DESCRIPTOR = [LOWERBOUND,UPPERBOUND,NCELL]')
  35.    return
  36. end

  37. % Some initial tests on the input arguments

  38. [NRowX,NColX]=size(x);

  39. if NRowX~=1
  40.   error('Invalid dimension of X');
  41. end;

  42. if nargin>4
  43.   error('Too many arguments');
  44. end;

  45. if nargin==1
  46.   [h,descriptor]=histogram(x);
  47. end;

  48. if nargin>=2
  49.   [h,descriptor]=histogram(x,descriptor);
  50. end;

  51. if nargin<3
  52.   approach='unbiased';
  53. end;

  54. if nargin<4
  55.   base=exp(1);
  56. end;

  57. lowerbound=descriptor(1);
  58. upperbound=descriptor(2);
  59. ncell=descriptor(3);

  60. estimate=0;
  61. sigma=0;
  62. count=0;

  63. for n=1:ncell
  64.   if h(n)~=0
  65.     logf=log(h(n));
  66.   else
  67.     logf=0;
  68.   end;
  69.   count=count+h(n);
  70.   estimate=estimate-h(n)*logf;
  71.   sigma=sigma+h(n)*logf^2;
  72. end;

  73. % biased estimate

  74. estimate=estimate/count;
  75. sigma   =sqrt( (sigma/count-estimate^2)/(count-1) );
  76. estimate=estimate+log(count)+log((upperbound-lowerbound)/ncell);
  77. nbias   =-(ncell-1)/(2*count);

  78. % conversion to unbiased estimate

  79. if approach(1)=='u'
  80.   estimate=estimate-nbias;
  81.   nbias=0;
  82. end;

  83. % conversion to minimum mse estimate

  84. if approach(1)=='m'
  85.   estimate=estimate-nbias;
  86.   nbias=0;
  87.   lambda=estimate^2/(estimate^2+sigma^2);
  88.   nbias   =(1-lambda)*estimate;
  89.   estimate=lambda*estimate;
  90.   sigma   =lambda*sigma;
  91. end;

  92. % base transformation

  93. estimate=estimate/log(base);
  94. nbias   =nbias   /log(base);
  95. sigma   =sigma   /log(base);
复制代码


点评

赞成: 5.0
赞成: 5
  发表于 2014-6-30 15:03
赞成: 5
  发表于 2014-6-29 13:13

评分

2

查看全部评分

发表于 2012-11-28 16:48 | 显示全部楼层
12楼的很有参考价值啊!谢谢,打算用hht后求能量熵分辨故障点,谢谢!
发表于 2013-4-26 11:02 | 显示全部楼层
楼主能不能也给我发一下,万分感谢!sylvia1987@qq.com
发表于 2013-4-26 20:33 | 显示全部楼层
{:{10}:}
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-4-27 10:21 , Processed in 0.163259 second(s), 19 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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