필터 지우기
필터 지우기

How to detect peaks above a given threshold value?

조회 수: 46 (최근 30일)
Sudip Paudel
Sudip Paudel 2020년 7월 20일
댓글: Sudip Paudel 2020년 7월 22일
findpeaks() can detect multiple peaks if there is/are change in direction(s) even if the values are above the specified threshold (see arrows in the attached pdf file).
J=a vector;
findpeaks(J,'MinPeakHeight',Threshold);hold on;
yline(Threshold,'--','LineWidth',3);
hold off
  댓글 수: 4
madhan ravi
madhan ravi 2020년 7월 20일
What happens when you change it to 20?
Sudip Paudel
Sudip Paudel 2020년 7월 20일
Hi Madhan, we will not detect other peaks if I change the threshold value to 20. My goal is to count it only once if the signal goes above the threshold value until it goes below the specified threshold.

댓글을 달려면 로그인하십시오.

채택된 답변

Rashedur Rahman
Rashedur Rahman 2020년 7월 20일
Hi Sudip.
The function 'findpeaks' can take several input arguments for finding peaks according to criteria. You can use multiple arguments to adjust your peak finding algorithm. I will suggest you to read the description of 'findpeaks'. ('https://www.mathworks.com/help/signal/ref/findpeaks.html').
Another way is to apply a filter to smoothen the signal and then apply 'findpeaks'.

추가 답변 (1개)

Image Analyst
Image Analyst 2020년 7월 20일
편집: Image Analyst 2020년 7월 20일
Try flattening the signal by subtracting that red trend line. Then set the values of the signal below the threshold to zero and then call findpeaks()
smoothedSignal = movmean(signal, 101);
flattenedSignal = signal - smoothedSignal;
flattenedSignal(flattenedSignal < someThreshold) = 0;
[peakValues, indexesOfPeaks] = findpeaks(flattenedSignal);
Attach your data in a .mat file if you need more help.

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by