[SciPy-user] Numpy-discussion digest, Vol 1 #1753 - 1 msg

Nick Fotopoulos nvf at MIT.EDU
Tue May 9 13:01:52 EDT 2006


Dear all,

I sure wish I had seen John's link before writing my own decimate, but 
such is life.  I am going to transition this thread to the scipy list 
since it seems more as if it belongs there.

I have a comment which may be way, way beyond the scope of Ryan's 
intended application, but which probably should be made before a 
decimate function is added to scipy.  If you will be FFTing your 
decimated signal and care at all about the phase, then you may want to 
consider using something like filtfilt rather than just applying a 
single filter.  It filters a signal forwards then backwards in order to 
avoid introducing a phase delay, and is actually used in the Matlab 
implementation of decimate.

I found an implementation in Python here:
http://article.gmane.org/gmane.comp.python.scientific.user/1164/

While the author, Andrew Straw, seems to be suffering edge effects, it 
seems as if he's not windowing his data.  In my application, his 
filtfilt seems to do its job quite nicely.  Then again, I am also not a 
signals whiz.

Take care,
Nick

numpy-discussion-request at lists.sourceforge.net wrote:
> Message: 1
> To: "Ryan Krauss" <ryanlists at gmail.com>
> Cc: numpy-discussion <numpy-discussion at lists.sourceforge.net>
> Subject: Re: [Numpy-discussion] downsample vector with averaging
> From: John Hunter <jdhunter at ace.bsd.uchicago.edu>
> Date: Mon, 08 May 2006 21:31:51 -0500
> 
> You might look at the matlab function decimate -- it first does a
> chebyshev low-pass filter before it does the down-sampling.
> Conceptually similar to what you are proposing with simple averaging
> but with a little more sophistication
> 
>   http://www-ccs.ucsd.edu/matlab/toolbox/signal/decimate.html
> 
> An open source version (GPL) for octave by Paul Kienzle, who is one of
> the authors of the matplotlib quadmesh functionality and apparently a
> python convertee, is here
> 
>    http://users.powernet.co.uk/kienzle/octave/matcompat/scripts/signal/decimate.m
> 
> and it looks like someone has already translated this to python using
> scipy.signal
> 
>   http://www.bigbold.com/snippets/posts/show/1209
> 
> Some variant of this would be a nice addition to scipy.  
> 
> JDH
> 




More information about the SciPy-User mailing list