Peak detection in signal (python)

43 views
Skip to first unread message

Dilawar Singh

unread,
Oct 11, 2017, 8:44:54 AM10/11/17
to wncc...@googlegroups.com
Usually people use `scipy.signal` to detect peak in signal.

>>> scipy.signal.find_peaks_cwt( vec )

which returns list of index where vec is maximum. However this does not work all
the time especially when you want to compute the modality of a distribution.

This is the most sophisticated library (AFAIK): https://gist.github.com/sixtenbe/1178136

Its can be installed via pip:

$ pip install analytic_wfm

To use,

>>> import analytic_wfm
>>> vec # this is the 1d array in which I want to detect peaks.
>>> maxPeaks, minPeaks = analytic_wfm.peakdetect( vec, lookahead = 10 )

This returns maximum peaks and minimum peaks. There are various other functions
described in readme.txt file.

Dilawar
Reply all
Reply to author
Forward
0 new messages