clear all;
N = 5; fs = 40; f0 = fs/2; Df = 2; w0 = 2*pi*f0/fs; Dw = 2*pi*Df/fs;
G0 = 0; G = 12; GB = 11.99; type = 3; Gs = 0.01; tol=eps;
[B,A,Bh,Ah] = hpeq(N, G0, G, GB, w0, Dw, type, Gs, tol)
f = linspace(0,20,1001); w = 2*pi*f/fs;
H = 20*log10(abs(fresp(B,A,w)));
[w1,w2] = bandedge(w0,Dw); f1 = fs * w1/2/pi; f2 = fs * w2/2/pi;
Dws = bandwidth(N, G0, G, GB, Gs, Dw, type, Gs);
[w1s,w2s] = bandedge(w0,Dws); f1s = fs * w1s/2/pi; f2s = fs * w2s/2/pi;
Gb = G-3; Dwb = bandwidth(N,G0,G,GB,Gb,Dw,type,Gs);
[w1b,w2b] = bandedge(w0,Dwb); f1b = fs * w1b/2/pi; f2b = fs * w2b/2/pi;
figure;
plot(f,H,'r-', [f1,f2,f1b,f2b,f1s,f2s], [GB,GB,Gb,Gb,Gs,Gs], 'b.');
ylim([-8 14]); ytick(-6:3:12);
xlim([0,20]); xtick(0:2:20);
title('Elliptic, HP Shelf, {\it N} = 5');
xlabel('{\it f} (kHz)'); ylabel('dB');
grid;
B =
2.6134 1.5356 0 0 0
0.7748 1.3358 0.6916 0 0
0.5888 0.8448 0.3542 0 0
A =
1.0000 0.7293 0 0 0
1.0000 1.7741 0.9046 0 0
1.0000 1.5845 0.6828 0 0
Bh =
2.6134 -1.5356 0
0.7748 -1.3358 0.6916
0.5888 -0.8448 0.3542
Ah =
1.0000 -0.7293 0
1.0000 -1.7741 0.9046
1.0000 -1.5845 0.6828