使用gaus4母小波的心电图信号的小波熵计算

时间:2019-01-24 17:06:08

标签: matlab entropy wavelet

我正在尝试执行标题为“未分割心电图的心音分类”的论文 这是链接: https://www.researchgate.net/publication/316848688_Heart_sound_classification_from_unsegmented_phonocardiograms 但是我在论文中具体说明的小波熵的计算方面很挣扎,如本文所附屏幕截图所示。 这是我编写的代码,用于用PCG信号中最重的小波熵来计算五个第二段,但它给了我怪异的值 我只想知道我在做错什么,以及如何在该论文中计算小波熵,因为我确定我做错了。

% Read the .wav signals and store them in cell array.
sounds = dir('*.wav'); 
num_files = length(sounds);
mydata = cell(1, num_files);

for k = 1:num_files 
[mydata{k},Fs] = audioread(sounds(k).name); 
end
%  Define the variable heighest_e that Carries
%  the value of heighest wavelet entropy value of 
%  five second segment and the filtered signal
%  array that carries the filtered 5 secs segments.
heighest_e = 0;
filtered_signal = zeros(num_files,10000);
feature_vector = zeros(num_files,1);

%  iterate over all heart sound files one by one.
for i = 1:num_files
signal_cell = mydata(1,i);
signal = cell2mat(signal_cell);

length_signal = length(signal);
iterations = floor(length_signal/2000);

% choose the five second segment with heighest wavelet entropy.
for itr = 1: (iterations - 4)
    m = 1;
    rec5sec = signal(m : m + 9999,:);
    e = wentropy(rec5sec,'shannon');

    if e > heighest_e
        heighest_e = e;
        final_sig = rec5sec;
    end    
    m = m + 1999;
end
filtered_signal(i,:) = final_sig;
feature_vector(i,:) = heighest_e;
end

0 个答案:

没有答案