detect_peaksΒΆ

detect_peaks finds peaks and valleys in a given noisy signal. Only local minima and maxima detected where the difference between adjacent extreme values are greater than the threshold.

<iMax, iMin> = detect_peaks(rvY, rsThreshold);

Return Value

iMax is a vector of indices of the local maxima (Peaks) or 0 if non are found. iMin is a vector of indices of the local minima (Valleys) or 0 if none are found.

Parameters

rvY

rvY is a noisy signal vector.

rsThreshold

rsThreshold is the peak threshold. Only peaks are detected where the difference between adjacent extreme values are greater than the threshold.

Example

* <iMax, iMin> = detect_peaks([4,6,3,4,7,4,1,8], 2)
* iMax
    2.0000     5.0000      8.0000
* iMin
    3.0000     7.0000

History

Version Description
R2013.0 New.

id-865033