You are on page 1of 2

%%WAP to design a BSF of same specifications being IIRC-I and

IIRE type and


%%compare their outputs in time domain when a signal lying in
transition band
%%is passed through them with Ap=0.5dB and As=60dB.
fp1=300;%passband frequency
fs1=400;%stopband frequency
fs2=600;%stopband frequency
fp2=700;%passband frequency
samp=2000;%sampling frequency
ap=.5;%passband ripples
as=60;%stopband ripples
wp=fp1 fp2,/(samp/2);%cutoff frequency
ws=fs1 fs2,/(samp/2);
%chebyshev-I
N,wn,=cheb1ord(wp,ws,ap,as); % determining order and natural
frequency
b,a,=cheby1(N,ap,wn,'stop');
H,W,=freqz(b,a,256);
subplot 121,plot(W/(2pi),20log10(abs(H)))%%plots the frequency
response curve
%ellipord
M,wm,=ellipord(wp,ws,ap,as); % determining order and natural
frequency
c,d,=ellip(M,ap, as,wm,'stop');
I,X,=freqz(c,d,256);
subplot 122,plot(X/(2pi),20log10(abs(I)))%plots the frequency
response curve
n=0:1/samp:1;
x=cos(2pi200n)+cos(2pi500n)+cos(2pi800n);
figure
subplot 221, plot(n,abs(fft(x)))
y1=filter(b,a,x);
y2=filter(c,d,x);
subplot 222, plot(n,abs(fft(y1)))
subplot 223, plot(n,abs(fft(y2)))























SubmlLLed byShruLl 8oychoudhary
uL/11/LC/12

You might also like