Find Peaks

mlpy.findpeaks_dist()

Find peaks. With mindist parameter the algorithm ignore small peaks that occur in the neighborhood of a larger peak.

Parameters :
x : 1d array_like object

input data

mindist : integer (>=2)

minimum peak distance (minimum separation between peaks)

Returns :
idx : 1d numpy array int

peaks indexes

Example:

>>> import mlpy
>>> x = [6,2,2,1,3,4,1,3,1,1,1,6,2,2,7,1]
>>> mlpy.findpeaks_dist(x, mindist=3)
array([ 0,  5, 11, 14])
mlpy.findpeaks_win()

Find peaks with a sliding window of width span.

Parameters :
x : 1d array_like object

input data

span : odd integer (>=3)

span

Returns :
idx : 1d numpy array int

peaks indexes

Example:

>>> import mlpy
>>> x = [6,2,2,1,3,4,1,3,1,1,1,6,2,2,7,1]
>>> mlpy.findpeaks_win(x, span=3)
array([ 0,  5,  7, 11, 14])

Previous topic

Borda Count

Next topic

Dynamic Time Warping (DTW)

This Page