Python peak detection: how does the scipy.signal.find_peaks_cwt function work?

I am trying to identify some peaks in some spectrograph data and tried to use for this scipy.signal.find_peaks_cwt().

However, the official documentation I found is not too descriptive, and tends to detect false peaks in noise, sometimes not detecting actual peaks in the data.

Can someone give me a better explanation of the parameters in this function that I can play with, including the "width", or could you show me some alternatives?

+5
source share
1 answer

, , PeakUtils. , scipy.signal.find_peaks_cwt:

import numpy as np
from peakutils.peak import indexes
vector = [ 0, 6, 25, 20, 15, 8, 15, 6, 0, 6, 0, -5, -15, -3, 4, 10, 8, 13, 8, 10, 3, 1, 20, 7, 3, 0 ]
print('Detect peaks with minimum height and distance filters.')
indexes = indexes(np.array(vector), thres=7.0/max(vector), min_dist=2)
print('Peaks are: %s' % (indexes))

enter image description here

Scipy find_peaks_cwt , -.

+5

All Articles