- Use the "MinPeakProminence" property of "findpeaks" function with a suitable prominence value to make the peak detection better. You can refer to this link for more information about the same: https://www.mathworks.com/help/signal/ref/findpeaks.html#buff2uu:~:text=MinPeakProminence%20%E2%80%94%20Minimum%20peak%20prominence
- Use noise reduction techniques like smoothing or filtering before using "findpeaks".
- The following link might also be useful: https://www.mathworks.com/help/signal/ug/peak-analysis.html
Findpeaks based on signal frequency
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (1개)
charan
2025년 6월 19일
Hi,
Your approach does not seem to work whenever the spacing of breaths is inconsistent. In such cases using a fixed "MinPeakDistance" like "Fs*(RespRate)/2" might not capture both phases reliably. Here are some steps you can try out to fix this:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Spectral Estimation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!