How can I draw 117 normal 292 abnormal heart sounds?
5 ビュー (過去 30 日間)
古いコメントを表示
I have a total of 409 heart sounds, 117 of which are normal and 292 of which are abnormal. I have prepared separate codes normally and abnormally, how should I go about drawing each sound?
The audio files were not added because they were too large, this is the example for which I found the code: https://www.mathworks.com/matlabcentral/fileexchange/65286-heart-sound-classifier
For example;
% fs:2000
[PCG_normal, fs] = audioread('a0011.wav');
p_normal = audioplayer(PCG_normal, fs);
play(p_normal, [1 (get(p_normal, 'SampleRate') * 3)]);
% Plot the sound waveform
plot(PCG_normal(1:fs*3))
[PCG_abnormal, fs] = audioread('a0001.wav');
p_abnormal = audioplayer(PCG_abnormal, fs);
play(p_abnormal, [1 (get(p_abnormal, 'SampleRate') * 3)]);
% Plot the sound waveform
plot(PCG_abnormal(1:fs*3))
0 件のコメント
採用された回答
Star Strider
2023 年 4 月 2 日
編集済み: Star Strider
2023 年 4 月 2 日
Drawing them depends on the result you want. Heart sounds are best displayed as time-frequency plots, so I would plot them using the pspectrum function with the 'spectrogram' option. (Ideally, they should be plotted along with the corresponding Lead II EKG trace.)
Plotting 409 of them might be something of a challenge, since tiledlayout and subplot would create axes that are too small to easily visualise.
EDIT — (2 Apr 2023 at 17:32)
This emphasizes the time-frequency characteristics of the phonocardiogram signals —
Uz1 = unzip('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1342909/heart%20sound.zip');
Uz2 = unzip('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1342914/records.zip');
[PCG_normal, fsn] = audioread(Uz1{2});
p_normal = audioplayer(PCG_normal, fsn);
Ln = size(PCG_normal,1);
tn = linspace(0, Ln-1, Ln)/fsn;
play(p_normal, [1 (get(p_normal, 'SampleRate') * 3)]);
% Plot the sound waveform
figure
plot(PCG_normal(1:fsn*3))
[PCG_abnormal, fsa] = audioread(Uz1{1});
p_abnormal = audioplayer(PCG_abnormal, fsa);
La = size(PCG_abnormal,1);
ta = linspace(0, La-1, La)/fsa;
play(p_abnormal, [1 (get(p_abnormal, 'SampleRate') * 3)]);
% Plot the sound waveform
figure
plot(PCG_abnormal(1:fsa*3))
figure
tiledlayout(2,2)
nexttile
pspectrum(PCG_normal, fsn,'spectrogram')
colormap(turbo)
nexttile
pspectrum(PCG_abnormal, fsa,'spectrogram')
colormap(turbo)
nexttile
plot(tn,PCG_normal)
xlabel('t')
ylabel('Amplitude')
title('PCG Normal')
xlim([0 max(tn)])
grid
nexttile
plot(ta,PCG_abnormal)
xlabel('t')
ylabel('Amplitude')
title('PCG Abnormal')
xlim([0 max(ta)])
grid
.
10 件のコメント
Star Strider
2023 年 4 月 13 日
My pleasure!
If my Answer helped you solve your problem, please Accept it!
.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Measurements and Spatial Audio についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!