/
Lectur The Discr ete ourier ransf orm Lectur The Discr ete ourier ransf orm

Lectur The Discr ete ourier ransf orm - PDF document

pasty-toler
pasty-toler . @pasty-toler
Follow
447 views
Uploaded On 2014-12-14

Lectur The Discr ete ourier ransf orm - PPT Presentation

1 The DFT The Discrete ourier ransform DFT is the equi alent of the continuous ourier ransform for signals kno wn only at instants separated by sample times ie 64257nite sequence of data Let be the continuous signal which is the source of the d ID: 23810

The DFT The Discrete

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "Lectur The Discr ete ourier ransf orm" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Lecture7-TheDiscreteFourierTransform7.1TheDFTTheDiscreteFourierTransform(DFT)istheequivalentofthecontinuousFourierTransformforsignalsknownonlyatinstantsseparatedbysampletimes(i.e.anitesequenceofdata).Letbethecontinuoussignalwhichisthesourceofthedata.Letsamplesbedenoted\n \r \r \r \r\n \r.TheFourierTransformoftheoriginalsignal,,wouldbe "!$#%'&(*)+),.-+/102,3Wecouldregardeachsample \rasanimpulsehavingarea 45\r.Then,sincetheintegrandexistsonlyatthesamplepoints: 6!$#%7&(98;:�+=@-+/A02B3& C \rD-+/EGF \rD-+/10H?IFF \rD-+/10J?IFH-+/A08;:�+=ie. "!$#%K&:+=LJNMOE \rD-+/10J?Wecouldinprincipleevaluatethisforany#,butwithonlydatapointstostartwith,onlynaloutputswillbesignicant.YoumayrememberthatthecontinuousFouriertransformcouldbeevaluatedoveraniteinterval(usuallythefundamentalperiod@)ratherthanfromQPto82 FPifthewaveformwasperiodic.Similarly,sincethereareonlyanitenumberofinputdatapoints,theDFTtreatsthedataasifitwereperiodic(i.e.toHisthesameas RtoSH.)HencethesequenceshownbelowinFig.7.1(a)isconsideredtobeoneperiodoftheperiodicsequenceinplot(b).0123456789101100.20.40.60.81(a)05101520253000.20.40.60.81(b)Figure7.1:(a)Sequenceof&TU samples.(b)implicitperiodicityinDFT.Sincetheoperationtreatsthedataasifitwereperiodic,weevaluatetheDFTequationforthefundamentalfrequency(onecyclepersequence,:?Hz,VXW:?rad/sec.)anditsharmonics(notforgettingthed.c.component(oraverage)at#Y&Z ).i.e.set#Y&Z [H\\S]^\]`_\S]Uor,ingeneral _\r&:+=LJaMOE \rD-+/$bdcegfJ_&Z ihSH83 _\ristheDiscreteFourierTransformofthesequence \r.Wemaywritethisequationinmatrixformas:jkkkkkl C \r \r \r... S\rmnnnnno&jkkkkkkklppVprqTp:+=pVptspruTp:+VpvqpuprwTp:+q...p:+=p:+Vp:+qpmnnnnnnnojkkkkkl C \r \r \r... \rmnnnnnowherep&Zxy[z{!\}|andp&ZpV:etc.&~.DFT–exampleLetthecontinuoussignalbeK&€‚ƒdcF„…$†UH\ˆ‡ @€‚ƒ1HzFŠ‰„…‹†OŒ\€‚ƒ2Hz012345678910-4-20246810Figure7.2:ExamplesignalforDFT.Letussampleat4timespersecond(ie.=4Hz)fromŽ&r toŽ&qs.Thevaluesofthediscretesamplesaregivenby: \r&tF$‘’5WV“‡ @F”‰•$’\{byputting&r–—&Js84 i.e.\n \r˜&t™, \r&šŒ, \r›&t™, ‰\r&Z ,&ZŒRTherefore _\r&qLE \rd-+/cbfJ&qLJNMOE \rA!fJjkkl C \r \r \r ‰\rmnno&jkkl!!!!mnnojkkl C \r \r \r ‰\rmnno&jkkl$ !RŒH!RŒmnnoThemagnitudeoftheDFTcoefcientsisshownbelowinFig.7.3.012305101520f (Hz)|F[n]|Figure7.3:DFToffourpointsequence.InverseDiscreteFourierTransformTheinversetransformof _\r&:+=LJaMOE \rd-+/bdcegfJ85 is\n 4\r&:+=LfMOE _\rD-Uœ/bdcefJi.e.theinversematrixis:timesthecomplexconjugateoftheoriginal(symmet-ric)matrix.Notethatthe _\rcoefcientsarecomplex.Wecanassumethatthe\n 4\rvaluesarereal(thisisthesimplestcase;therearesituations(e.g.radar)inwhichtwoinputs,ateach,aretreatedasacomplexpair,sincetheyaretheoutputsfrom oand‡ odemodulators).Intheprocessoftakingtheinversetransformtheterms _\rand ž_\r(re-memberthatthespectrumissymmetricalabout:V)combinetoproducefre-quencycomponents,onlyoneofwhichisconsideredtobevalid(theoneatthelowerofthetwofrequencies,_*]VXW?Hzwhere_ Ÿ:V;thehigherfrequencycomponentisatan“aliasingfrequency”(_Š¡:V)).Fromtheinversetransformformula,thecontributionto \rof _\rand ¢_\ris:f \r&š£ _\rD-/bdcegfJ¤F _\rD-/bdce8;:+f�"J¥(7.2)Forall \rreal S_\r&:+=LJaMOE \rD-+/bdce8:+f�¦JBut-+/bdce8:+f�¦J&-+/VXWJ€‚ƒ1forall-œ/$bdc¨§eJ&Z-œ/$bdcegfJi.e. S_\r& ª©_(i.e.thecomplexconjugate)86 SubstitutingintotheEquationforf \rabovegives,f 4\r&£ _\rd-/bdcegfJ¤F ©_.-+/bdcegfJH¥since-/VXWJ&Tie.f \r›&£«¬£ _\r¥„‘…‹†\_š­¦®£ _\r¥†¨¯6°\_¥orf \r&T± _\r±„‘…‹†£\_F”²$³¨´ _\rd¥i.e.asampledsinewaveatVXWf:?Hz,ofmagnitudeV:± _\r±Forthespecialcaseof_&µ , \rŽ&S¶·\n 4\r(i.e.sumofallsamples)andthecontributionof C \rto\n 4\risE \r¤&: \r—&averageof \r¤&d.c.compo-nent.Interpretationofexample1. C \r›&r$ impliesad.c.valueof: C \r&VEs&r(asexpected)2. \r{&!RŒ¸& ª© ‰\rimpliesafundamentalcomponentofpeakamplitudeV:± ¦‘\r±&Vs]Œª&rwithphasegivenby²³¨´ \r›&¹‡ oi.e.„…‹†\ˆ‡ o¤&tK„‘…‹†U\Y‡ o(asexpected)3. \r&ºH_&:V–nootherS_componenthere)andthisimpliesacomponentV \r& \rD-/bdce¼»VJ&Œ 4H\rd-/WJ&‰‘’\{(asexpected)since†¨¯D°\{i&t forall87 01230123456f (Hz)|F[n]|sqrt(2)3/sqrt(2)Figure7.4:DFToffourpointsignal.Thus,theconventionalwayofdisplayingaspectrumisnotasshowninFig.7.3butasshowninFig.7.4(obviously,theinformationcontentisthesame):Intypicalapplications,ismuchgreaterthanŒ;forexample,for&½U RŒ, _\rhasU ‹Œcomponents,but^‰U R‰arethecomplexconjugatesof^$,leaving¾¿EÀVsasthed.c.component,VVs{Á¾¿ÁÂVtoVVsGÁ¾¿ÃÁÂVascompletea.c.com-ponentsandVs¾¿ÃVÀÂVasthecosine-onlycomponentatthehighestdistinguishablefrequency_&:V.MostcomputerprogrammesevaluateÁ¾¿fÀÁ:(orÁ¾¿fÀÁb:forthepowerspectralden-sity)whichgivesthecorrect“shape”forthespectrum,exceptforthevaluesat_&Z and:V.7.2DiscreteFourierTransformErrorsTowhatdegreedoestheDFTapproximatetheFouriertransformofthefunctionunderlyingthedata?ClearlytheDFTisonlyanapproximationsinceitprovidesonlyforanitesetoffrequencies.Buthowcorrectarethesediscretevaluesthemselves?TherearetwomaintypesofDFTerrors:aliasingand“leakage”:88 7.2.1AliasingThisisanothermanifestationofthephenomenonwhichwehavenowencounteredseveraltimes.Iftheinitialsamplesarenotsufcientlycloselyspacedtorepresenthigh-frequencycomponentspresentintheunderlyingfunction,thentheDFTval-ueswillbecorruptedbyaliasing.Asbefore,thesolutioniseithertoincreasethesamplingrate(ifpossible)ortopre-lterthesignalinordertominimiseitshigh-frequencyspectralcontent.7.2.2LeakageRecallthatthecontinuousFouriertransformofaperiodicwaveformrequirestheintegrationtobeperformedovertheinterval-PtoFPoroveranintegernumberofcyclesofthewaveform.IfweattempttocompletetheDFToveranon-integernumberofcyclesoftheinputsignal,thenwemightexpectthetransformtobecorruptedinsomeway.Thisisindeedthecase,aswillnowbeshown.Considerthecaseofaninputsignalwhichisasinusoidwithafractionalnum-berofcyclesinthedatasamples.TheDFTforthiscase(for_&Ä to_&:V)isshownbelowin7.5.0246802468freq|F[n]|Figure7.5:Leakage.WemighthaveexpectedtheDFTtogiveanoutputatjustthequantisedfrequen-89 cieseithersideofthetruefrequency.Thiscertainlydoeshappenbutwealsondnon-zerooutputsatallotherfrequencies.Thissmearingeffect,whichisknownasleakage,arisesbecauseweareeffectivelycalculatingtheFourierseriesforthewaveforminFig.7.6,whichhasmajordiscontinuities,henceotherfrequencycomponents.05101520253035404550-1-0.500.51Figure7.6:Leakage.Therepeatingwaveformhasdiscontinuities.Mostsequencesofrealdataaremuchmorecomplicatedthanthesinusoidalse-quencesthatwehavesofarconsideredandsoitwillnotbepossibletoavoidin-troducingdiscontinuitieswhenusinganitenumberofpointsfromthesequenceinordertocalculatetheDFT.ThesolutionistouseoneofthewindowfunctionswhichweencounteredinthedesignofFIRlters(e.g.theHammingorHanningwindows).Thesewindowfunctionstaperthesamplestowardszerovaluesatbothendpoints,andsothereisnodiscontinuity(orverylittle,inthecaseoftheHanningwindow)withahypotheticalnextperiod.Hencetheleakageofspectralcontentawayfromitscorrectlocationismuchreduced,asinFig7.7.0246801234567(a)02468012345(b)Figure7.7:LeakageisreducedusingaHanningwindow.90 7.3TheFastFourierTransformThetimetakentoevaluateaDFTonadigitalcomputerdependsprincipallyonthenumberofmultiplicationsinvolved,sincethesearetheslowestoperations.WiththeDFT,thisnumberisdirectlyrelatedtoV(matrixmultiplicationofavector),whereisthelengthofthetransform.Formostproblems,ischosentobeatleast256inordertogetareasonableapproximationforthespectrumofthesequenceunderconsideration–hencecomputationalspeedbecomesamajorcon-sideration.HighlyefcientcomputeralgorithmsforestimatingDiscreteFourierTrans-formshavebeendevelopedsincethemid-60's.TheseareknownasFastFourierTransform(FFT)algorithmsandtheyrelyonthefactthatthestandardDFTin-volvesalotofredundantcalculations:Re-writing _\r›&:+=LJaMOE \rD-+/bdcefJas _\r&:+=LJNMOE \rdpfJ:itiseasytorealisethatthesamevaluesofpfJ:arecalculatedmanytimesasthecomputationproceeds.Firstly,theintegerproduct_repeatsfordifferentcom-binationsofand_;secondly,pfJ:isaperiodicfunctionwithonlydistinctvalues.Forexample,consider&9™(theFFTissimplestbyfarifisanintegralpowerof2)pÅ&t-+/bdcÆ&t-+/sÃXÇ&!È&ZÉ=sayThenÉV&!ÉRq&!5Éi&É©És&ÉÃ&ÉÉu&Ê!É5Ë%&Ê!5ÉÌ&9É©ÉÅ&~Fromtheabove,itcanbeseenthat:91 ptsÅ&pEÅpÃÅ&pÅpuÅ&pVÅpvËÅ&pvqÅAlso,if_fallsoutsidetherange0-7,westillgetoneoftheabovevalues:eg.if_&tandi&rÍ^pqÃÅ&tÉqÃ&ºÉÅsŽÎÉq&tÉq7.3.1Decimation-in-timealgorithmLetusbeginbysplittingthesinglesummationoversamplesinto2summations,eachwith:Vsamples,oneforevenandtheotherforodd.SubstituteÏS&JVforevenandÏS&J‘+=Vforoddandwrite: _\r&eb+=LÐMOE\n 4ϸ\rdpVÐf:Feb+=LÐMOE ÏF\rdp8VМ�f:NotethatpVÐf:&t-+/bdce8VÐf�&9-+/bdcebÐf&rpÐfebTherefore _\r&eb+=LÐMOE\n 4ϸ\rdpÐfebFpÐ:eb+=LÐMOE ÏF\rdpÐfebie. _\r&tÑÒ _\rFpÐ:iÓ _\rThusthe-pointDFT _\rcanbeobtainedfromtwo:V-pointtransforms,oneoneveninputdata,ÑÒ _\r,andoneonoddinputdata,Ó _\r.Althoughthefre-quencyindex_rangesovervalues,only:VvaluesofÑÒ _\randÓ _\rneedtobecomputedsinceÑÔ _\randÓ _\rareperiodicin_withperiod:V.Forexample,for&9™:92 Õeveninputdata \r \rd ֌$\r\n ×\rÕoddinputdata\n ¦\rd ‰\rd 4H\r Í\r \r›&tÑÒ \rFpEÅÓ C \r ¦‘\r›&tÑÒ ¦\rFpÅÓ \r 4H\r›&tÑÒ 4\rFpVÅÓ \r ‰\r›&tÑÒ ‰\rFprqÅÓ ‰\r CŒ\r›&tÑÒ \rFptsÅÓ C \r›&tÑÒ C \rpEÅÓ C \r 4H\r›&tÑÒ ¦\rFpÃÅÓ \r›&tÑÒ \rpÅÓ \r ×\r›&tÑÒ 4\rFpuÅÓ \r›&tÑÒ \rpVÅÓ \r 4ÍH\r›&tÑÒ ‰\rFpvËÅÓ ‰\r›&tÑÒ ‰\rprqÅÓ ‰\rThisisshowngraphicallyontheowgraphofFig7.8:N/2pointDFTN/2pointDFTf[0]f[2]f[3]f[4]f[6]f[1]f[5]f[7]H[0]H[3]G[3]G[0]F[0]F[7]Figure7.8:FFTowgraph1.Assumingthanisapowerof,wecanrepeattheaboveprocessonthetwo:V-pointtransforms,breakingthemdownto:s-pointtransforms,etc,untilwecomedownto-pointtransforms.For&™,onlyonefurtherstageisneeded(i.e.thereareØstages,where&ZHÙ),asshownbelowinFig7.9.ThustheFFTiscomputedbydividingup,ordecimating,thesamplesequence \rintosub-sequencesuntilonly-pointDFT'sremain.Sinceitistheinput,ortime,sampleswhicharedividedup,thisalgorithmisknownasthedecimation-in-time(DIT)algorithm.(Anequivalentalgorithmexistsforwhichtheoutput,orfrequency,pointsaresub-divided–thedecimation-in-frequencyalgorithm.)ThebasiccomputationattheheartoftheFFTisknownasthebutterybecauseofitscriss-crossappearance.FortheDITFFTalgorithm,thebutterycomputa-tionisoftheformofFig7.1093 N/4 pointDFTN/4 pointDFTN/4 pointDFTN/4 pointDFTf[0]f[4]f[2]f[6]f[1]f[5]f[3]f[7]F[0]F[7]Figure7.9:FFTowgraph2.ÚÛÚp*Ü:ÛÚFp*Ü:ÛÝÝÞÞÞÞÞÞÞÞÞÞÞÞÞÞÞÞÞÞÞRßàààààààààààààààààààRápÜ:FpÜ:Figure7.10:ButteryoperationinFFT.whereÚandÛarecomplexnumbers.Thusabutterycomputationrequiresonecomplexmultiplicationand2complexadditions.Notealso,thattheinputsamplesare“bit-reversed”(seetablebelow)becauseateachstageofdecimationthesequenceinputsamplesisseparatedintoeven-andodd-indexedsamples.(NB:thebit-reversalalgorithmonlyappliesifisanintegralpowerof).94 Index[BinaryBit-reversedBit-reversedrepresentationBinaryindex00000000100110042010010230111106410000115101101561100113711111177.3.2ComputationalspeedofFFTTheDFTrequiresVcomplexmultiplications.AteachstageoftheFFT(i.e.eachhalving):Vcomplexmultiplicationsarerequiredtocombinetheresultsofthepreviousstage.SincethereareBâBUãVstages,thenumberofcomplexmul-tiplicationsrequiredtoevaluatean-pointDFTwiththeFFTisapproximately|‹âBUãV(approximatelybecausemultiplicationsbyfactorssuchaspE:,peb:,peä:andpµåeä:arereallyjustcomplexadditionsandsubtractions).V(DFT):Vâ,UãV(FFT)saving321,0248092æ25665,5361,02498æ1,0241,048,5765,12099.5æ7.3.3PracticalconsiderationsIfisnotapowerof,thereare2strategiesavailabletocompletean-pointFFT.1.takeadvantageofsuchfactorsaspossesses.Forexample,ifisdivisi-bleby‰(e.g.&ČR™),thenaldecimationstagewouldincludea‰-pointtransform.95 2.packthedatawithzeroes;e.g.include16zeroeswiththe48datapoints(for&vŒR™)andcomputea×$Œ-pointFFT.(However,youshouldagainbewaryofabrupttransitionsbetweenthetrailing(orleading)edgeofthedataandthefollowing(orpreceding)zeroes;abetterapproachmightbetopackthedatawithmorerealistic“dummyvalues”).96