[SciPy-User] Boxcar smoothing of 1D data array...?

Anne Archibald aarchiba at physics.mcgill.ca
Fri Jun 18 10:51:28 EDT 2010


On 18 June 2010 07:22, Sturla Molden <sturla at molden.no> wrote:
>
> 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.

How does the numerical stability of this compare to a FIR
implementation (with or without a Fourier transform)?

Anne

> Sturla
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>



More information about the SciPy-User mailing list