近似熵的一种快速实用算法

Pincus提出的近似熵算法中有很多冗余的计算,效率低,速度慢,不利于实际应用,洪波等人在定义的基础上引入二值距离矩阵的概率,提出了一种实用快速的算法。

  1. function ApEn=EntropyCompute(sig,m,r0)
  2. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  3. % 计算一维信号的近似熵,采用快速算法
  4. % sig: 待求近似熵的源信号
  5. % m: 一般取 2
  6. % r0: 一般取0.1 ~ 0.25
  7. % Ref: 近似熵:一种应用于短数据的的复杂性度量,杨福生
  8. % 近似熵及其在机械设备故障诊断中的应用,胥永刚
  9. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  10. N = size(sig,1);
  11. r=r0*std(sig);
  12. d=zeros(N,N);
  13. %%% 计算距离矩阵 %%%
  14. for i=1:N
  15. d(i,:)=abs(sig(i)-sig) < r;
  16. end
  17. %%% 计算C2 %%%
  18. c2=zeros(1,N-m+1);
  19. for i=1:N-m+1
  20. for j=1:N-1;
  21. buf = d(i,j) & d(i+1,j+1);
  22. c2(i)=c2(i)+buf;
  23. end
  24. end
  25. Fi(1)=sum(log(c2))/(N-m+1);
  26. m=m+1;
  27. %%% 计算C3 %%%
  28. c3=zeros(1,N-m+1);
  29. for i=1:N-m+1
  30. for j=1:N-2;
  31. c3(i)=c3(i)+(d(i,j) & d(i+1,j+1) & d(i+2,j+2));
  32. end
  33. end
  34. Fi(2)=sum(log(c3))/(N-m+1);
  35. ApEn=Fi(1)-Fi(2);
  36. return;

The algorithm of entropy realization的更多相关文章

  1. A Gentle Introduction to the Gradient Boosting Algorithm for Machine Learning

    A Gentle Introduction to the Gradient Boosting Algorithm for Machine Learning by Jason Brownlee on S ...

  2. Akumuli时间序列数据库——列存储,LSM,MVCC

    Features Column-oriented time-series database. Log-structured append-only B+tree with multiversion c ...

  3. Lempel-Ziv algorithm realization

    Lempel-Ziv 复杂度程序 随着人们对非线性方法的分析越加深入,他们发现,虽然关联维度和最大李雅谱诺夫指数在分析脑电时具有一定的帮助,但是它们对数据的依赖性太强,对干扰和噪 声太敏感,而且要得到 ...

  4. [转载] Calculating Entropy

    From:  johndcook.com/blog For a set of positive probabilities pi summing to 1, their entropy is defi ...

  5. hdu 1053 Entropy

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=1053 Entropy Description An entropy encoder is a data ...

  6. ZOJ 3827 Information Entropy 水题

    Information Entropy Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.zju.edu.cn/onlinejudge/sh ...

  7. Reducing the Dimensionality of data with neural networks / A fast learing algorithm for deep belief net

    Deeplearning原文作者Hinton代码注解 Matlab示例代码为两部分,分别对应不同的论文: . Reducing the Dimensionality of data with neur ...

  8. [POJ 1521]--Entropy(哈夫曼树)

    题目链接:http://poj.org/problem?id=1521 Entropy Time Limit: 1000MS    Memory Limit: 10000K Description A ...

  9. ZOJ3827 ACM-ICPC 2014 亚洲区域赛的比赛现场牡丹江I称号 Information Entropy 水的问题

    Information Entropy Time Limit: 2 Seconds      Memory Limit: 131072 KB      Special Judge Informatio ...

随机推荐

  1. asp.net core 登录身份认证(Cookie)

    asp.net core 2最简单的登录功能 源代码在此 创建asp.net core Web Mvc项目 配置下选项 项目目录结构 在Models文件夹下新建两个实体类 public class T ...

  2. C++解析(14):静态成员变量与静态成员函数

    0.目录 1.静态成员变量 2.静态成员函数 3.小结 1.静态成员变量 成员变量的回顾: 通过对象名能够访问public成员变量 每个对象的成员变量都是专属的 成员变量不能在对象之间共享 新的需求: ...

  3. HDU1863畅通工程---并查集+最小生成树

    #include<cstdio> #include<algorithm> #define MAX 105 struct edge { int from,to; long lon ...

  4. 解题:POI 2007 Weights

    题面 这是个$O(nlog^2$ $n)$的解法,因为蒟蒻博主没有看懂$O(nlog$ $n)$的更优秀的解法 显然从小到大装砝码是最优的方法,又显然从大到小装容器不会使得答案变劣,还显然砝码数具有单 ...

  5. bzoj2962 序列操作

    2962: 序列操作 Time Limit: 50 Sec  Memory Limit: 256 MBSubmit: 1145  Solved: 378[Submit][Status][Discuss ...

  6. TCP/IP地址格式转换API

    1.htonl ()和ntohl( )  ntohl( )-----网络顺序转换成主机顺序(长整型) u_long PASCAL FAR ntohl (u_long netlong); htonl ( ...

  7. 「git」mac下git提交github代码

    1.打开终端,输入 cd -/.ssh 这个是检查你的ssh的是否存在的,如果存在,先将已有的ssh备份,或者将新建的ssh生成到另外的目录下(如果第一次配置一般都是不存在的),不存在,你将会看到如下 ...

  8. 「电脑应用」在mac上使用aria2

    Chrome 一. 需要工具: Chrome浏览器,Aria2GUI,Chrome里BaiduExporter插件. 首先先明确一件事情,平时生活中使用的所有工具都建议到官方下载,此处用到的几样提供给 ...

  9. [DeeplearningAI笔记]卷积神经网络4.6-4.10神经网络风格迁移

    4.4特殊应用:人脸识别和神经网络风格转换 觉得有用的话,欢迎一起讨论相互学习~Follow Me 4.6什么是神经网络风格转换neural style transfer 将原图片作为内容图片Cont ...

  10. OpenCV---边缘保留滤波EPF

    OpenCV经典的两种实现EPF方法:高斯双边和均值迁移 一:双边模糊 差异越大,越会完整保留 def bi_demo(image): dst = cv.bilateralFilter(image,0 ...