声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 6722|回复: 6

[分形与混沌] 求排列熵的matlab源程序?

[复制链接]
发表于 2012-12-3 21:57 | 显示全部楼层 |阅读模式

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

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

x
本人需要求出手上脑电数据的排列熵,哪位大侠能赐教排列熵的matlab源程序?
回复
分享到:

使用道具 举报

发表于 2012-12-5 01:10 | 显示全部楼层
  1. function [pe hist] = pec(y,m,t)

  2. %  Calculate the permutation entropy

  3. %  Input:   y: time series;
  4. %           m: order of permuation entropy
  5. %           t: delay time of permuation entropy,

  6. % Output:
  7. %           pe:    permuation entropy
  8. %           hist:  the histogram for the order distribution

  9. %Ref: G Ouyang, J Li, X Liu, X Li, Dynamic Characteristics of Absence EEG Recordings with Multiscale Permutation %     %                             Entropy Analysis, Epilepsy Research, doi: 10.1016/j.eplepsyres.2012.11.003
  10. %     X Li, G Ouyang, D Richards, Predictability analysis of absence seizures with permutation entropy, Epilepsy %     %                            Research,  Vol. 77pp. 70-74, 2007



  11. ly = length(y);
  12. permlist = perms(1:m);
  13. c(1:length(permlist))=0;
  14.    
  15. for j=1:ly-t*(m-1)
  16.      [a,iv]=sort(y(j:t:j+t*(m-1)));
  17.      for jj=1:length(permlist)
  18.          if (abs(permlist(jj,:)-iv))==0
  19.              c(jj) = c(jj) + 1 ;
  20.          end
  21.      end
  22. end

  23. hist = c;

  24. c=c(find(c~=0));
  25. p = c/sum(c);
  26. pe = -sum(p .* log(p));
复制代码


 楼主| 发表于 2012-12-9 10:25 | 显示全部楼层
发表于 2012-12-21 22:50 | 显示全部楼层
Multiscale Permutation Entropy (MPE)

matlabcentral/fileexchange/authors/256154
发表于 2013-7-23 10:21 | 显示全部楼层
这个程序计算时有很多冗余,在算m=7以上的排列熵时,慢得要命
发表于 2013-8-23 09:26 | 显示全部楼层
jf00332001 发表于 2013-7-23 10:21
这个程序计算时有很多冗余,在算m=7以上的排列熵时,慢得要命

不对吧,大于1呢
发表于 2017-9-4 17:50 | 显示全部楼层
五楼说的对,计算量有点大
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-5-7 00:06 , Processed in 0.061225 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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