zpk2tf

zpk2tf(z, p, k)

Try it yourself:


Convert zeros, poles, and gain to a transfer function

zpk2tf converts a system represented by its zeros, poles, and gain into transfer-function numerator and denominator coefficients. This representation is common in control theory and digital signal processing because zeros and poles describe system behavior geometrically, while coefficient form is convenient for evaluation and filtering.

What the conversion means

Zeros are roots of the numerator, poles are roots of the denominator, and gain scales the result. Zpk2tf expands those factors into polynomial coefficient arrays. Use polynomialRoot when solving a polynomial in the opposite direction, and multiply when manually composing small polynomial factors.

Workflow example

After obtaining transfer-function coefficients, use freqz to examine a digital filter’s frequency response. Zeros near a frequency can attenuate it, while poles near the unit circle can produce a strong response. Use abs and arg to inspect magnitude and phase.

Important caveats

Coefficient order and normalization conventions matter, especially for complex-conjugate roots and high-order systems. Numerically expanding many roots can be ill-conditioned; retain a zero-pole-gain representation when it is more stable or interpretable. Verify denominator coefficients carefully, since unstable poles can produce unbounded behavior. Use size to confirm the resulting coefficient-array lengths.

All functions