Reply by caine April 25, 20072007-04-25
I have to design Chebyshev type I analog lowpass filter and transform
it to digital filter using impinvar() and bilinear(). Then I have to
plot the gain response for both methods and do comparisons. However,
the gain response take in the input of g of 20log10(H)??

function X = invariance(fs)

fs = 100000;
wp = 10000*2/fs;
ws = 30000*2/fs;
rp = 0.4;
rs = 50;

[n,wn] = cheb1ord(wp,ws,rp,rs);
[b,a]= cheby1(4,0.4,0.2,'s');
[H,w] = freqz(b,a,512);
len = length(H);
[z,p,g] = cheb1ap(4,0.4)
[bz,az] = impinvar(b,a,100000)
plot(w*fs/(2*pi),20*log10(abs(H)));
title('Gain Response for Impulse Invariance');
xlabel('Frequency (Hz)');
ylabel('Gain (dB)');

% bilinear
plot(w*fs/(2*pi),20*log10(abs(H)));
title('Gain Response for Bilinear Transformation');
xlabel('Frequency (Hz)');
ylabel('Gain (dB)');
grid;