How can i detecting and marking wheezes on a plot?
1 view (last 30 days)
Show older comments
>> soundData=structWheeze(2,1).SoundData;
>> plot(soundData)
>> flow=structWheeze(2,1).Flow;
>> figure(1),hold on,plot(flow,'r')
>> legend('soundData','flow')
>> soundsc(soundData,9600)
>> grid on
>> figure(2),specgram(soundData)
>> colorbar;
WS_new_array=structWheeze(2,1).Properties.WS_new
WS_new_array =
1063
17565
21359
36899
55411
70245
90088
102232
114892
119569
123811
>> WE_new_array=structWheeze(2,1).Properties.WE_new
WE_new_array =
7952
19385
26744
45315
61905
77760
94105
111387
117453
122765
126968
>> for i=1:length(WS_new_array)
startindex=WS_new_array(i)
endindex=WE_new_array()
endindex=WE_new_array(i);
plot(soundData(startindex:endindex))
pause
end
These are my code.SoundData array: A channel sound (sampling rate 9600) of the patient. Flow array: breath flow signal. WS_new_array and WE_new_array will give you start and end indexes of wheezes. When I zoom your plotted sound, wheezes will be seen between these indexes. Finally, I need to make a markup on the time-plot graph. These are what I need to do. But i could not marking on the time-plot part. What I want from you to what i should add to this code or help me where I went wrong.
0 Comments
Answers (1)
Star Strider
on 15 Dec 2020
I have no idea what you are asking.
2 Comments
Star Strider
on 15 Dec 2020
Since you already have the indices, you can either draw horizontal lines through them, or use the text function to annotate them, or both.
Try this:
WS_new_array = [ 1063
17565
21359
36899
55411
70245
90088
102232
114892
119569
123811];
WE_new_array = [ 7952
19385
26744
45315
61905
77760
94105
111387
117453
122765
126968];
figure
plot([WS_new_array, WE_new_array].', ones(2, size(WS_new_array,1))*5, '-r', 'LineWidth',2)
grid
xlabel('Index')
.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!