# ZP2CAS

## Purpose:

Converts zeros, poles and gain to cascade form filter coefficients.

## Syntax:

ZP2CAS(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

## Example:

z = {0.0, 2.0};

p = {0.5, 0.2};

k = 1.0;

c = zp2cas(z, p, k);

c == {1, 1, -2, 0, -0.7, 0.1};

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

ZP2CAS converts the zeros, poles and gain of a discrete system to cascade coefficient 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 cascade filter coefficients are returned as a single column series with the coefficients in the following order:

{G, b10, b11, b12, a11, a12, b20, b21, b22, a21, a22, ... , bN0, bN1, bN2, aN1, aN2}

CAS2ZP also works for analog cascade coefficients. In this case, the cascade 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 CAS2ZP to convert cascade coefficients to zeros, poles and gain terms.

CAS2SOS

CAS2TF

CAS2ZP

RESIDUEZ

TF2CAS

TF2ZP

TF2ZPK

ZFREQ

ZP2SOS