# [Scipy-svn] r4918 - trunk/scipy/signal

scipy-svn@scip... scipy-svn@scip...
Sun Nov 2 05:32:56 CST 2008

```Author: stefan
Date: 2008-11-02 05:32:47 -0600 (Sun, 02 Nov 2008)
New Revision: 4918

Modified:
trunk/scipy/signal/signaltools.py
Log:
Update docs.  Fix scaling of residue.

Modified: trunk/scipy/signal/signaltools.py
===================================================================
--- trunk/scipy/signal/signaltools.py	2008-11-02 11:32:19 UTC (rev 4917)
+++ trunk/scipy/signal/signaltools.py	2008-11-02 11:32:47 UTC (rev 4918)
@@ -1058,7 +1058,10 @@
-------- + ----------- + ... + -----------
(s-p[i])  (s-p[i])**2          (s-p[i])**n

+    --------
+    residue, poly, polyval, unique_roots
+
"""
extra = k
p, indx = cmplx_sort(p)
@@ -1108,10 +1111,23 @@
-------- + ----------- + ... + -----------
(s-p[i])  (s-p[i])**2          (s-p[i])**n

+    Returns
+    -------
+    r : ndarray
+        Residues
+    p : ndarray
+        Poles
+    k : ndarray
+        Coefficients of the direct polynomial term.
+
+    --------
+    invres, poly, polyval, unique_roots
+
"""

b,a = map(asarray,(b,a))
+    rscale = a[0]
k,b = polydiv(b,a)
p = roots(a)
r = p*0.0
@@ -1142,7 +1158,7 @@
r[indx+m-1] = polyval(bn,pout[n]) / polyval(an,pout[n]) \
/ factorial(sig-m)
indx += sig
-    return r, p, k
+    return r/rscale, p, k

def residuez(b,a,tol=1e-3,rtype='avg'):
"""Compute partial-fraction expansion of b(z) / a(z).

```