I have an entropy curve (1d numpy array) but this curve has a lot of noise. I would like to delete the noise with a smoothing.
This is the plot of my curve:
I have tried to solve this issue making a convolution product with a Kaiser-Bessel filter:
gaussian_curve = window_kaiser(windowLength, beta=20) # kaiser filter
gaussian_curve = gaussian_curve / sum(gaussian_curve)
for i in range(0, windows_number):
start = (i * step) + 1
end = (i * step) + windowLength
convolution[i] = (np.convolve(entropy[start:end + 1], gaussian_curve, mode='valid'))
entropy[i] = convolution[i][0]
but this code returns this error:
File "/usr/lib/python2.7/dist-packages/numpy/core/numeric.py", line 822, in convolve
raise ValueError('v cannot be empty')
ValueError: v cannot be empty
the numpy.convolve operator with 'valid' mode, returns the central element in the overlap but, in this case, returns an empty element.
is there a simple way to apply a smoothing?
thanks!