Wavelet entropy calculation for a phonocardiogram signal with gaus4 mother wavelet

3 views (last 30 days)
I was trying to implement the paper titled "Heart sound classification from unsegmented phonocardiograms"
this is the link:
but I am struggling with the calculation of wavelet entropy spicified in the paper as shown in the attached screenshots of the paper.
This is the code I wrote to calculate the five second segment with the heighest wavelet entropy whithin the PCG signal but it gives me weird values
I just want to know what I am doing wrong and how to calculate the wavelet entropy in that paper because I am sure I am wrong.
% Read the .wav signals within training-a folder 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);
% 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;
end

Answers (0)

Categories

Find more on ECG / EKG in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!