Function File: [sos, g] = tf2sos (b, a)
Function File: sos = tf2sos (b, a)

Convert direct-form filter coefficients to series second-order sections.

INPUTS:

b and a are vectors specifying the digital filter H(z) = B(z)/A(z). See filter for documentation of the b and a filter coefficients.

RETURNED:

  • sos = matrix of series second-order sections, one per row:
    sos = [b1.' a1.'; ...; bn.' an.']
    

    where B1.' = [b0 b1 b2] and A1.' = [1 a1 a2] for section 1, etc. The b0 entry must be nonzero for each section (zeros at infinity not supported).

  • g is an overall gain factor that effectively scales any one of the Bi vectors.

If called with only one output argument, the overall filter gain is applied to the first second-order section in the matrix sos.

EXAMPLE:

B = [1 0 0 0 0 1];
A = [1 0 0 0 0 .9];
[sos, g] = tf2sos (B, A)

sos =

   1.00000   0.61803   1.00000   1.00000   0.60515   0.95873
   1.00000  -1.61803   1.00000   1.00000  -1.58430   0.95873
   1.00000   1.00000  -0.00000   1.00000   0.97915  -0.00000

g = 1

See also: sos2tf, zp2sos, sos2pz, zp2tf, tf2zp.

Package: signal