MATLAB: How to Detect Two maxima peaks

global maximapeak detectSignal Processing Toolbox

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.

Best 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.
Related Question