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

David Baddeley david_baddeley at yahoo.com.au
Tue Jun 15 20:26:35 EDT 2010


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)

cheers,
David



________________________________
From: Benjamin Root <ben.root at ou.edu>
To: SciPy Users List <scipy-user at scipy.org>
Sent: Wed, 16 June, 2010 3:46:37 AM
Subject: Re: [SciPy-User] Boxcar smoothing of 1D data array...?

Emil,

You can find various windowing functions like boxcar, hamming and hanning in scipy.signals module.

Ben Root



On Sat, Jun 12, 2010 at 10:28 AM, <thoeger at nbi.ku.dk> wrote:

Hello list;
>
>>This seems like it should be a simple task, but I couldn't seem to find
>>anything in the docs about it - or rather, what I found seems to be from
>>the Numeric/Numarray days and not valid anymore.
>
>>As the subject line suggests, I have a 1D array that I want to
>>smooth/convolve with a Boxcar kernel of a certain width. In IDL there's
>>simply a function to do this, and there might be something people have
>>hacked together out there to do it too - but isn't there a simple way to
>>do it using built-in NumPy and SciPy tools?
>
>> Cheers;
>>Emil
>
>>_______________________________________________
>>SciPy-User mailing list
>SciPy-User at scipy.org
>http://mail.scipy.org/mailman/listinfo/scipy-user
>



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20100615/bd487201/attachment.html>


More information about the SciPy-User mailing list