[SciPy-Dev] scipy.signal.butter returns complex coefficients

Pierre Haessig pierre.haessig at crans.org
Thu Feb 21 12:03:39 EST 2013


Hi Chuck,

Le 21/02/2013 17:53, Charles R Harris a écrit :
>
>     Now, it may be possible to write signal.buttap in a bit more
>     complex fashion to generate true complex conjugate roots but I'm
>     not sure it's a good to rely on np.poly to make some "smart
>     conjugate detection". In the new polynomial package I'm not sure
>     this is even implemented (
>     https://github.com/numpy/numpy/blob/master/numpy/polynomial/polynomial.py#L127).
>     From my unexerced eye, the code of
>     numpy.polynomial.polynomial.polyfromroots and numpy.poly looks
>     very different
>
>
> The multiplications in numpy/polynomial/polynomial are done as a sort
> of binary tree, multiplying successively higher degree polynomials
> together while trying to keep the roots in each widely separated so as
> to minimize numerical error, but it make no attempt to detect
> conjugate roots. It probably needs an `asreal` attribute so the user,
> who knows more about the problem than the computer, can specify the
> type of the result.
I fully agree with this "explicit better than implicit" approach.
(and thanks for the explanation of the iterative construction of the
polynomial)

Do you think `asreal` it would be a useful addition to polyfromroots or
is it better to just call np.real in signal.iirfilter ?

best,
Pierre
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20130221/59a2874e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 900 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20130221/59a2874e/attachment.sig>


More information about the SciPy-Dev mailing list