This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / signal / _filter_design / tf2zpk

function

scipy.signal._filter_design:tf2zpk

source: build-install/usr/lib/python3.14/site-packages/scipy/signal/_filter_design.py:1171

Signature

def tf2zpk(b, a)

Summary

Return zero, pole, gain (z, p, k) representation from a numerator, denominator representation of a linear filter.

Parameters

b : array_like, shape (M,)

Numerator polynomial coefficients. Must be 1-D.

a : array_like, shape (N,)

Denominator polynomial coefficients. Must be 1-D.

Returns

z : ndarray

Zeros of the transfer function.

p : ndarray

Poles of the transfer function.

k : float

System gain.

Notes

If some values of b are too close to 0, they are removed. In that case, a BadCoefficients warning is emitted.

The b and a arrays are interpreted as coefficients for positive, descending powers of the transfer function variable. So the inputs and can represent an analog filter of the form:

or a discrete-time filter of the form:

This "positive powers" form is found more commonly in controls engineering. If M and N are equal (which is true for all filters generated by the bilinear transform), then this happens to be equivalent to the "negative powers" discrete-time form preferred in DSP:

Although this is true for common filters, remember that this is not true in the general case. If M and N are not equal, the discrete-time transfer function coefficients must first be converted to the "positive powers" form before finding the poles and zeros.

Examples

Find the zeroes, poles and gain of a filter with the transfer function .. math:: H(s) = \frac{3s^2}{s^2 + 5s + 13}
from scipy.signal import tf2zpk
✓
tf2zpk([3, 0, 0], [1, 5, 13])
✗
(array([0., 0.]), array([-2.5+2.6j, -2.5-2.6j]), np.float64(3.0))

Aliases

  • scipy.signal.tf2zpk