Pages

Monday, December 13, 2010

MATLAB PROGRAM FOR IMPLEMENTING CHEBYSHEV LOW PASS FILTER


%chebyshev LPF
% specification
clear all;
alphap=input('pass band attenuation?=');
alphas=input('stop band attenuation in db?=');
wp=input('pass band frq in rad=');
ws=input('stop band freq in rad=');
% find cut-off freq and order of filter
[n,wn]=cheb1ord(wp/pi,ws/pi,alphap,alphas);
%system function above
[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(221);
plot(ph/pi,m);
grid;
ylabel('gain in db');
xlabel('nor fre');
subplot(212);
plot(ph/pi,an);
grid;
ylabel('phase in rad');
xlabel('norm freq');
 
 
OUTPUT WAVEFORM
 
 

No comments:

Post a Comment