[SciPy-User] Boxcar smoothing of 1D data array...?
Fri Jun 18 15:13:26 CDT 2010
Out of curiosity, are there any reasons other than performance (which might be moot if you have to implement the recursive filter as a python loop) for not using a convolution?
From: Sturla Molden <firstname.lastname@example.org>
Sent: Fri, 18 June, 2010 11:22:45 PM
Subject: Re: [SciPy-User] Boxcar smoothing of 1D data array...?
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):
>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