[SciPy-user] firwin upgrades

Tom K. tpk at kraussfamily.org
Sat May 2 21:49:28 EDT 2009



Stéfan van der Walt wrote:
> 
> The current signature is
> 
> s.firwin(N, cutoff, width=None, window='hamming')
> 
> In the suggested API (which is just that, since I haven't designed
> filters in ages) the input is always an array/list, so what I would do
> is to change the signature to
> 
> s.firwin(N, freqs, type='pass', width=None, window='hamming')
> 
> Whenever freqs is a scalar and type is 'pass', we have the old
> behaviour (and API compatibility).  For other behaviour, the user has
> to change type to 'stop', or has to specify an array of values in
> freqs.
> 
> Is freqz working properly?  I'm trying to get a filter response out of
> it, but the results look a bit strange.
> 
That sounds good.  I see now that it can be made backwards compatible - BUT
I think we need to keep the signature static, so the new 'type' kwarg should
be at the end, and the 'cutoff' should not change to 'freqs' (in case
someone called with kwargs e.g. firwin(N=101, cutoff=.1)).  Hence new
signature would be:
  s.firwin(N, cutoff, width=None, window='hamming', type='pass')
Does that sound about right?

What aspect of freqz is not working for you?  This is the first time I've
ever run it (in this language :-), seemed to work reasonably well:
w,H1=signal.freqz(h1,worN=2000)
plot(w/numpy.pi, abs(H1))



-- 
View this message in context: http://www.nabble.com/firwin-upgrades-tp23246480p23351898.html
Sent from the Scipy-User mailing list archive at Nabble.com.




More information about the SciPy-User mailing list