[SciPy-User] FIR filter with arbitrary frequency response

Warren Weckesser warren.weckesser@enthought....
Sat Nov 20 22:24:21 CST 2010

Another comment about using fir_filter_design "stand-alone" is below...

On Sat, Nov 20, 2010 at 10:09 PM, Warren Weckesser <
warren.weckesser@enthought.com> wrote:

> On Sat, Nov 20, 2010 at 9:43 PM, Nathaniel Smith <njs@pobox.com> wrote:
>> I was wondering if anyone has already written Python code to design
>> FIR filters with arbitrary (given) frequency response via
>> IDFT+windowing, a la 'fir2' in octave/matlab?
>>  http://octave.sourceforge.net/signal/function/fir2.html
>>  (Theory: http://www.dspguide.com/ch17/1.htm)
>> I don't see it in scipy, but it seems generally useful. (I might end
>> up writing it if no-one else has, but I'm not sure yet whether it's
>> actually useful for my problem.)
> Hi Nathaniel,
> There is one implemented as the function firwin2 currently under review in
> this ticket:
>     http://projects.scipy.org/scipy/ticket/457
> It will eventually be added to scipy.signal.  Included in the ticket is a
> patch file that can be applied to the latest version of the scipy source,
> and also a copy of just the updated file fir_filter_design.py.  You could
> grab that and try it stand-alone (but you would have to comment out the
> local import of sigtools, which is used by the remez function in
> fir_filter_design.py).

You will also need to change line 428 from
        from signaltools import get_window
        from scipy.signal import get_window
if you want to use the file fir_filter_design.py outside of the scipy.signal
source directory.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20101120/86439619/attachment.html 

More information about the SciPy-User mailing list