| Signal Processing Toolbox | Search  Help Desk |
| ellipord | Examples See Also |
Elliptic filter order selection.
Syntax
[n,Wn] = ellipord(Wp,Ws,Rp,Rs) [n,Wn] = ellipord(Wp,Ws,Rp,Rs,'s')
Description
ellipord selects the minimum order digital or analog elliptic filter required to meet a set of lowpass filter design specifications:Digital Domain
[n,Wn] = ellipord(Wp,Ws,Rp,Rs)
returns the order n of the lowest order elliptic filter that loses no more than Rp dB in the passband and has at least Rs dB of attenuation in the stopband. The passband runs from 0 to Wp and the stopband extends from Ws to 1, the Nyquist frequency. ellipord also returns Wn, the cutoff frequency that allows ellip to achieve the given specifications.
Use ellipord for lowpass, highpass, bandpass, and bandstop filters. For highpass filters, Wp is greater than Ws. For bandpass and bandstop filters, Wp and Ws are two-element vectors that specify the corner frequencies at both edges of the filter, lower frequency edge first. For the band filters, ellipord returns Wn as a two-element row vector for input to ellip.
If filter specifications call for a bandpass or bandstop filter with unequal ripple in each of the passbands or stopbands, design the filter as separate lowpass and highpass sections and cascade the two filters together.
Analog Domain
[n,Wn] = ellipord(Wp,Ws,Rp,Rs,'s')
finds the minimum order n and cutoff frequencies Wn for an analog filter. In this case the frequencies in Wp and Ws are in radians per second and may be greater than 1.
Use ellipord for lowpass, highpass, bandpass, and bandstop filters as described under "Digital Domain."
Examples
For 1000 Hz data, design a lowpass filter with less than 3 dB of attenuation from 0 to 100 Hz and at least 15 dB of attenuation from 150 Hz to the Nyquist frequency:Wp = 100/500; Ws = 150/500;
Rp = 3; Rs = 15;
[n,Wn] = ellipord(Wp,Ws,Rp,Rs)
n =
2
Wn =
0.2000
[b,a] = ellip(n,Rp,Rs,Wn);
freqz(b,a,512,1000);
title('n=2 Elliptic Lowpass Filter')
Now design a bandpass filter with a passband from 90 Hz to 200 Hz, less than 3 dB of ripple throughout the passband, and 30 dB stopbands 50 Hz out on both sides of the passband:
Wp = [90 200]/500; Ws = [50 250]/500;
Rp = 3; Rs = 30;
[n,Wn] = ellipord(Wp,Ws,Rp,Rs)
n =
3
Wn =
0.1800 0.4000
[b,a] = ellip(n,Rp,Rs,Wn);
freqz(b,a,512,1000);
title('n=3 Elliptic Bandpass Filter')
Algorithm
ellipord uses the elliptic lowpass filter order prediction formula described in [1]. The function performs its calculations in the analog domain for both the analog and digital cases. For the digital case, it converts the frequency parameters to the s-domain before the order and natural frequency estimation process, then converts them back to the z-domain.
ellipord initially develops a lowpass filter prototype by transforming the passband frequencies of the desired filter to 1 rad/sec (for low- and highpass filters) and to -1 and 1 rad/sec (for bandpass and bandstop filters). It then computes the minimum order required for a lowpass filter to meet the stopband specification.
See Also
buttord |
Butterworth filter order selection. |
cheb1ord |
Chebyshev type I filter order selection. |
cheb2ord |
Chebyshev type II filter order selection. |
ellip |
Elliptic (Cauer) filter design. |
References
[1] Rabiner, L.R., and B. Gold. Theory and Application of Digital Signal Processing. Englewood Cliffs, NJ: Prentice-Hall, 1975. Pg. 241.