CHEBYSHEV TYPE 1 BAND PASS FILTER
alphap=input('pass band attenuation in dB=');
alphas=input('stop band attenuation in dB=');
fp1=input('pass band frequency fp1 in Hz=');
fp2=input('pass band frequency fp2 in Hz=');
fs1=input('stop band frequency fs1 in Hz=');
fs2=input('stop band frequency fs2 in Hz=');
f=input('Sampling frequency in Hz=');
wp1=2*fp1/f;ws1=2*fs1/f;
wp2=2*fp2/f;ws2=2*fs2/f;
wp=[wp1,wp2];
ws=[ws1,ws2];
%To find cutoff frequency and order of the filter
[n,wn]=cheb1ord(wp,ws,alphap,alphas);
%system function of the filter
[b,a]=cheby1(n,alphap,wn);
w=0:.01:pi;
[h,ph]=freqz(b,a,w);
m=20*log(abs(h));
an=angle(h);
subplot(2,1,1);
plot(ph/pi,m);
grid;
ylabel('Gain in dB');
xlabel('Normalised frequency');
subplot(2,1,2);
plot(ph/pi,an);
grid;
ylabel('Phase in radians');
xlabel('Normalised frequency');
Observation:
pass band attenuation in dB=2
stop band attenuation in dB=20
pass band frequency fp1 in Hz=100
pass band frequency fp2 in Hz=500
stop band frequency fs1 in Hz=200
stop band frequency fs2 in Hz=400
Sampling frequency in Hz=2000
0 comments:
Post a Comment