Findpeaks based on signal frequency

2 次查看(过去 30 天)
Kcire L
Kcire L 2022-10-26
Hello,
I am trying to use findpeaks on a signal that has a specific frequency component. This signal is repiratory audio, and I am trying to separate the inhales vs the exhales. After obtaining the respiratory rate, I am trying to use findpeaks to isolate inhale vs exhale, but it does not always work properly. I was hoping someone here could help me refine this.
I calculate repspiratory rate using the FFT of the envelope of the signal. Then use findpeaks like below.
snip_lo = max(inverted_snip);
[v1, vv] = findpeaks(inverted_snip, "MinPeakDistance", Fs*((RespRate)/2), "MinPeakHeight", snip_lo *.85);
Whe it works out I can later isolate each valley to get a plot like this.
When it does not work out, the inhales and exhales get out of sync.
Each red plot should represent an exhale while the green represents an inhale, however, in the second image, the signal is too noisy in the center to decern between the peaks for the method I am using.
Any help would be very much appreciated.
Thank you.

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by