[SciPy-User] Bug in freqz returning angular frequency and frequency response in backward order

Warren Weckesser warren.weckesser at enthought.com
Wed Aug 29 08:32:56 EDT 2012


On Wed, Aug 29, 2012 at 6:48 AM, Jeffrey Spencer <jeffspencerd at gmail.com>wrote:

> K, that makes sense. Knew it had to be backwards somewhere.
> On Aug 29, 2012 8:36 PM, "Warren Weckesser" <
> warren.weckesser at enthought.com> wrote:
>
>>
>>
>> On Wed, Aug 29, 2012 at 12:20 AM, Jeffrey Spencer <jeffspencerd at gmail.com
>> > wrote:
>>
>>> The freqz function appears to return the frequency values and the
>>> frequency response backwards. Like it is supposed to return in the order
>>> (h,w) but it actually returns in the order (w,h).
>>>
>>> This can even be seen in the documentation here:
>>>
>>> http://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.freqz.html
>>>
>>>
>>
>> Jeff,
>>
>> freqz and freqs both return (w, h), which is correct.
>>
>> The mistake is in the example in the docstring for freqz.  The line:
>>
>> >>> h, w = signal.freqz(b)
>>
>> should be
>>
>> >>> w, h = signal.freqz(b)
>>
>>

Pull request to fix this and add an example to signal.freqs is here:
https://github.com/scipy/scipy/pull/299

Warren



>
>> Warren
>>
>>
>>
>>>
>>>
>>> _______________________________________________
>>> SciPy-User mailing list
>>> SciPy-User at scipy.org
>>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>>
>>>
>>
>> _______________________________________________
>> SciPy-User mailing list
>> SciPy-User at scipy.org
>> http://mail.scipy.org/mailman/listinfo/scipy-user
>>
>>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20120829/bf34584e/attachment.html>


More information about the SciPy-User mailing list