# zp2tf

Convert zero-pole-gain filter parameters to transfer function form

## Description

example

[b,a] = zp2tf(z,p,k) converts a factored transfer function representation

$H\left(s\right)=\frac{Z\left(s\right)}{P\left(s\right)}=k\frac{\left(s-{z}_{1}\right)\left(s-{z}_{2}\right)\cdots \left(s-{z}_{m}\right)}{\left(s-{p}_{1}\right)\left(s-{p}_{2}\right)\cdots \left(s-{p}_{n}\right)}$

of a single-input/multi-output (SIMO) system to a polynomial transfer function representation

$\frac{B\left(s\right)}{A\left(s\right)}=\frac{{b}_{1}{s}^{\left(n-1\right)}+\cdots +{b}_{\left(n-1\right)}s+{b}_{n}}{{a}_{1}{s}^{\left(m-1\right)}+\cdots +{a}_{\left(m-1\right)}s+{a}_{m}}.$

## Examples

collapse all

Compute the transfer function of a damped mass-spring system that obeys the differential equation

$\underset{}{\overset{¨}{w}}+0.01\underset{}{\overset{˙}{w}}+w=u\left(t\right).$

The measurable quantity is the acceleration, $y=\underset{}{\overset{¨}{w}}$, and $u\left(t\right)$ is the driving force. In Laplace space, the system is represented by

$Y\left(s\right)=\frac{{s}^{2}\phantom{\rule{0.2777777777777778em}{0ex}}U\left(s\right)}{{s}^{2}+0.01s+1}.$

The system has unit gain, a double zero at $s=0$, and two complex-conjugate poles.

k = 1;
z = [0 0]';
p = roots([1 0.01 1])
p = 2×1 complex

-0.0050 + 1.0000i
-0.0050 - 1.0000i

Use zp2tf to find the transfer function.

[b,a] = zp2tf(z,p,k)
b = 1×3

1     0     0

a = 1×3

1.0000    0.0100    1.0000

## Input Arguments

collapse all

Zeros of the system, specified as a column vector or a matrix. z has as many columns as there are outputs. The zeros must be real or come in complex conjugate pairs. Use Inf values as placeholders in z if some columns have fewer zeros than others.

Example: [1 (1+1j)/2 (1-1j)/2]'

Data Types: single | double
Complex Number Support: Yes

Poles of the system, specified as a column vector. The poles must be real or come in complex conjugate pairs.

Example: [1 (1+1j)/2 (1-1j)/2]'

Data Types: single | double
Complex Number Support: Yes

Gains of the system, specified as a column vector.

Example: [1 2 3]'

Data Types: single | double

## Output Arguments

collapse all

Transfer function numerator coefficients, returned as a row vector or a matrix. If b is a matrix, then it has a number of rows equal to the number of columns of z.

Transfer function denominator coefficients, returned as a row vector.

## Algorithms

The system is converted to transfer function form using poly with p and the columns of z.

## Version History

Introduced before R2006a