Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

zp2sos

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 B(z))

p

complex vector of the poles of the model (roots of A(z))

g

overall gain (B(Inf)). Default: 1

order

row order, specified as:

"up"

order the sections so the first row contains the poles farthest from the unit circle.

"down" (Default)

order the sections so the first row of sos contains the poles closest to the unit circle.

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)), where B1 <- c(b0, b1, b2), and A1 <- 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 input Bi 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)

gsignal

Signal Processing

v0.3-1
GPL-3
Authors
Geert van Boxtel [aut, cre] (Maintainer), Tom Short [aut] (Author of 'signal' package), Paul Kienzle [aut] (Majority of the original sources), Ben Abbott [ctb], Juan Aguado [ctb], Muthiah Annamalai [ctb], Leonardo Araujo [ctb], William Asquith [ctb], David Bateman [ctb], David Billinghurst [ctb], Juan Pablo Carbajal [ctb], André Carezia [ctb], Vincent Cautaerts [ctb], Eric Chassande-Mottin [ctb], Luca Citi [ctb], Dave Cogdell [ctb], Carlo de Falco [ctb], Carne Draug [ctb], Pascal Dupuis [ctb], John W. Eaton [ctb], R.G.H Eschauzier [ctb], Andrew Fitting [ctb], Alan J. Greenberger [ctb], Mike Gross [ctb], Daniel Gunyan [ctb], Kai Habel [ctb], Kurt Hornik [ctb], Jake Janovetz [ctb], Alexander Klein [ctb], Peter V. Lanspeary [ctb], Bill Lash [ctb], Friedrich Leissh [ctb], Laurent S. Mazet [ctb], Mike Miller [ctb], Petr Mikulik [ctb], Paolo Neis [ctb], Georgios Ouzounis [ctb], Sylvain Pelissier [ctb], Francesco Potortì [ctb], Charles Praplan [ctb], Lukas F. Reichlin [ctb], Tony Richardson [ctb], Asbjorn Sabo [ctb], Thomas Sailer [ctb], Rolf Schirmacher [ctb], Rolf Schirmacher [ctb], Ivan Selesnick [ctb], Julius O. Smith III [ctb], Peter L. Soendergaard [ctb], Quentin Spencer [ctb], Doug Stewart [ctb], P. Sudeepam [ctb], Stefan van der Walt [ctb], Andreas Weber [ctb], P. Sudeepam [ctb], Andreas Weingessel [ctb]
Initial release
2021-05-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.