Convert digital filter second-order section data to transfer function form

`[b,a] = sos2tf(sos)`

[b,a] = sos2tf(sos,g)

`sos2tf`

converts a second-order section representation
of a given digital filter to an equivalent transfer function representation.

`[b,a] = sos2tf(sos)`

returns
the numerator coefficients `b`

and denominator coefficients `a`

of
the transfer function that describes a discrete-time system given
by `sos`

in second-order section form. The second-order
section format of *H*(*z*) is given
by

$$H(z)={\displaystyle \prod _{k=1}^{L}{H}_{k}(z)={\displaystyle \prod _{k=1}^{L}\frac{{b}_{0k}+{b}_{1k}{z}^{-1}+{b}_{2k}{z}^{-2}}{1+{a}_{1k}{z}^{-1}+{a}_{2k}{z}^{-2}}.}}$$

`sos`

is an *L*-by-6 matrix
that contains the coefficients of each second-order section stored
in its rows.

$$\text{sos}=\left[\begin{array}{cccccc}{b}_{01}& {b}_{11}& {b}_{21}& 1& {a}_{11}& {a}_{21}\\ {b}_{02}& {b}_{12}& {b}_{22}& 1& {a}_{12}& {a}_{22}\\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ {b}_{0L}& {b}_{1L}& {b}_{2L}& 1& {a}_{1L}& {a}_{2L}\end{array}\right].$$

Row vectors `b`

and `a`

contain
the numerator and denominator coefficients of *H*(*z*)
stored in descending powers of *z*.

$$H(z)=\frac{B(z)}{A(z)}=\frac{{b}_{1}+{b}_{2}{z}^{-1}+\cdots +{b}_{n+1}{z}^{-n}}{{a}_{1}+{a}_{2}{z}^{-1}+\cdots +{a}_{m+1}{z}^{-m}}$$

`[b,a] = sos2tf(sos,g)`

returns the transfer
function that describes a discrete-time system given by `sos`

in
second-order section form with gain `g`

.

$$H(z)=g{\displaystyle \prod _{k=1}^{L}{H}_{k}}(z).$$

`sos2tf`

uses the `conv`

function to multiply all of the
numerator and denominator second-order polynomials together. For higher order filters
(possibly starting as low as order 8), numerical problems due to round-off errors may
occur when forming the transfer function.