Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Numpy equivalent of Matlab's findpeaks function? [duplicate]

Tags:

python

numpy

Possible Duplicate:
Peak-finding algorithm for Python/SciPy

I'm looking to find local maxima in a vector of floating-point numbers, as is done by Matlab's findpeaks function.

Does numpy have a similar function?

Thanks!

like image 878
Louis Thibault Avatar asked May 11 '12 00:05

Louis Thibault


People also ask

Did NumPy copy MATLAB?

MATLAB® and NumPy have a lot in common, but NumPy was created to work with Python, not to be a MATLAB clone. This guide will help MATLAB users get started with NumPy.

Is NumPy like MATLAB?

NumPy arrays are the equivalent to the basic array data structure in MATLAB. With NumPy arrays, you can do things like inner and outer products, transposition, and element-wise operations.

How do you find peaks in Matlab?

pks = findpeaks( data ) returns a vector with the local maxima (peaks) of the input signal vector, data . A local peak is a data sample that is either larger than its two neighboring samples or is equal to Inf . The peaks are output in order of occurrence.


1 Answers

How about scipy.signal.find_peaks_cwt

http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks_cwt.html

or:

https://gist.github.com/1178136

like image 124
JoshAdel Avatar answered Oct 22 '22 09:10

JoshAdel