[SciPy-user] scipy.signal.firwin

Lev Givon lev@columbia....
Fri Mar 20 13:19:48 CDT 2009


Received from Jan Rauberg on Fri, Mar 20, 2009 at 03:25:59AM EDT:
> Lev Givon <lev <at> columbia.edu> writes:
> 
> > 
> > Received from Jan Rauberg on Wed, Mar 18, 2009 at 03:48:45PM EDT:
> > > I'm missing the functionality of firwin like in matlab/octave fir1, so that I
> > > can give a 'low', 'high' and 'stop' option. I don't know how to create a FIR
> > > window based high pass filter. Or is there something planned for the future?
> > > 
> > > Thank you
> > > Jan
> > 
> > If you want to create a high-pass filter, just specify the cutoff to
> > firwin and flip the signs of the obtained coefficients, i.e.,
> > 
> > b = -firwin(N,cutoff)
> 
> Thank you for the fast response. But in the way as you described I get an
> inverted low pass figure. That's not a high pass and no solution for my problem
> too. 

Oops..you're right; that's not going to work for an arbitrary cutoff frequency.

> Perhaps there is another solution? J.R.

You could construct an FIR filter using the Parks-McClellan algorithm;
I once implemented a remezord() function to select the appropriate
parameters:

http://projects.scipy.org/scipy/ticket/475

							L.G.


More information about the SciPy-user mailing list