[Scipy-tickets] [SciPy] #651: Bug fixed for scipy.signal.tf2zpk

SciPy scipy-tickets@scipy....
Sun Apr 20 05:35:43 CDT 2008


#651: Bug fixed for scipy.signal.tf2zpk
----------------------------+-----------------------------------------------
 Reporter:  bow_der_kleine  |       Owner:  somebody
     Type:  enhancement     |      Status:  new     
 Priority:  normal          |   Milestone:  0.7     
Component:  Other           |     Version:          
 Severity:  normal          |    Keywords:          
----------------------------+-----------------------------------------------
 Function scipy.signal.tf2zpk in file ./signal/filter_design.py has a bug.
 If the length of input coefficients is too long, then the outputs zeros
 and poles are wrong. The reason for this bug is function normalize(). I
 eliminated this line of code and function scipy.signal.tf2zpk works pretty
 good. Following is my bug fixed.


 {{{
 def tf2zpk(b,a):
     """Return zero, pole, gain (z,p,k) representation from a numerator,
     denominator representation of a linear filter.
     """
     # b,a = normalize(b,a)
     b = (b+0.0) / a[0]
     a = (a+0.0) / a[0]
     k = b[0]
     b /= b[0]
     z = roots(b)
     p = roots(a)
     return z, p, k
 }}}

-- 
Ticket URL: <http://scipy.org/scipy/scipy/ticket/651>
SciPy <http://www.scipy.org/>
SciPy is open-source software for mathematics, science, and engineering.


More information about the Scipy-tickets mailing list