# SOS2TF

## Purpose:

Converts second order section form filter coefficients to transfer function (direct) form.

## Syntax:

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.

## Returns:

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.

## Example:

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.

## Example:

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:

## Example:

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.

## Remarks:

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, bk and ak are the filter coefficients for the kth stage.

The SOS form is an Nx6 array:

{{b10,  b11,  b12,  1.0,  a11,  a12},

{b20,  b21,  b22,  1.0,  a21,  a22},

...

{bN0,  bN1,  bN2,  1.0,  aN1,  aN2}}

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.

CAS2SOS

CAS2ZP

FILTEQ

RESIDUEZ

SOS2CAS

SOS2ZP

TF2CAS

TF2ZP

TF2ZPK

TF2SOS