# zpk2tf() Function & Examples

Use the zpk2tf() signal function in Calcul.io. Review its syntax, edit working examples, understand the result, and explore related math functions.

## zpk2tf

#### zpk2tf(z, p, k)

Try it yourself:

```calculio
zpk2tf([1, 2], [-1, -2], 1)
zpk2tf([1, 2], [-1, -2])
zpk2tf([1 - 3i, 2 + 2i], [-1, -2])
```

---

## 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](https://calcul.io/function/polynomialRoot/index.md) when solving a polynomial in the opposite direction, and [multiply](https://calcul.io/function/multiply/index.md) when manually composing small polynomial factors.

## Workflow example

After obtaining transfer-function coefficients, use [freqz](https://calcul.io/function/freqz/index.md) 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](https://calcul.io/function/abs/index.md) and [arg](https://calcul.io/function/arg/index.md) 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](https://calcul.io/function/size/index.md) to confirm the resulting coefficient-array lengths.

[All functions](https://calcul.io/functions/index.md)
