[SciPy-User] Boxcar smoothing of 1D data array...?
Fri Jun 18 06:22:45 CDT 2010
Den 16.06.2010 02:26, skrev David Baddeley:
> Alternatively you could just use scipy.convolve with a tophat kernel
> ie (for a filter of length N & signal y):
> scipy.convolve(y, ones(N)/N)
> see the docs for scipy.convolve for more info (you might want to
> specify how it handles the ends, for example)
You should not use convolution for boxcar filtering. It can be solved
using a recursive filter, basically
y[n] = y[n-1] + x[n] - x[n-m]
then normalize y by 1/m.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User