scipy.signal.invres¶

scipy.signal.
invres
(r, p, k, tol=0.001, rtype='avg')[source]¶ Compute b(s) and a(s) from partial fraction expansion.
If M is the degree of numerator b and N the degree of denominator a:
b(s) b[0] s**(M) + b[1] s**(M1) + ... + b[M] H(s) =  =  a(s) a[0] s**(N) + a[1] s**(N1) + ... + a[N]
then the partialfraction expansion H(s) is defined as:
r[0] r[1] r[1] =  +  + ... +  + k(s) (sp[0]) (sp[1]) (sp[1])
If there are any repeated roots (closer together than tol), then H(s) has terms like:
r[i] r[i+1] r[i+n1]  +  + ... +  (sp[i]) (sp[i])**2 (sp[i])**n
This function is used for polynomials in positive powers of s or z, such as analog filters or digital filters in controls engineering. For negative powers of z (typical for digital filters in DSP), use
invresz
.Parameters: r : array_like
Residues.
p : array_like
Poles.
k : array_like
Coefficients of the direct polynomial term.
tol : float, optional
The tolerance for two roots to be considered equal. Default is 1e3.
rtype : {‘max’, ‘min, ‘avg’}, optional
How to determine the returned root if multiple roots are within tol of each other.
 ‘max’: pick the maximum of those roots.
 ‘min’: pick the minimum of those roots.
 ‘avg’: take the average of those roots.
Returns: b : ndarray
Numerator polynomial coefficients.
a : ndarray
Denominator polynomial coefficients.
See also