Function File: n = ellipord (wp, ws, rp, rs)
Function File: n = ellipord ([wp1, wp2], [ws1, ws2], rp, rs)
Function File: n = ellipord ([wp1, wp2], [ws1, ws2], rp, rs, "s")
Function File: [n, wc] = ellipord (…)

Compute the minimum filter order of an elliptic filter with the desired response characteristics. The filter frequency band edges are specified by the passband frequency wp and stopband frequency ws. Frequencies are normalized to the Nyquist frequency in the range [0,1]. rp is the allowable passband ripple measured in decibels, and rs is the minimum attenuation in the stop band, also in decibels. The output arguments n and wc can be given as inputs to ellip.

If wp and ws are scalars, then wp is the passband cutoff frequency and ws is the stopband edge frequency. If ws is greater than wp, the filter is a low-pass filter. If wp is greater than ws, the filter is a high-pass filter.

If wp and ws are vectors of length 2, then wp defines the passband interval and ws defines the stopband interval. If wp is contained within ws (ws1 < wp1 < wp2 < ws2), the filter is a band-pass filter. If ws is contained within wp (wp1 < ws1 < ws2 < wp2), the filter is a band-stop or band-reject filter.

If the optional argument "s" is given, the minimum order for an analog elliptic filter is computed. All frequencies wp and ws are specified in radians per second.

Reference: Lamar, Marcus Vinicius, Notas de aula da disciplina TE 456 - Circuitos Analogicos II, UFPR, 2001/2002.

See also: buttord, cheb1ord, cheb2ord, ellip.

Demonstration 1

The following code

 fs    = 44100;
 Npts  = fs;
 fpass = 4000;
 fstop = 13713;
 Rpass = 3;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn);
 f = 0:fs/2;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)));
 outline_lp_pass_x = [f(2)  , fpass(1), fpass(1)];
 outline_lp_pass_y = [-Rpass, -Rpass  , -80];
 outline_lp_stop_x = [f(2)  , fstop(1), fstop(1), max(f)];
 outline_lp_stop_y = [0     , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_lp_pass_x, outline_lp_pass_y, "m", outline_lp_stop_x, outline_lp_stop_y, "m");
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("2nd order digital elliptical low-pass (without margin)");

Produces the following output

n = 2
Wn = 0.1814

and the following figure

Figure 1

Demonstration 2

The following code

 fs    = 44100;
 Npts  = fs;
 fpass = 4000;
 fstop = 13712;
 Rpass = 3;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn);
 f = 0:fs/2;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)));
 outline_lp_pass_x = [f(2)  , fpass(1), fpass(1)];
 outline_lp_pass_y = [-Rpass, -Rpass  , -80];
 outline_lp_stop_x = [f(2)  , fstop(1), fstop(1), max(f)];
 outline_lp_stop_y = [0     , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_lp_pass_x, outline_lp_pass_y, "m", outline_lp_stop_x, outline_lp_stop_y, "m");
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("3rd order digital elliptical low-pass (just exceeds 2nd order i.e. large margin)");

Produces the following output

n = 3
Wn = 0.1814

and the following figure

Figure 1

Demonstration 3

The following code

 fs    = 44100;
 Npts  = fs;
 fstop = 4000;
 fpass = 13713;
 Rpass = 3;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn, "high");
 f = 0:fs/2;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)));
 outline_hp_pass_x = [fpass(1), fpass(1), max(f)];
 outline_hp_pass_y = [-80     , -Rpass  , -Rpass];
 outline_hp_stop_x = [min(f)  , fstop(1), fstop(1), max(f)];
 outline_hp_stop_y = [-Rstop  , -Rstop  , 0       , 0     ];
 hold on
 plot (outline_hp_pass_x, outline_hp_pass_y, "m", outline_hp_stop_x, outline_hp_stop_y, "m");
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("2nd order digital elliptical high-pass (without margin)");

Produces the following output

n = 2
Wn = 0.6219

and the following figure

Figure 1

Demonstration 4

