数字滤波器设计英文文献Word文档格式.docx
《数字滤波器设计英文文献Word文档格式.docx》由会员分享,可在线阅读,更多相关《数字滤波器设计英文文献Word文档格式.docx(15页珍藏版)》请在冰豆网上搜索。
Thedesignprocessofadigitalfilterislongandtediousifdonebyhand.Withtheaidof
computerprogramsperformingfilterdesignalgorithms,designingandoptimizingfilters
canbedonerelativelyquickly.ThispaperdiscussestheuseofMatlab,amathematical
softwarepackage,todesign,manipulate,andanalyzedigitalfilters.
ThedesignoptionsinMatlaballowtheusertoeithercreateacodefordesigningfilters
thatcallsbuilt-infunctions,ortodesignfiltersinSptool,agraphicaluserinterface.Each
ofthesemethodsareexaminedinthispaper.Thestrengthsandweaknessesofeachare
detailedinthefollowingdiscussion.
ThispaperconcludeswithadiscussionofhowthedatagivenbyMatlabforvariousfilters
canbeusedtoimplementfiltersonrealdigitalsignalprocessors.Matlabprovidesallthe
informationnecessaryforbuildingahardwarereplicaofthefilterdesignedinsoftware.
TABLEOFCONTENTS
1.Abstract……………………………………………………………..4
2.Introduction.………………………………………………………..4
3.LowpassFilterDesign………………………………………………7
4.HighpassandBandpassFilterDesign………………………………11
5.Sptool……………………………………………………………….13
6.FutureDirections……………………………………………………16
7.Acknowledgments…………………………………………………..16
8.References…………………………………………………………..16
9.Appendix…………………………………………………………….17
Abstract
Matlabprovidesdifferentoptionsfordigitalfilterdesign,whichincludefunctioncallsto
filteralgorithmsandagraphicaluserinterfacecalledSptool.Avarietyoffilterdesign
algorithmsareavailableinMatlabforbothIIRandFIRfilters.Thispaperdiscussesthe
differentoptionsinMatlabandgivesexamplesoflowpass,highpass,andbandpassfilter
designs.
ResultsshowthatthegraphicaluserinterfaceSptoolisaquickerandsimpleroptionthan
theoptionofmakingfunctioncallstothefilteralgorithms.Sptoolhasamoreuser-
friendlyenvironmentsincethespectrumofthefilterisimmediatelydisplayedtotheuser,
andtheusercanquicklyzoominandexamineparticularareasofinterestinthespectrum
(i.e.thepassband).However,theshortcomingofSptoolisthatitonlydisplaysthe
magnituderesponseofthefilter,notthephaseresponse.
Introduction
Akeyelementinprocessingdigitalsignalsisthefilter.Filtersperformdirect
manipulationsonthespectraofsignals.Tocompletelydescribedigitalfilters,threebasic
elements(orbuildingblocks)areneeded:
anadder,amultiplier,andadelayelement.The
adderhastwoinputsandoneoutput,anditsimplyaddsthetwoinputstogether.The
multiplierisagainelement,anditmultipliestheinputsignalbyaconstant.Thedelay
elementdelaystheincomingsignalbyonesample.Digitalfilterscanbeimplemented
usingeitherablockdiagramorasignalflowgraph.Figure1showsthethreebasic
elementsinblockdiagramform,andFigure2showstheminsignalflowgraphform.
Withthebasicbuildingblocksathand,thetwodifferentfilterstructurescaneasilybe
implemented.ThesetwostructuresareInfiniteImpulseResponse(IIR)andFinite
ImpulseResponse(FIR),dependingontheformofthesystem’sresponsetoaunitpulse
input.IIRfiltersarecommonlyimplementedusingafeedback(recursive)structure,while
FIRfiltersusuallyrequirenofeedback(non-recursive).
InthedesignofIIRfilters,acommonlyusedapproachiscalledthebilinear
transformation.Thisdesignbeginswiththetransferfunctionofananalogfilter,then
performsamappingfromthes-domaintothez-domain.Usingdifferentialequations,it
canbeshown(Proakis677)thatthemappingfromthes-planetothez-planeis
ThismappingresultsinageneralformforanIIRfilterwithanarbitrarynumberofpoles
andzeros.Thesystemresponseandthedifferenceequationforthisfilterisasfollows:
Thissystemresponsecanbeeasilyrealizedusingasignalflowgraph
AnFIRfilterhasadifferenceequationof
Bytakingthez-transform,thesystemresponseis
TherealizationofanFIRfilterusingasignalflowgraphisstraightforward.
MatlabhasseveraldesignalgorithmsthatcanbeusedtocreateandanalyzebothIIRand
FIRdigitalfilters.TheIIRfiltersthatcanbecreatedinMatlabareButterworth,
Chebyshevtype1and2,andelliptic.TheFIRfilteralgorithmsinMatlabareequiripple,
leastsquares,andKaiserwindow.TheMatlabcoderequiredtoimplementthesefilters
involvesbilineartransformationsandfunctioncallstoanalogprototypefilters.The
followingsectionsgiveexamplesofMatlabimplementationoftheIIRfilterslistedabove.
LowpassFilterDesign
UsingMatlab,alowpassdigitalfilterisdesignedusingvariousanalogprototypes:
Chebyshev,Butterworth,andElliptic.Theoptimumfiltertypeischosenonthebasisof
implementationcomplexity,magnituderesponse,andphaseresponse.Thedesign
specificationsforthefilterareasfollows:
•Cutofffrequency=1000Hz
•Samplefrequency=8000Hz
•Passbandripple=0.5dB
•Stopbandattn.=60dB
•Transitionband=100Hz
MatlabCode(Chebyshev):
%LowpassdigitalfilterwithChebyshev-Ianalogprototype
%
%DigitalFilterSpecifications:
wp=0.125*2*pi;
%digitalpassbandfrequencyinHz(normalized)
ws=0.1375*2*pi;
%digitalstopbandfrequencyinHz(normalized)
Rp=0.5;
%passbandrippleindB
As=20;
%stopbandattenuationindB
%AnalogPrototypeSpecifications:
Fs=1;
T=1/Fs;
OmegaP=(2/T)*tan(wp/2);
%prewarpprototypepassbandfrequency
OmegaS=(2/T)*tan(ws/2);
%prewarpprototypestopbandfrequency
%AnalogChebyshev-1PrototypeFilterCalculation:
[c,d]=chb1(OmegaP,OmegaS,Rp,As);
%BilinearTransformation:
[b,a]=bilinear(cs,ds,Fs);
[db,mag,pha,grd,w]=freqz(b,a);
plot(w*8000/2/pi,db);
xlabel('
frequency(Hz)'
);
ylabel('
decibels'
title('
Magnitudein
dB'
ThisexactcodeisalsousedfortheellipticandButterworthdesigns.Theonlychangeis
inthefiltercalculationsofeachtype.Insteadofcallingchb1(),theellipticfilterdesign
callsafunction“elliptic()”andtheButterworthdesigncallsafunction
“butterworth()”.SeetheappendixfortheMatlabcodeofthefunctionchb1().
Thefollowingfiguresshowthemagnitudeandphaseresponsesofeachtypeoffilter.
MagnitudeResponseofChebyshevFilter
PhaseofChebyshevFilter
MagnitudeResponseofEllipticFilter
PhaseofEllipticFilter
MagnitudeResponseofButterworthFilter
PhaseofButterworthFilter
TheMatlabcodeoutputsthefilterorderandthefiltercoefficients.Forthisexample,the
Chebyshevfilterorderwasnine.Theellipticfilterhadanorderoffive,andthe
Butterworthfilterorderwasthirty-two.
Severalconclusionscanbedrawnabouttheselow-passfilterdesignsfromthissimple
example.First,ingeneral,foragivensetofdesignconstraints,theellipticfilterdesign
algorithmwillresultinthesimplestfilter(intermsofcomplexity).Themostcomplex
filteristheButterworthfilterwithanorderofthirty-two.Intermsofpassbandripple,the
Butterworthfiltergivestheoptimumresponse.Inthepassband,thereisalmostnoripple
(monotonic).TheellipticandChebyshevfiltersbothhavemuchmorerippleinthe
passband.So,thereisatradeoffbetweenthesethreedifferenttypesoffilters.Intermsof
magnituderesponseandcomplexity,theellipticrippleismostlikelytheoptimumchoice.
However,theellipticripplehasaphaseresponsethatismorenonlinearthanthe
ChebyshevandButterworthfilters.Therefore,ifasharpcutoffandrelativelylow
complexityisrequired,thechoicewouldbetheellipticfilter.Ifthephaseresponsewould
needtobemorelinear,aChebyshevorButterworthfiltershouldbechosenoverthe
ellipticfilter.
HighpassandBandpassFilterDesign
Matlabprovidesfunctionsforimplementinglowpass-to-highpassandlowpass-to-bandpass
conversions.Byprovidingafilterorder,thepassbandripple,andthe3dBcutoff
frequencytothefunctioncheby1(),ahighpassfiltercanbedesigned.Thefilterorderis
foundusingthefunctionchebord().ForaButterworthprototype,thefunctionsare
butter()andbuttord().Fortheellipticprototype,thefunctionsareellip()and
ellipord().
ThefollowingMatlabcodeisusedtodesignaChebyshevhighpassdigitalfilterwitha
passbandat1100Hzanda100Hztransitionband.
%HighpassChebyshevDigitalFilter
ws=0.125*2*pi;
%digitalstopbandfrequencyinrad/s
wp=0.1375*2*pi;
%digitalpassbandfrequencyinrad/s
[N,wn]=cheb1ord(wp/pi,ws/pi,Rp,As);
[b,a]=cheby1(N,Rp,wn,'
high'
[db,mag,pha,grd,w]=freqz_m(b,a);
axis([8001200-221]);
Thefollowingfigureshowsthemagnituderesponseofthehighpassfilter.
Bandpassfiltersarefoundusingthesesametwofunctions.However,withbandpass
filters,thepassbandandstopbandfrequencies(wpandws)aretwo-elementvectorssince
therearetwopassbandfrequenciesandtwostopbandfrequencies.TheMatlabcode
belowshowsthedesignofanellipticdigitalbandpass