Experiment 4 Analog Filter Design: Ece2006 DSP Lab WINTER 2021
Experiment 4 Analog Filter Design: Ece2006 DSP Lab WINTER 2021
EXPERIMENT 4
ANALOG FILTER DESIGN
ECE2006 DSP LAB WINTER 2021
ECE2006 DSP LAB WINTER 2021
Butterworth Filter
Fp=3500;Fs=4500; %Pass band and stop band edge
frequencies%
Wp=2*pi*Fp;Ws=2*pi*Fs;
[N,wn]=buttord(Wp,Ws,0.5,30,'s');
[b,a]=butter(N,wn,'s');
wa=0:(3*Ws)/511:3*Ws;
h=freqs(b,a,wa);
subplot(2,2,1);
plot(wa/(2*pi),20*log10(abs(h)));grid
xlabel('Freq...>');ylabel('gain...>');
title('LOW PASS FILTER - Gain response');
axis([0 3*Fs -60 5]);
Chebychev-Type-I filter
Fp=3500;Fs=4500;%Pass band and stop band edge
frequencies%
Wp=2*pi*Fp;Ws=2*pi*Fs;
[N,wn]=cheb1ord(Wp,Ws,0.5,30,'s');
[b,a]=cheby1(N,30,wn,'s');
wa=0:(3*Ws)/511:3*Ws;
h=freqs(b,a,wa);
subplot(2,2,1);
plot(wa/(2*pi),20*log10(abs(h)));grid
xlabel('Freq...>');ylabel('gain...>');
title('LOW PASS FILTER - Gain response');
axis([0 3*Fs -60 5]);
ECE2006 DSP LAB WINTER 2021
Chebychev-Type-II
Fp=3500;Fs=4500;
Wp=2*pi*Fp;Ws=2*pi*Fs;
[N,wn]=cheb2ord(Wp,Ws,0.5,30,'s');
[b,a]=cheby2(N,30,wn,'s');
wa=0:(3*Ws)/511:3*Ws;
h=freqs(b,a,wa);
subplot(2,2,1);
plot(wa/(2*pi),20*log10(abs(h)));grid
xlabel('Freq...>');ylabel('gain...>');
title('LOW PASS FILTER - Gain response');
axis([0 3*Fs -60 5]);
wa=0:(3*Ws)/511:3*Ws;
h=freqs(b,a,wa);
subplot(2,2,4);
%figure;
plot(wa/(2*pi),20*log10(abs(h)));grid
xlabel('Freq...>');ylabel('gain...>');
title('BAND STOP FILTER - Gain response');
axis([0 3*Fs -200 5]);