The following code

 fs    = 44100;
 Npts  = fs;
 fstop = 4000;
 fpass = 13712;
 Rpass = 3;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn, "high");
 f = 0:fs/2;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)));
 outline_hp_pass_x = [fpass(1), fpass(1), max(f)];
 outline_hp_pass_y = [-80     , -Rpass  , -Rpass];
 outline_hp_stop_x = [min(f)  , fstop(1), fstop(1), max(f)];
 outline_hp_stop_y = [-Rstop  , -Rstop  , 0       , 0     ];
 hold on
 plot (outline_hp_pass_x, outline_hp_pass_y, "m", outline_hp_stop_x, outline_hp_stop_y, "m");
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("3rd order digital elliptical high-pass (just exceeds 2nd order i.e. large margin)");

Produces the following output

n = 3
Wn = 0.6219

and the following figure

Figure 1

Demonstration 5

The following code

 fs    = 44100;
 Npts  = fs;
 fpass = [9500 9750];
 fstop = [8500 10261];
 Rpass = 3;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn);
 f = 5000:15000;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_bp_pass_x = [fpass(1), fpass(1), fpass(2), fpass(2)];
 outline_bp_pass_y = [-80     , -Rpass  , -Rpass  , -80];
 outline_bp_stop_x = [min(f)  , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_bp_stop_y = [-Rstop  , -Rstop  , 0       , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_bp_pass_x, outline_bp_pass_y, "m", outline_bp_stop_x, outline_bp_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("4th order digital elliptical band-pass (without margin) limitation on upper freq");

Produces the following output

n = 2
Wn =

   0.4308   0.4422

and the following figure

Figure 1

Demonstration 6

The following code

 fs    = 44100;
 Npts  = fs;
 fpass = [9500 9750];
 fstop = [9000 10700];
 Rpass = 3;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn);
 f = 5000:15000;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_bp_pass_x = [fpass(1), fpass(1), fpass(2), fpass(2)];
 outline_bp_pass_y = [-80     , -Rpass  , -Rpass  , -80];
 outline_bp_stop_x = [min(f)  , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_bp_stop_y = [-Rstop  , -Rstop  , 0       , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_bp_pass_x, outline_bp_pass_y, "m", outline_bp_stop_x, outline_bp_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("4th order digital elliptical band-pass (without margin) limitation on lower freq");

Produces the following output

n = 2
Wn =

   0.4308   0.4422

and the following figure

Figure 1

Demonstration 7

The following code

 fs    = 44100;
 Npts  = fs;
 fpass = [9500 9750];
 fstop = [8500 10260];
 Rpass = 3;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn);
 f = 5000:15000;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_bp_pass_x = [fpass(1), fpass(1), fpass(2), fpass(2)];
 outline_bp_pass_y = [-80     , -Rpass  , -Rpass  , -80];
 outline_bp_stop_x = [min(f)  , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_bp_stop_y = [-Rstop  , -Rstop  , 0       , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_bp_pass_x, outline_bp_pass_y, "m", outline_bp_stop_x, outline_bp_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("6th order digital elliptical band-pass (just exceeds 4th order i.e. large margin) limitation on upper freq");

Produces the following output

n = 3
Wn =

   0.4308   0.4422

and the following figure

Figure 1

Demonstration 8

The following code

 fs    = 44100;
 Npts  = fs;
 fpass = [9500 9750];
 fstop = [9001 10700];
 Rpass = 3;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn);
 f = 5000:15000;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_bp_pass_x = [fpass(1), fpass(1), fpass(2), fpass(2)];
 outline_bp_pass_y = [-80     , -Rpass  , -Rpass  , -80];
 outline_bp_stop_x = [min(f)  , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_bp_stop_y = [-Rstop  , -Rstop  , 0       , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_bp_pass_x, outline_bp_pass_y, "m", outline_bp_stop_x, outline_bp_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("6th order digital elliptical band-pass (just exceeds 4th order i.e. large margin) limitation on lower freq");

Produces the following output

n = 3
Wn =

   0.4308   0.4422

and the following figure

Figure 1

Demonstration 9

The following code

 fs    = 44100;
 Npts  = fs;
 fstop = [9875 10126.5823];
 fpass = [8500 11073];
 Rpass = 0.5;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn, "stop");
 f = 5000:15000;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_notch_pass_x_a = [min(f)  , fpass(1), fpass(1)];
 outline_notch_pass_x_b = [fpass(2), fpass(2), max(f)];
 outline_notch_pass_y_a = [-Rpass  , -Rpass  , -80];
 outline_notch_pass_y_b = [-80     , -Rpass  , -Rpass];
 outline_notch_stop_x   = [min(f)  , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_notch_stop_y   = [0       , 0       , -Rstop  , -Rstop  , 0       , 0 ];
 hold on
 plot (outline_notch_pass_x_a, outline_notch_pass_y_a, "m", outline_notch_pass_x_b, outline_notch_pass_y_b, "m", outline_notch_stop_x, outline_notch_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("4th order digital elliptical notch (without margin) limit on upper freq");

Produces the following output

n = 2
Wn =

   0.4060   0.5022

and the following figure

Figure 1

Demonstration 10

The following code

 fs    = 44100;
 Npts  = fs;
 fstop = [9875 10126.5823];
 fpass = [8952 12000];
 Rpass = 0.5;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn, "stop");
 f = 5000:15000;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_notch_pass_x_a = [min(f)  , fpass(1), fpass(1)];
 outline_notch_pass_x_b = [fpass(2), fpass(2), max(f)];
 outline_notch_pass_y_a = [-Rpass  , -Rpass  , -80];
 outline_notch_pass_y_b = [-80     , -Rpass  , -Rpass];
 outline_notch_stop_x   = [min(f)  , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_notch_stop_y   = [0       , 0       , -Rstop  , -Rstop  , 0       , 0 ];
 hold on
 plot (outline_notch_pass_x_a, outline_notch_pass_y_a, "m", outline_notch_pass_x_b, outline_notch_pass_y_b, "m", outline_notch_stop_x, outline_notch_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("4th order digital elliptical notch (without margin) limit on lower freq");

Produces the following output

n = 2
Wn =

   0.4060   0.5022

and the following figure

Figure 1

Demonstration 11

The following code

 fs    = 44100;
 Npts  = fs;
 fstop = [9875 10126.5823];
 fpass = [8500 11072];
 Rpass = 0.5;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn, "stop");
 f = 5000:15000;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_notch_pass_x_a = [min(f)  , fpass(1), fpass(1)];
 outline_notch_pass_x_b = [fpass(2), fpass(2), max(f)];
 outline_notch_pass_y_a = [-Rpass  , -Rpass  , -80];
 outline_notch_pass_y_b = [-80     , -Rpass  , -Rpass];
 outline_notch_stop_x   = [min(f)  , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_notch_stop_y   = [0       , 0       , -Rstop  , -Rstop  , 0       , 0 ];
 hold on
 plot (outline_notch_pass_x_a, outline_notch_pass_y_a, "m", outline_notch_pass_x_b, outline_notch_pass_y_b, "m", outline_notch_stop_x, outline_notch_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("6th order digital elliptical notch (just exceeds 4th order) limit on upper freq");

Produces the following output

n = 3
Wn =

   0.4060   0.5021

and the following figure

Figure 1

Demonstration 12

The following code

 fs    = 44100;
 Npts  = fs;
 fstop = [9875 10126.5823];
 fpass = [8953 12000];
 Rpass = 0.5;
 Rstop = 40;
 Wpass = 2/fs * fpass;
 Wstop = 2/fs * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop)
 [b, a] = ellip (n, Rpass, Rstop, Wn, "stop");
 f = 5000:15000;
 W = f * (2 * pi / fs);
 H = freqz (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_notch_pass_x_a = [min(f)  , fpass(1), fpass(1)];
 outline_notch_pass_x_b = [fpass(2), fpass(2), max(f)];
 outline_notch_pass_y_a = [-Rpass  , -Rpass  , -80];
 outline_notch_pass_y_b = [-80     , -Rpass  , -Rpass];
 outline_notch_stop_x   = [min(f)  , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_notch_stop_y   = [0       , 0       , -Rstop  , -Rstop  , 0       , 0 ];
 hold on
 plot (outline_notch_pass_x_a, outline_notch_pass_y_a, "m", outline_notch_pass_x_b, outline_notch_pass_y_b, "m", outline_notch_stop_x, outline_notch_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("6th order digital elliptical notch (just exceeds 4th order) limit on lower freq");

Produces the following output

n = 3
Wn =

   0.4060   0.5021

and the following figure

Figure 1

Demonstration 13

The following code

 fpass = 4000;
 fstop = 20224;
 Rpass = 3;
 Rstop = 40;
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "s");
 f = 1000:10:100000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 semilogx(f, 20 * log10 (abs (H)))
 outline_lp_pass_x = [f(2)  , fpass(1), fpass(1)];
 outline_lp_pass_y = [-Rpass, -Rpass  , -80];
 outline_lp_stop_x = [f(2)  , fstop(1), fstop(1), max(f)];
 outline_lp_stop_y = [0     , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_lp_pass_x, outline_lp_pass_y, "m", outline_lp_stop_x, outline_lp_stop_y, "m")
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("2nd order analog elliptical low-pass (without margin)");

Produces the following output

n = 2
Wn = 2.5133e+04

and the following figure

Figure 1

Demonstration 14

The following code

 fpass = 4000;
 fstop = 20223;
 Rpass = 3;
 Rstop = 40;
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "s");
 f = 1000:10:100000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 semilogx (f, 20 * log10 (abs (H)))
 outline_lp_pass_x = [f(2)  , fpass(1), fpass(1)];
 outline_lp_pass_y = [-Rpass, -Rpass  , -80];
 outline_lp_stop_x = [f(2)  , fstop(1), fstop(1), max(f)];
 outline_lp_stop_y = [0     , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_lp_pass_x, outline_lp_pass_y, "m", outline_lp_stop_x, outline_lp_stop_y, "m")
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("3rd order analog elliptical low-pass (just exceeds 2nd order i.e. large margin)");

Produces the following output

n = 3
Wn = 2.5133e+04

and the following figure

Figure 1

Demonstration 15

The following code

 fstop = 4000;
 fpass = 20224;
 Rpass = 3;
 Rstop = 40;
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "high", "s");
 f = 1000:10:100000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 semilogx (f, 20 * log10 (abs (H)))
 outline_hp_pass_x = [fpass(1), fpass(1), max(f)];
 outline_hp_pass_y = [-80     , -Rpass  , -Rpass];
 outline_hp_stop_x = [f(2)    , fstop(1), fstop(1), max(f)];
 outline_hp_stop_y = [-Rstop  , -Rstop  , 0       , 0     ];
 hold on
 plot (outline_hp_pass_x, outline_hp_pass_y, "m", outline_hp_stop_x, outline_hp_stop_y, "m")
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("2nd order analog elliptical high-pass (without margin)");

Produces the following output

n = 2
Wn = 1.2707e+05

and the following figure

Figure 1

Demonstration 16

The following code

 fstop = 4000;
 fpass = 20223;
 Rpass = 3;
 Rstop = 40;
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "high", "s");
 f = 1000:10:100000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 semilogx (f, 20 * log10 (abs (H)))
 outline_hp_pass_x = [fpass(1), fpass(1), max(f)];
 outline_hp_pass_y = [-80     , -Rpass  , -Rpass];
 outline_hp_stop_x = [f(2)    , fstop(1), fstop(1), max(f)];
 outline_hp_stop_y = [-Rstop  , -Rstop  , 0       , 0     ];
 hold on
 plot (outline_hp_pass_x, outline_hp_pass_y, "m", outline_hp_stop_x, outline_hp_stop_y, "m")
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("3rd order analog elliptical high-pass (just exceeds 2nd order i.e. large margin)");

Produces the following output

n = 3
Wn = 1.2706e+05

and the following figure

Figure 1

Demonstration 17

The following code

 fpass = [9875 10126.5823];
 fstop = [9000 10657];
 Rpass = 3;
 Rstop = 40;
 fcenter = sqrt (fpass(1) * fpass(2));
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "s");
 f = 5000:15000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_bp_pass_x = [fpass(1), fpass(1), fpass(2), fpass(2)];
 outline_bp_pass_y = [-80     , -Rpass  , -Rpass  , -80];
 outline_bp_stop_x = [f(2)    , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_bp_stop_y = [-Rstop  , -Rstop  , 0       , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_bp_pass_x, outline_bp_pass_y, "m", outline_bp_stop_x, outline_bp_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("4th order analog elliptical band-pass (without margin) limitation on upper freq");

Produces the following output

n = 2
Wn =

   6.2046e+04   6.3627e+04

and the following figure

Figure 1

Demonstration 18

The following code

 fpass = [9875 10126.5823];
 fstop = [9384 12000];
 Rpass = 3;
 Rstop = 40;
 fcenter = sqrt (fpass(1) * fpass(2));
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "s");
 f = 5000:15000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_bp_pass_x = [fpass(1), fpass(1), fpass(2), fpass(2)];
 outline_bp_pass_y = [-80     , -Rpass  , -Rpass  , -80];
 outline_bp_stop_x = [f(2)    , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_bp_stop_y = [-Rstop  , -Rstop  , 0       , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_bp_pass_x, outline_bp_pass_y, "m", outline_bp_stop_x, outline_bp_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("4th order analog elliptical band-pass (without margin) limitation on lower freq");

Produces the following output

n = 2
Wn =

   6.2046e+04   6.3627e+04

and the following figure

Figure 1

Demonstration 19

The following code

 fpass = [9875 10126.5823];
 fstop = [9000 10656];
 Rpass = 3;
 Rstop = 40;
 fcenter = sqrt (fpass(1) * fpass(2));
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "s");
 f = 5000:15000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_bp_pass_x = [fpass(1), fpass(1), fpass(2), fpass(2)];
 outline_bp_pass_y = [-80     , -Rpass  , -Rpass  , -80];
 outline_bp_stop_x = [f(2)    , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_bp_stop_y = [-Rstop  , -Rstop  , 0       , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_bp_pass_x, outline_bp_pass_y, "m", outline_bp_stop_x, outline_bp_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("6th order analog elliptical band-pass (just exceeds 4th order i.e. large margin) limitation on upper freq");

Produces the following output

n = 3
Wn =

   6.2046e+04   6.3627e+04

and the following figure

Figure 1

Demonstration 20

The following code

 fpass = [9875 10126.5823];
 fstop = [9385 12000];
 Rpass = 3;
 Rstop = 40;
 fcenter = sqrt (fpass(1) * fpass(2));
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "s");
 f = 5000:15000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_bp_pass_x = [fpass(1), fpass(1), fpass(2), fpass(2)];
 outline_bp_pass_y = [-80     , -Rpass  , -Rpass  , -80];
 outline_bp_stop_x = [f(2)    , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_bp_stop_y = [-Rstop  , -Rstop  , 0       , 0       , -Rstop  , -Rstop];
 hold on
 plot (outline_bp_pass_x, outline_bp_pass_y, "m", outline_bp_stop_x, outline_bp_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("6th order analog elliptical band-pass (just exceeds 4th order i.e. large margin) limitation on lower freq");

Produces the following output

n = 3
Wn =

   6.2046e+04   6.3627e+04

and the following figure

Figure 1

Demonstration 21

The following code

 fstop = [9875 10126.5823];
 fpass = [9000 10657];
 Rpass = 3;
 Rstop = 40;
 fcenter = sqrt (fpass(1) * fpass(2));
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "stop", "s");
 f = 5000:15000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_notch_pass_x_a = [f(2)    , fpass(1), fpass(1)];
 outline_notch_pass_x_b = [fpass(2), fpass(2), max(f)];
 outline_notch_pass_y_a = [-Rpass  , -Rpass  , -80];
 outline_notch_pass_y_b = [-80     , -Rpass  , -Rpass];
 outline_notch_stop_x   = [f(2)    , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_notch_stop_y   = [0       , 0       , -Rstop  , -Rstop  , 0       , 0 ];
 hold on
 plot (outline_notch_pass_x_a, outline_notch_pass_y_a, "m", outline_notch_pass_x_b, outline_notch_pass_y_b, "m", outline_notch_stop_x, outline_notch_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("4th order analog elliptical notch (without margin) limit on upper freq");

Produces the following output

n = 2
Wn =

   5.8958e+04   6.6960e+04

and the following figure

Figure 1

Demonstration 22

The following code

 fstop = [9875 10126.5823];
 fpass = [9384 12000];
 Rpass = 3;
 Rstop = 40;
 fcenter = sqrt (fpass(1) * fpass(2));
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "stop", "s");
 f = 5000:15000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_notch_pass_x_a = [f(2)    , fpass(1), fpass(1)];
 outline_notch_pass_x_b = [fpass(2), fpass(2), max(f)];
 outline_notch_pass_y_a = [-Rpass  , -Rpass  , -80];
 outline_notch_pass_y_b = [-80     , -Rpass  , -Rpass];
 outline_notch_stop_x   = [f(2)    , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_notch_stop_y   = [0       , 0       , -Rstop  , -Rstop  , 0       , 0 ];
 hold on
 plot (outline_notch_pass_x_a, outline_notch_pass_y_a, "m", outline_notch_pass_x_b, outline_notch_pass_y_b, "m", outline_notch_stop_x, outline_notch_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("4th order analog elliptical notch (without margin) limit on lower freq");

Produces the following output

n = 2
Wn =

   5.8961e+04   6.6956e+04

and the following figure

Figure 1

Demonstration 23

The following code

 fstop = [9875 10126.5823];
 fpass = [9000 10656];
 Rpass = 3;
 Rstop = 40;
 fcenter = sqrt (fpass(1) * fpass(2));
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "stop", "s");
 f = 5000:15000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_notch_pass_x_a = [f(2)    , fpass(1), fpass(1)];
 outline_notch_pass_x_b = [fpass(2), fpass(2), max(f)];
 outline_notch_pass_y_a = [-Rpass  , -Rpass  , -80];
 outline_notch_pass_y_b = [-80     , -Rpass  , -Rpass];
 outline_notch_stop_x   = [f(2)    , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_notch_stop_y   = [0       , 0       , -Rstop  , -Rstop  , 0       , 0 ];
 hold on
 plot (outline_notch_pass_x_a, outline_notch_pass_y_a, "m", outline_notch_pass_x_b, outline_notch_pass_y_b, "m", outline_notch_stop_x, outline_notch_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("6th order analog elliptical notch (just exceeds 4th order) limit on upper freq");

Produces the following output

n = 3
Wn =

   5.8964e+04   6.6954e+04

and the following figure

Figure 1

Demonstration 24

The following code

 fstop = [9875 10126.5823];
 fpass = [9385 12000];
 Rpass = 3;
 Rstop = 40;
 fcenter = sqrt (fpass(1) * fpass(2));
 Wpass = 2*pi * fpass;
 Wstop = 2*pi * fstop;
 [n, Wn] = ellipord (Wpass, Wstop, Rpass, Rstop, "s")
 [b, a] = ellip (n, Rpass, Rstop, Wn, "stop", "s");
 f = 5000:15000;
 W = 2*pi * f;
 H = freqs (b, a, W);
 plot (f, 20 * log10 (abs (H)))
 outline_notch_pass_x_a = [f(2)    , fpass(1), fpass(1)];
 outline_notch_pass_x_b = [fpass(2), fpass(2), max(f)];
 outline_notch_pass_y_a = [-Rpass  , -Rpass  , -80];
 outline_notch_pass_y_b = [-80     , -Rpass  , -Rpass];
 outline_notch_stop_x   = [f(2)    , fstop(1), fstop(1), fstop(2), fstop(2), max(f)];
 outline_notch_stop_y   = [0       , 0       , -Rstop  , -Rstop  , 0       , 0 ];
 hold on
 plot (outline_notch_pass_x_a, outline_notch_pass_y_a, "m", outline_notch_pass_x_b, outline_notch_pass_y_b, "m", outline_notch_stop_x, outline_notch_stop_y, "m")
 xlim ([f(1), f(end)]);
 ylim ([-80, 0]);
 grid on
 xlabel ("Frequency (Hz)");
 ylabel ("Attenuation (dB)");
 title ("6th order analog elliptical notch (just exceeds 4th order) limit on lower freq");

Produces the following output

n = 3
Wn =

   5.8968e+04   6.6949e+04

and the following figure

Figure 1

Package: signal