d roots(a);
to obtain the roots of the denominator vector a in the output vector d. From the com-
puted roots, the coefficients of each section can be determined by pole±zero pairings.
A much simpler approach is to use the function tf2zp in the Signal Processing
Toolbox, which finds the zeros, poles, and gains of systems in transfer functions of
single-input or multiple-output form. For example, the statement
[z, p, c] tf2zp(b, a);
will return the zero locations in the columns of matrix z, the pole locations in the
column vector p, and the gains for each numerator transfer function in vector c.
Vector a specifies the coefficients of the denominator in descending powers of z
À1
,
and the matrix b indicates the numerator coefficients with as many rows as there are
outputs.
Example 6.11: The zeros, poles, and gain of the system
Hz
2z
À1
3z
À2
1 0:4z
À1
z
À2
can be obtained using the MATLAB script as follows:
b [2, 3];
a [1, 0.4, 1];
[z, p, c] tf2zp(b,a);
MATLAB also provides a useful function zp2sos in the Signal Processing Toolbox
to convert a zero-pole-gain representation of a given system to an equivalent represen-
tation of second-order sections. The function
[sos, G] zp2sos(z, p, c);
finds the overall gain G and a matrix sos containing the coefficients of each second-
order section of the equivalent transfer function H(z) determined from its zero±pole
form. The zeros and poles must be real or in complex-conjugate pairs. The matrix sos is
a K Â 6 matrix
sos
b
01
b
11
b
21
a
01
a
11
a
21
b
02
b
12
b
22
a
02
a
12
a
22
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
b
0K
b
1K
b
2K
a
0K
a
1K
a
2K
P
T
T
T
R
Q
U
U
U
S
,
6:4:19
whose rows contain the numerator and denominator coefficients, b
ik
and a
ik
, i 0, 1, 2
of the kth second-order section H
k
z. The overall transfer function is expressed as
Hz
K
k1
H
k
z
K
k1
b
0k
b
1k
z
À1
b
2k
z
À2
a
0k
a
1k
z
À1
a
2k
z
À2
:
6:4:20
270
DESIGN AND IMPLEMENTATION OF IIR FILTERS