Compute the s-plane frequency response of an ARMA model (IIR filter).
# S3 method for default
freqs(filt = 1, a = 1, W, ...)# S3 method for Arma
freqs(filt, ...)
# S3 method for Ma
freqs(filt, ...)
# S3 method for freqs
print(x, ...)
# S3 method for freqs
plot(x, ...)
# S3 method for default
freqs_plot(w, h, ...)
# S3 method for freqs
freqs_plot(w, ...)
For freqs
list of class freqs
with items:
array of frequencies.
complex array of frequency responses at those frequencies.
for the default case, the moving-average coefficients of
an ARMA model or filter. Generically, filt
specifies an arbitrary model or filter operation.
the autoregressive (recursive) coefficients of an ARMA filter.
the frequencies at which to evaluate the model.
for the default case, the array of frequencies. Generically, w
specifies an object from which to plot a frequency response.
a complex array of frequency responses at the given frequencies.
object to be plotted.
additional arguments passed through to plot
.
Original Octave version by Julius O. Smith III. Conversion to R by Tom Short.
When results of freqs
are printed, freqs_plot
will be
called to display frequency plots of magnitude and phase. As with
lattice
plots, automatic printing does not work inside loops and
function calls, so explicit calls to print
are
needed there.
filter
, Arma
, freqz
b <- c(1, 2)
a <- c(1, 1)
w <- seq(0, 4, length=128)
freqs(b, a, w)
Run the code above in your browser using DataLab