# NOT RUN {
fs <- 10000
spec <- ellipord(1000/(fs/2), 1200/(fs/2), 0.5, 29)
ef <- ellip(spec)
hf <- freqz(ef, fs = fs)
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(-35,0), xlim = c(0,2000))
lines(c(5000, 1200, 1200, 5000, 5000), c(-1000, -1000, -29, -29, -1000),
col = "red")
lines(hf$w, 20*log10(abs(hf$h)))
# }
Run the code above in your browser using DataLab