CHEBYSHEV TYPE-II BANDPASS 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]=cheb2ord(w1,w2,rp,rs,'s');
wn=[w1,w2];
[b,a]=cheby2(n,rp,wn,'bandpass','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)normalised frequency');
subplot(2,1,2);
plot(om/pi,an);
ylabel('phase in radians');
xlabel('(b)normalised 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