1D non-maximum suppression in Python/scipy
Do you just mean a maximum filter? If so, have a look at scipy.ndimage.maximum_filter1d
As a quick example:
import numpy as np
import scipy.ndimage as ndimage
input = np.sin(np.linspace(0, 4*np.pi, 20))
input = (input * 10).astype(np.int) # Makes it easier to read
output = ndimage.maximum_filter1d(input, 4)
print 'In: ', input
print 'Out:', output
This yields:
In: [ 0 6 9 9 4 -1 -7 -9 -8 -3 3 8 9 7 1 -4 -9 -9 -6 0]
Out: [ 6 9 9 9 9 9 4 -1 -3 3 8 9 9 9 9 7 1 -4 0 0]