Signal Toolkit - zp2sos
- Function File:
[sos, g] =
zp2sos(z)
- Function File:
[sos, g] =
zp2sos(z, p)
- Function File:
[sos, g] =
zp2sos(z, p, k)
- Function File:
sos =
zp2sos(…)
Convert filter poles and zeros to second-order sections.
INPUTS:
- z = column-vector containing the filter zeros
- p = column-vector containing the filter poles
- k = overall filter gain factor. If not given the gain is assumed to be 1.
RETURNED:
- sos = matrix of series second-order sections, one per row:
sos = [B1.' A1.'; ...; BN.' AN.']
where
B1.' = [b0 b1 b2] and A1.' = [a0 a1 a2]
for section 1, etc. Seefilter
for documentation of the second-order direct-form filter coefficients Bi and %Ai, i=1:N. - g is the 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:
[z, p, k] = tf2zp ([1 0 0 0 0 1], [1 0 0 0 0 .9]); [sos, g] = zp2sos (z, p, k) sos = 1.0000 0.6180 1.0000 1.0000 0.6051 0.9587 1.0000 -1.6180 1.0000 1.0000 -1.5843 0.9587 1.0000 1.0000 0 1.0000 0.9791 0 g = 1
See also: sos2zp, sos2tf, tf2sos, zp2tf, tf2zp.