[Numpy-discussion] peak finding approach

Davide Cittaro davide.cittaro at ifom-ieo-campus.it
Thu Mar 18 17:19:13 EDT 2010

Hi all, 
Is there a fast numpy way to find the peak boundaries in a (looong, millions of points) smoothed signal? I've found some approaches, like this:

z = data[1:-1]
l = data[:-2]
r = data[2:]
f = np.greater(z, l)
f *= np.greater(z, r)
boundaries = np.nonzero(f)

but it is too sensitive... it detects any small variations in slope on the shoulders of a bigger peak... 
Any hint?



More information about the NumPy-Discussion mailing list