# ss2zp

Convert state-space filter parameters to zero-pole-gain form

## Syntax

[z,p,k] = ss2zp(A,B,C,D,i)

## Description

ss2zp converts a state-space representation of a given system to an equivalent zero-pole-gain representation. The zeros, poles, and gains of state-space systems represent the transfer function in factored form.

[z,p,k] = ss2zp(A,B,C,D,i) calculates the transfer function in factored form

$H\left(s\right)-\frac{Z\left(s\right)}{P\left(s\right)}-k\frac{\left(s-{z}_{1}\right)\left(s-{z}_{2}\right)\cdots \left(s-{z}_{n}\right)}{\left(s-{p}_{1}\right)\left(s-{p}_{2}\right)\cdots \left(s-{p}_{n}\right)}$

of the continuous-time system

$\begin{array}{l}\stackrel{˙}{x}=Ax+Bu\\ y=Cx+Du\end{array}$

from the ith input (using the ith columns of B and D). The column vector p contains the pole locations of the denominator coefficients of the transfer function. The matrix z contains the numerator zeros in its columns, with as many columns as there are outputs y (rows in C). The column vector k contains the gains for each numerator transfer function.

ss2zp also works for discrete time systems. The input state-space system must be real.

The ss2zp function is part of the standard MATLAB® language.

## Examples

collapse all

### Zeros, Poles, and Gain of a Discrete-Time System

Consider a discrete-time system defined by the transfer function

Determine its zeros, poles, and gain directly from the transfer function. Pad the numerator with zeros so it has the same length as the denominator.

b = [2 3 0]; a = [1 0.4 1]; [z,p,k] = tf2zp(b,a) 
z = 0 -1.5000 p = -0.2000 + 0.9798i -0.2000 - 0.9798i k = 2 

Express the system in state-space form and determine the zeros, poles, and gain using ss2zp.

[A,B,C,D] = tf2ss(b,a); [z,p,k] = ss2zp(A,B,C,D,1) 
z = 0 -1.5000 p = -0.2000 + 0.9798i -0.2000 - 0.9798i k = 2 

collapse all

### Algorithms

ss2zp finds the poles from the eigenvalues of the A array. The zeros are the finite solutions to a generalized eigenvalue problem:

z = eig([A B;C D], diag([ones(1,n) 0]); 

In many situations this algorithm produces spurious large, but finite, zeros. ss2zp interprets these large zeros as infinite.

ss2zp finds the gains by solving for the first nonzero Markov parameters.

## References

[1] Laub, A. J., and B. C. Moore. "Calculation of Transmission Zeros Using QZ Techniques." Automatica. Vol. 14, 1978, p. 557.