声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2328|回复: 5

[编程技巧] EMD分解语音信号求近似熵

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

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

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

x
哪位大神会近似熵的程序啊,对已经分解的imf分量(EMD分解)求近似熵,求好心人帮帮忙,有酬谢哦...

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

发表于 2014-5-3 22:42 | 显示全部楼层
 楼主| 发表于 2014-5-4 10:38 | 显示全部楼层
这个程序我试过,有错,调试过也不行,而且程序不全,后面应该还有几句
发表于 2014-5-4 21:52 | 显示全部楼层
zhendongbang 发表于 2014-5-4 10:38
这个程序我试过,有错,调试过也不行,而且程序不全,后面应该还有几句

  1. function [apen] = approx_entropy(n,r,a)


  2. %% Code for computing approximate entropy for a time series: Approximate
  3. % Entropy is a measure of complexity. It quantifies the unpredictability of
  4. % fluctuations in a time series

  5. % To run this function- type: approx_entropy('window length','similarity measure','data set')

  6. % i.e  approx_entropy(5,0.5,a)

  7. % window length= length of the window, which should be considered in each iteration
  8. % similarity measure = measure of distance between the elements
  9. % data set = data vector

  10. % small values of apen (approx entropy) means data is predictable, whereas
  11. % higher values mean that data is unpredictable

  12. % concept boorowed from http://www.physionet.org/physiotools/ApEn/

  13. % Author: Avinash Parnandi
  14. %%


  15. data =a;


  16. for m=n:n+1; % run it twice, with window size differing by 1

  17. set = 0;
  18. count = 0;
  19. counter = 0;
  20. window_correlation = zeros(1,(length(data)-m+1));

  21. for i=1:(length(data))-m+1,
  22.     current_window = data(i:i+m-1); % current window stores the sequence to be compared with other sequences
  23.    
  24.     for j=1:length(data)-m+1,
  25.     sliding_window = data(j:j+m-1); % get a window for comparision with the current_window
  26.    
  27.     % compare two windows, element by element
  28.     % can also use some kind of norm measure; that will perform better
  29.     for k=1:m,
  30.         if((abs(current_window(k)-sliding_window(k))>r) && set == 0)
  31.             set = 1; % i.e. the difference between the two sequence is greater than the given value
  32.         end
  33.     end
  34.     if(set==0)
  35.          count = count+1; % this measures how many sliding_windows are similar to the current_window
  36.     end
  37.     set = 0; % reseting 'set'
  38.    
  39.     end
  40.    counter(i)=count/(length(data)-m+1); % we need the number of similar windows for every cuurent_window
  41.    count=0;
  42. i;
  43. end  %  for i=1:(length(data))-m+1, ends here


  44. counter;  % this tells how many similar windows are present for each window of length m
  45. %total_similar_windows = sum(counter);

  46. %window_correlation = counter/(length(data)-m+1);
  47. correlation(m-n+1) = ((sum(counter))/(length(data)-m+1));


  48. end % for m=n:n+1; % run it twice   
  49.    correlation(1);
  50.    correlation(2);
  51. apen = log(correlation(1)/correlation(2));
  52.    
复制代码
没用过近似商,这个是别人写的一个程序,你试试吧,


 楼主| 发表于 2014-5-5 11:09 | 显示全部楼层
等待验证中....
发表于 2014-10-8 11:46 | 显示全部楼层
我也在等待
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-11-28 17:24 , Processed in 0.080935 second(s), 21 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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