ZP2SOS

Purpose:

Converts zeros, poles and gain to second order section form.

Syntax:

ZP2SOS(z, p, k, "flag")

(sos, g) = ZP2SOS(z, p, k, "flag")

z

-

A series, the zeros.

p

-

A series, the poles.

k

-

Optional. A scalar, the gain. Defaults to 1.0.

"flag"

-

Optional. A string, the stage ordering flag:

"up"      

:

order stages such that the poles of each stage are closer to the unit circle than the previous stage (default)

"down"  

:

order stages such that the poles of each stage are closer to zero than the previous stage

 

Returns:

An Nx6 array, the system coefficients in second order section form.

 

(sos, g) = ZP2SOS(z, p, k, "flag") returns the SOS coefficients and gain in two separate variables.

Example:

z = {0.0, 2.0};

p = {0.5, 0.2};

k = 1.0;

sos = zp2cas(z, p, k);

 

sos == {{1, -2, 0, 1, -0.7, 0.1}}

 

The 2nd order cascade filter coefficients represent the following Z transform:

 

Remarks:

ZP2SOS converts the zeros, poles and gain of a discrete system to second order section form where the 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, a11, a12},

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

                         ...

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

 

Each row of the SOS coefficients represents a second order stage.

 

If the gain is not returned as a separate variable, the gain is embedded into the first stage.

 

ZP2SOS also works for analog cascade coefficients. In this case, the SOS system function becomes:

 

 

or equivalently:

 

 

To yield real coefficients, the zeros and poles must occur in complex conjugate pairs or be real.

 

The stages are ordered such that the poles of each stage are closer to the unit circle than the previous stage. The zeros of each stage are chosen to be closest to the poles of the same stage.

 

If "flag" == "down", the stages are reversed.

 

See SOS2ZP to convert cascade coefficients to zeros, poles and gain terms.

See Also:

CAS2SOS

CAS2TF

CAS2ZP

CASCADE

DADiSP/Filters

RESIDUEZ

SOS2CAS

SOS2TF

SOS2ZP

TF2CAS

TF2SOS

TF2ZP

TF2ZPK

ZP2CAS

ZP2TF

ZFREQ