[SciPy-User] firwin behavior
Thu Aug 11 06:36:33 CDT 2011
Wow. The passing of the DC frequency is exactly the issue, and that default
behavior is clearly shown in the documentation. I see now that given a band,
the default behavior is band-stop, whereas I would expect it to be
band-pass. So, that fixed it.
What I don't understand, however, is *why* that would be default behavior.
More importantly, even if that is the default behavior, the name of the
pass_zero flag does not readily help a dumb user like me grok the
functionality. Has there been any thought to renaming it?
On Wed, Aug 10, 2011 at 4:39 PM, Warren Weckesser <
> On Wed, Aug 10, 2011 at 8:14 AM, Jeff Alstott <email@example.com>
> > firwin is producing unreasonable filters for me, and I'm not sure if I'm
> > misusing the code or if there is a bug. Like so:
> > In : from scipy.signal import firwin
> > In : ny = 500
> > In : f21f80= firwin(21, [1/ny, 80/ny]); plot(f21f80);
> > savefig('FIR21_filter80.png')
> > Produces the attached file.
> > In contrast, Matlab:
> > Trial>> ny = 500
> > ny =
> > 500
> > Trial>> [f20f80] = fir1(20, [1/ny, 80/ny]); figure; plot(f20f80)
> > Produces the other attached file. Quite different! The filter produced by
> > the scipy function, if used with lfilter (or if taken to Matlab to use as
> > filter), produces a nonsense filtering, with many high frequency
> > Any thoughts? This is in python3, if that matters.
> By default, firwin creates a filter that passes DC (i.e. the zero
> frequency). To get a filter like the one produced by matlab, add the
> keyword argument pass_zero=False.
> > Thanks!
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-User@scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user
> SciPy-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-User