[SciPy-User] butter() and filtfilt() - differences between MATLAB and scipy

Tristan Strange tristan.strange@gmail....
Fri Jun 28 06:46:54 CDT 2013


On 28 June 2013 12:23, Roger Fearick <roger.fearick@uct.ac.za> wrote:

>  You're using Python 2.7: maybe 2/(256/2) = 0.
>

It's not this I'm afraid. I import division from __future__

>Tristan Strange a écrit :
>> In MATLAB [...] b comes out as a matrix containing :
>>
>> 2.8109e-15   2.5298e-14   1.0119e-13   2.3612e-13   3.5418e-13
3.5418e-13
>> 2.3612e-13   1.0119e-13   2.5298e-14   2.8109e-15
>>
>> When done in Python using scipy.signal's butter like so:
>> [...] the following warning is issued:
>>
>> /usr/lib/python2.7/dist-packages/scipy/signal/filter_design.py:288:
>> BadCoefficients: Badly conditioned filter coefficients (numerator): the
>> results may be meaningless  "results may be meaningless",
BadCoefficients)

> You should maybe worry about getting (in matlab) such values for b. All
> are pretty close to 0. This is what scipy implementation is warning you
> about ("Badly conditioned filter coefficients (numerator): the results
> may be meaningless"). Using this b vector may lead to output signals
> prone to numerical noise...

Ok, thanks. Apparently the MATLAB implementation functions as expected....

Any one else have any ideas?

Cheers,
Tristan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20130628/5f00483a/attachment-0001.html 


More information about the SciPy-User mailing list