zp2sos {gsignal} | R Documentation |
Zero-pole-gain to second-order section format
Description
Convert digital filter zero-pole-gain data to second-order section form.
Usage
zp2sos(z, p, g = 1, order = c("down", "up"))
Arguments
z |
complex vector of the zeros of the model (roots of |
p |
complex vector of the poles of the model (roots of |
g |
overall gain ( |
order |
row order, specified as:
The ordering influences round-off noise and the probability of overflow. |
Value
A list with the following list elements:
- sos
Second-order section representation, specified as an nrow-by-6 matrix, whose rows contain the numerator and denominator coefficients of the second-order sections:
sos <- rbind(cbind(B1, A1), cbind(...), cbind(Bn, An))
, whereB1 <- c(b0, b1, b2)
, andA1 <- c(a0, a1, a2)
for section 1, etc. The b0 entry must be nonzero for each section.- g
Overall gain factor that effectively scales the output
b
vector (or any one of the inputBi
vectors).
Author(s)
Julius O. Smith III, jos@ccrma.stanford.edu.
Conversion to R by Geert van Boxtel, gjmvanboxtel@gmail.com
See Also
Examples
zpk <- tf2zp (c(1, 0, 0, 0, 0, 1), c(1, 0, 0, 0, 0, .9))
sosg <- zp2sos (zpk$z, zpk$p, zpk$g)