CHEBYSHEV TYPE-I STOPBAND FILTER

clc;
clear all;
close all;
format long;
rp=input('Enter the Passband Ripple:');
rs=input('Enter the Stopband Ripple:');
wp=input('Enter the Passband Frequency:');
ws=input('Enter the Stopband Frequency:');
fs=input('Enter the Sampling Frequency:');
w1=2*wp/fs;
w2=2*ws/fs;
[n,wn]=cheb1ord(w1,w2,rp,rs,'s');
wn=[w1,w2];
[b,a]=cheby1(n,rp,wn,'stop','s');
w=0:0.1:pi;
[h,om]=freqs(b,a,w);
m=20*log10(abs(h));
an=angle(h);
subplot(2,1,1);
plot(om/pi,m);
ylabel('Gain in dB');
xlabel('(a)Normalized Frequency');
subplot(2,1,2);
plot(om/pi,an);
ylabel('Phase in Radians');
xlabel('(b)Normalized Frequency');

Input:

Enter the Passband Ripple:.01
Enter the Stopband Ripple:20
Enter the Passband Frequency:1000
Enter the Stopband Frequency:2000
Enter the Sampling Frequency:5000

Output:

No comments:

Post a Comment