cheb1ord {signal} | R Documentation |
Chebyshev type-I filter order and cutoff
Description
Compute discrete Chebyshev type-I filter order and cutoff for the desired response characteristics.
Usage
cheb1ord(Wp, Ws, Rp, Rs)
Arguments
Wp , Ws |
pass-band and stop-band edges. For a low-pass or
high-pass filter, |
Rp |
allowable decibels of ripple in the pass band. |
Rs |
minimum attenuation in the stop band in dB. |
Value
An object of class FilterOfOrder
with the following list elements:
n |
filter order |
Wc |
cutoff frequency |
Rp |
allowable decibels of ripple in the pass band |
type |
filter type, one of “low”, “high”, “stop”, or “pass” |
This object can be passed directly to cheby1
to compute filter coefficients.
Author(s)
Original Octave version by Paul Kienzle, pkienzle@user.sf.net and by Laurent S. Mazet. Conversion to R by Tom Short.
References
Octave Forge https://octave.sourceforge.io/
See Also
cheby1
, FilterOfOrder
, buttord
Examples
Fs <- 10000
chord <- cheb1ord(1000/(Fs/2), 1200/(Fs/2), 0.5, 29)
plot(c(0, 1000, 1000, 0, 0), c(0, 0, -0.5, -0.5, 0),
type = "l", xlab = "Frequency (Hz)", ylab = "Attenuation (dB)")
ch1 <- cheby1(chord)
plot(c(0, 1000, 1000, 0, 0), c(0, 0, -0.5, -0.5, 0),
type = "l", xlab = "Frequency (Hz)", ylab = "Attenuation (dB)",
col = "red", ylim = c(-10,0), xlim = c(0,2000))
hf <- freqz(ch1, Fs = Fs)
lines(hf$f, 20*log10(abs(hf$h)))