Chebyshev Filter Design [Type I] - Low Pass Filter

Algorithm

1) Input passband and stopband attenuations

2) Input stopband and passband frequencies in radians

3) Find order and cutoff frequency of filter using the command "cheby1ord"

4) Find the system function of the filter using the MATLAB command "cheby1"

5) Find the frequency response of the filter using "freqz" command.

Program


clear all;

Ap=input('Enter passband attenuation in dB');

As= input('Enter stopband attenuation in dB');

Wp= input('Enter passband frequency in radians');

[n,Wn]= cheby1ord(wp/pi, ws/pi, Ap, As); %order and cutoff frequency of the filter

[b,a]= cheby1(N, Ap, wn);

w=0:0.01:pi;

[h,f]=freqz(b,a,w);

m=20*log10(abs(h));

an=angle(h);

subplot(2,1,1);

plot(f/pi,m);

ylabel('gain in dB');

xlabel('normalised frequency');

subplot(2,1,2);

plot(f/pi,an);

xlabel('normalised frequency');

ylabel('phase in radians');

2 comments:

Your Comments... (comments are moderated)