How to Detect Two maxima peaks

Hi All
I am trying to detect the two peaks marked in blue arrow (in the image) along with its [value, location].
I have tried using max(), showpeaks(), etc., but they are detecting the other surrounding (insignificant) peaks along too.
Can someone help me with this?
Thanks.

 Accepted Answer

Use the 'MinPeakHeight' and 'MinPeakDistance' name-value pair arguments.
Example —
[pks,locs] = findpeaks(YourSignal, 'MinPeakHeight',55, 'MinPeakDistance',700);
That will likely work for the signal you plotted, although you may have to experiment with the 'MinPeakDistance' value.

More Answers (0)

Asked:

on 19 Aug 2017

Edited:

on 19 Aug 2017

Community Treasure Hunt

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

Start Hunting!