zhendongbang 发表于 2014-5-3 16:30

EMD分解语音信号求近似熵

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

chybeyond 发表于 2014-5-3 22:42

百度搜一下很多程序http://chainaren2008.blog.163.com/blog/static/17814101920113383349577/

zhendongbang 发表于 2014-5-4 10:38

这个程序我试过,有错,调试过也不行,而且程序不全,后面应该还有几句

chybeyond 发表于 2014-5-4 21:52

zhendongbang 发表于 2014-5-4 10:38
这个程序我试过,有错,调试过也不行,而且程序不全,后面应该还有几句

function = approx_entropy(n,r,a)


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

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

% i.eapprox_entropy(5,0.5,a)

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

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

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

% Author: Avinash Parnandi
%%


data =a;


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

set = 0;
count = 0;
counter = 0;
window_correlation = zeros(1,(length(data)-m+1));

for i=1:(length(data))-m+1,
    current_window = data(i:i+m-1); % current window stores the sequence to be compared with other sequences
   
    for j=1:length(data)-m+1,
    sliding_window = data(j:j+m-1); % get a window for comparision with the current_window
   
    % compare two windows, element by element
    % can also use some kind of norm measure; that will perform better
    for k=1:m,
      if((abs(current_window(k)-sliding_window(k))>r) && set == 0)
            set = 1; % i.e. the difference between the two sequence is greater than the given value
      end
    end
    if(set==0)
         count = count+1; % this measures how many sliding_windows are similar to the current_window
    end
    set = 0; % reseting 'set'
   
    end
   counter(i)=count/(length(data)-m+1); % we need the number of similar windows for every cuurent_window
   count=0;
i;
end%for i=1:(length(data))-m+1, ends here


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

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


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


zhendongbang 发表于 2014-5-5 11:09

等待验证中....

幸运53 发表于 2014-10-8 11:46

我也在等待
页: [1]
查看完整版本: EMD分解语音信号求近似熵