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

ellip

Elliptic filter design


Description

Compute the transfer function coefficients of an elliptic filter.

Usage

ellip(n, ...)

## S3 method for class 'FilterSpecs'
ellip(n, Rp = n$Rp, Rs = n$Rs, w = n$Wc, type = n$type, plane = n$plane, ...)

## Default S3 method:
ellip(
  n,
  Rp,
  Rs,
  w,
  type = c("low", "high", "stop", "pass"),
  plane = c("z", "s"),
  output = c("Arma", "Zpg", "Sos"),
  ...
)

Arguments

n

filter order.

...

additional arguments passed to ellip, overriding those given by n of class FilterSpecs.

Rp

dB of passband ripple.

Rs

dB of stopband ripple.

w

critical frequencies of the filter. w must be a scalar for low-pass and high-pass filters, and w must be a two-element vector c(low, high) specifying the lower and upper bands in radians/second. For digital filters, w must be between 0 and 1 where 1 is the Nyquist frequency.

type

filter type, one of "low", "high", "stop", or "pass".

plane

"z" for a digital filter or "s" for an analog filter.

output

Type of output, one of:

"Arma"

Autoregressive-Moving average (aka numerator/denominator, aka b/a)

"Zpg"

Zero-pole-gain format

"Sos"

Second-order sections

Default is "Arma" for compatibility with the 'signal' package and the 'Matlab' and 'Octave' equivalents, but "Sos" should be preferred for general-purpose filtering because of numeric stability.

Details

An elliptic filter is a filter with equalized ripple (equiripple) behavior in both the passband and the stopband. The amount of ripple in each band is independently adjustable, and no other filter of equal order can have a faster transition in gain between the passband and the stopband, for the given values of ripple.

As the ripple in the stopband approaches zero, the filter becomes a type I Chebyshev filter. As the ripple in the passband approaches zero, the filter becomes a type II Chebyshev filter and finally, as both ripple values approach zero, the filter becomes a Butterworth filter.

Because ellip is generic, it can be extended to accept other inputs, using ellipord to generate filter criteria for example.

Value

Depending on the value of the output parameter, a list of class Arma, Zpg, or Sos containing the filter coefficients

Author(s)

Paulo Neis, p_neis@yahoo.com.br,
adapted by Doug Stewart, dastew@sympatico.ca.
Conversion to R Tom Short,
adapted by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.

References

See Also

Examples

## compare the frequency responses of 5th-order Butterworth
## and elliptic filters.
bf <- butter(5, 0.1)
ef <- ellip(5, 3, 40, 0.1)
bfr <- freqz(bf)
efr <- freqz(ef)
plot(bfr$w, 20 * log10(abs(bfr$h)), type = "l", ylim = c(-80, 0),
     xlab = "Frequency (Rad)", ylab = c("dB"), lwd = 2,
     main = paste("Elliptic versus Butterworth filter",
     "low-pass -3 dB cutoff at 0.1 rad", sep = "\n"))
lines(efr$w, 20 * log10(abs(efr$h)), col = "red", lwd = 2)
legend ("topright", legend = c("Butterworh", "Elliptic"),
        lty = 1, lwd = 2, col = 1:2)

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.