Expand description
Partial fractions of rational transfer functions and related polynomial tools, ported from
scipy.signal: residue/invres (positive powers of s or z), residuez/invresz
(negative powers of z), unique_roots, deconvolve, and the zero-pole-gain conversions
tf2zpk/zpk2tf.
See the book entry Partial fractions, zoom FFT and waveforms.
Structs§
- Partial
Fractions - The partial-fraction expansion: residues
r, polesp(repeated poles adjacent, ordered by magnitude) and the direct polynomial termk(highest power first forresidue, increasing powers ofz⁻¹forresiduez).
Enums§
- Root
Type - How
unique_rootsrepresents a group of nearly equal roots.
Functions§
- deconvolve
- Inverse filtering (SciPy’s
deconvolve): the quotientqand remainderrwithsignal = divisor ∗ q + r,qbeing the impulse response ofsignal(z)/divisor(z)forlen(signal) − len(divisor) + 1samples. It is polynomial division, so it is unstable when the divisor has zeros outside the unit circle. - invres
b(s)anda(s)from a partial-fraction expansion (SciPy’sinvres); repeated poles must be adjacent. Complex results whose imaginary parts cancel to rounding are returned as real parts together with the largest imaginary part dropped.- invresz
b(z)anda(z)in negative powers ofzfrom a partial-fraction expansion (SciPy’sinvresz).- residue
- The partial-fraction expansion of
b(s)/a(s)in positive powers (SciPy’sresidue):Σ rᵢ/(s − pᵢ) + k(s), with termsr/(s − p)^jfor poles repeated withintol. - residuez
- The partial-fraction expansion of
b(z)/a(z)in negative powers ofz(SciPy’sresiduez):Σ rᵢ/(1 − pᵢz⁻¹) + k₀ + k₁z⁻¹ + …. - roots
- The roots of a polynomial, highest power first (NumPy’s
roots): leading zeros are dropped, trailing zeros give roots at 0, and the rest are the eigenvalues of the companion matrix. Complex-conjugate pairs are listed with the positive imaginary part first, as LAPACK does. - tf2zpk
- Zeros, poles and gain of
b(s)/a(s)(SciPy’stf2zpk): both are normalised by the leading denominator coefficient, the gain is the leading numerator coefficient, and the zeros and poles are the roots of the normalised polynomials. - unique_
roots - Groups nearly equal roots (SciPy’s
unique_roots): going throughpin order, each root not yet used takes every unused root within distancetolof it into its group; the group is represented by its mean, minimum or maximum. Returns the representatives and multiplicities. - zpk2tf
b(s)anda(s)from zeros, poles and gain (SciPy’szpk2tf), real when the zeros and poles come in conjugate pairs.