Function File: [sos, g] = zp2sos (z, p)
Function File: [sos, g] = zp2sos (z, p, g)
Convert filter poles and zeros to second-order sections.
INPUTS:
- z = column-vector containing the filter zeros
- p = column-vector containing the filter poles
- g = 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] andA1.'==[1 a1 a2]for section 1, etc.
b0 must be nonzero for each section.
Seefilter()for documentation of the second-order direct-form filter coefficients Bi and %Ai, i=1:N.- Bscale is an overall gain factor that effectively scales any one of the Bi vectors.
EXAMPLE:
[z,p,g] = tf2zp([1 0 0 0 0 1],[1 0 0 0 0 .9]); [sos,g] = zp2sos(z,p,g) 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 = 1See also: sos2pz sos2tf tf2sos zp2tf tf2zp
Package: signal