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!
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With