Converts second order section form filter coefficients to transfer function (direct) form.
SOS2TF(sos, g)
(b, a) = SOS2TF(sos, g)
sos |
- |
A Nx6 array where the first 3 columns are the numerator terms and the last 3 columns are the denominator terms. Each row represents a 2nd order stage. |
g |
- |
Optional. A real, the system gain, Defaults to 1.0. |
A two column series, where the first column contains the direct form numerator coefficients and the second column contains the direct form denominator coefficients.
(b, a) = SOS2TF(sos, g) returns the direct form numerator and denominator coefficients as two separate series.
sos = {{1, 0, 0, 1, -0.5, 0.2}};
d = sos2tf(c);
d == {{1, 1},
{0, -0.5},
{0, 0.2}}
The 2nd order section filter coefficients represent the following Z transform:
The resulting direct form filter coefficients represent the equivalent Z transform:
Since the original coefficients represent a single 2nd order system, the direct form coefficients are identical.
sos = {{1, 0, 0, 1, -0.754856, 0.392379},
{1, 0, 0, 1, 0.254856, 0}};
d = sos2tf(sos);
d == {{1, 1},
{0, -0.5},
{0, 0.2},
{0, 0.1}}
The SOS coefficients represent the equivalent Z transform:
The resulting direct form filter coefficients represent the following Z transform:
sos = {{1, 0, 0, 1, -0.754856, 0.392379},
{1, 0, 0, 1, 0.254856, 0}};
(b, a) = sos2tf(sos);
b == {1, 0, 0, 0}
a == {1, -0.5, 0.2, 0.1}
Same as the previous example except the direct form coefficients are returned as two separate series.
SOS2TF converts second order section form filter coefficients to direct form. The SOS coefficients represent the following Z transform:
or:
where G is the system gain, b_{k} and a_{k} are the filter coefficients for the k^{th} stage.
The SOS form is an Nx6 array:
{{b_{10}, b_{11}, b_{12}, 1.0, a_{11}, a_{12}},
_{ }{b_{20}, b_{21}, b_{22}, 1.0, a_{21}, a_{22}},
...
{b_{N0}, b_{N1}, b_{N2}, 1.0, a_{N1}, a_{N2}}}
Each row of the SOS coefficients represents a second order stage.
The equivalent direct form coefficients represent the following Z transform:
z^{ } |
=^{ } |
e^{ jω} complex frequency |
N |
= |
number of numerator terms |
M |
= |
number of denominator terms |
The direct form of the filter coefficients can be processed by the FILTEQ function. However, filtering with direct form coefficients can be more prone to numerical roundoff errors compared to the same filtering operation in SOS or CASCADE form.
See TF2SOS to convert direct form coefficients to SOS form.