[SciPy-Dev] SciPy Goal

Travis Oliphant travis@continuum...
Thu Jan 5 15:48:29 CST 2012


On Jan 5, 2012, at 1:19 PM, Neal Becker wrote:

> Travis Oliphant wrote:
> 
>> 
>> On Jan 5, 2012, at 10:00 AM, josef.pktd@gmail.com wrote:
>> 
>>> On Thu, Jan 5, 2012 at 10:32 AM, Neal Becker <ndbecker2@gmail.com> wrote:
>>>> Some comments on signal processing:
>>>> 
>>>> Correct me if I'm wrong, but I think scipy signal (like matlab) implement
>>>> only a
>>>> general purpose filter, which is an IIR filter, single rate.  Efficiency is
>>>> very important in my work, so I implement many optimized variations.
>>>> 
>>>> Most of the time, FIR filters are used.  These then come in variations for
>>>> single rate, interpolation, and decimation (there is also another design for
>>>> rational rate conversion).  Then these have variants for scalar/complex
>>>> input/output, as well as complex in/out with scalar coefficients.
>>>> 
>>>> IIR filters are seperate.
>>>> 
>>>> FFT based FIR filters are another type, and include both complex in/out as
>>>> well as scalar in/out (taking advantage of the 'two channel' trick for fft).
>>> 
>>> just out of curiosity: why no FFT base IIR filter?
>>> 
>>> It looks like a small change in the implementation, but it is slower
>>> than lfilter for shorter time series so I mostly dropped fft based
>>> filtering.
>> 
>> I think he is talking about filter design, correct?
>> 
> 
> The comments I made were all about efficient filter implementation, not about 
> filter design.
> 
> About FFT-based IIR filter, I never heard of it.  I was talking about the fact 
> that fft can be used to efficiently implement a linear convolution exactly (for 
> the case of convolution of a finite or short sequence - the impulse response of 
> the filter - with a long or infinite sequence, the overlap-add or overlap-save 
> techniques are used).

Sure, of course.   It's hard to know the way people are using terms.   I agree that people don't usually use the term IIR when talking about an FFT-based filter (but there is an "effective" time-domain response for every filtering operation done in the Fourier domain --- as you noted).   That's what I was referring to. 

It's been a while since I wrote lfilter, but it transposes the filtering operation  into Direct Form II, and then does a straightforward implementation of the feed-back and feed-forward equations.  

Here is some information on the approach:  
https://ccrma.stanford.edu/~jos/fp/Direct_Form_II.html

IIR filters implemented in the time-domain need something like lfilter.   FIR filters are "just" convolution in the time domain --- and there are different approaches to doing that discrete-time convolution as you've noted.   IIR filters are *just* convolution as well (but convolution with an infinite sequence).   Of course, if you use the FFT-domain to implement the filter, then you can just as well design in that space the filtering-function you want to multiply the input signal with (it's just important to keep in mind the impact in the time-domain of what you are doing in the frequency domain --- i.e. sharp-edges result in ringing, the basic time-frequency product limitations, etc.)

These same ideas come under different names and have different emphasis in different disciplines. 

-Travis

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20120105/6a2e7da7/attachment.html 


More information about the SciPy-Dev mailing list