This document contains code to design and compare Chebyshev type I and Elliptic bandstop filters with the same specifications. The filters are designed to have a passband frequency of 300-700 Hz, stopband frequency of 400-600 Hz, passband ripple of 0.5 dB, and stopband ripple of 60 dB. The frequency responses of the filters are plotted and a test signal containing frequencies in the transition band is filtered through each design to compare their outputs in the time domain.
This document contains code to design and compare Chebyshev type I and Elliptic bandstop filters with the same specifications. The filters are designed to have a passband frequency of 300-700 Hz, stopband frequency of 400-600 Hz, passband ripple of 0.5 dB, and stopband ripple of 60 dB. The frequency responses of the filters are plotted and a test signal containing frequencies in the transition band is filtered through each design to compare their outputs in the time domain.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online from Scribd
This document contains code to design and compare Chebyshev type I and Elliptic bandstop filters with the same specifications. The filters are designed to have a passband frequency of 300-700 Hz, stopband frequency of 400-600 Hz, passband ripple of 0.5 dB, and stopband ripple of 60 dB. The frequency responses of the filters are plotted and a test signal containing frequencies in the transition band is filtered through each design to compare their outputs in the time domain.
Copyright:
Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online from Scribd
%%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)))