clear all;
N = 4; fs = 40; f0 = 5; 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;
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;
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;
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, boost, {\it N} = 4');
xlabel('{\it f} (kHz)'); ylabel('dB');
grid;
B =
3.9765 0 0 0 0
0.6530 -1.6319 2.0848 -1.4311 0.5110
0.4760 -1.0537 1.1314 -0.6243 0.1724
A =
1.0000 0 0 0 0
1.0000 -2.5865 3.3969 -2.3320 0.8200
1.0000 -2.4129 2.8797 -1.7376 0.5225
Bh =
3.9765 0 0
0.6530 -1.0019 0.5110
0.4760 -0.5381 0.1724
Ah =
1.0000 0 0
1.0000 -1.6579 0.8200
1.0000 -1.4123 0.5225