Separate windows signal and peak detection
Mostra commenti meno recenti
Hello,
In the below picture, I have to detect each window, where each augmentation of the signal represents an air inspiration. So, it's important to separate each window in order to get an accurate breath rate.

%data_blue{i}.meanBlueLevels --> Original signal (subplot(2,1,1))
data_filter=lowpass(data_blue{i}.meanBlueLevels,0.1,Fs);
data_filter=data_filter.^2;
t=1:length(data_blue{i}.meanBlueLevels);
subplot(2,1,1)
plot(t,data_blue{i}.meanBlueLevels)
subplot(2,1,2)
plot(t,data_filter)
I tried to use the built function envelope with the 'peak' parameter, but I think it will be not have enough robustness ... (I should avoid using of any threshold.)
Any help is much appreciated. Thank you.
Risposte (2)
Image Analyst
il 30 Mag 2021
Modificato: Image Analyst
il 30 Mag 2021
Attach your data. What if you just threshold? Why do you refuse to use a threshold? It looks like it would work well.
itsABreath = signal > 1; % Or whatever value works.
This will be true if the signal is more than 1 and false if it's less than 1.
If you have the Image Processing Toolbox, you can label each breath and then use regionprops(), or ismember() and find(), to find the starting and stopping index of each breath.
We've seen this before with audio signals and people wanted to determine the voiced and silent parts of the audio recording so you might search for silent, silence, voice, words, and things like that.
7 Commenti
Ilan Moshe
il 30 Mag 2021
Modificato: Ilan Moshe
il 30 Mag 2021
Image Analyst
il 30 Mag 2021
You can attach your data with the paperclip icon. zip it up if it's not a file extension that is allowed.
You can set your threshold higher and then march down the sides of the peak until the signal begins to turn upward.
Ilan Moshe
il 30 Mag 2021
Image Analyst
il 30 Mag 2021
OK, looks like you might be able to detrend the data by getting a baseline with movmin() and then subtracting that. Then the thresholding should work better.
And/Or you could use findpeaks() after sgolayfilt() and set the parameters right, especially MinPeakDistance and MinPeakHeight.
Ilan Moshe
il 31 Mag 2021
Ilan Moshe
il 31 Mag 2021
Image Analyst
il 5 Lug 2021
Modificato: Image Analyst
il 5 Lug 2021
Sorry, I didn't notice your comment. Are you still having trouble?
Alexis
il 5 Lug 2021
0 voti
This function might be helpful? https://uk.mathworks.com/matlabcentral/fileexchange/81066-breathtimes?s_tid=srchtitle
Categorie
Scopri di più su Descriptive Statistics in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

