CHEBYSHEV TYPE 2 BAND PASS FILTER MATLAB PROGRAMS

CHEBYSHEV TYPE 2 BAND STOP 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]=cheb2ord(wp,ws,alphap,alphas);

%system function of the filter

[b,a]=cheby2(n,alphas,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=700

stop band frequency fs1 in Hz=200

stop band frequency fs2 in Hz=500

Sampling frequency in Hz=2000


 


 

0 comments: