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

freqs

Frequency response of analog filters


Description

Compute the s-plane frequency response of an IIR filter.

Usage

freqs(filt, ...)

## Default S3 method:
freqs(filt, a, w, plot = TRUE, ...)

## S3 method for class 'Arma'
freqs(filt, w, ...)

## S3 method for class 'Ma'
freqs(filt, w, ...)

## S3 method for class 'Sos'
freqs(filt, w, ...)

## S3 method for class 'Zpg'
freqs(filt, w, ...)

Arguments

filt

for the default case, moving average (MA) polynomial coefficients, specified as a numeric vector or matrix. In case of a matrix, then each row corresponds to an output of the system. The number of columns of b must be less than or equal to the length of a.

...

additional parameters (not used)

a

autoregressive (AR) polynomial coefficients, specified as a vector.

w

angular frequencies, specified as a positive real vector expressed in rad/second.

plot

logical. If TRUE (default), plots the magnitude and phase responses as a function of angular frequency, otherwise a vector of the frequency response is returned.

Details

The s-plane frequency response of the IIR filter B(s) / A(s) is computed as H = polyval(B, 1i * W) / polyval(A, 1i * W). If called with no output argument, a plot of magnitude and phase are displayed.

Value

Frequency response, returned as a complex vector.

Author(s)

Julius O. Smith III, jos@ccrma.stanford.edu.
Conversion to R by Geert van Boxtel gjmvanboxtel@gmail.com

Examples

b <- c(1, 2); a <- c(1, 1)
w <- seq(0, 4, length.out = 128)
freqs (b, a, w)

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.