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
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.
Lecture7-TheDiscreteFourierTransform7.1TheDFTTheDiscreteFourierTransform(DFT)istheequivalentofthecontinuousFourierTransformforsignalsknownonlyat instantsseparatedbysampletimes(i.e.anitesequenceofdata).Letbethecontinuoussignalwhichisthesourceofthedata.Let samplesbedenoted\n \r \r \r \r\n \r.TheFourierTransformoftheoriginalsignal,,wouldbe "!$#%'&(*)+),.-+/102,3Wecouldregardeachsample \rasanimpulsehavingarea 45\r.Then,sincetheintegrandexistsonlyatthesamplepoints: 6!$#%7&(98;:000;+=@-+/A02B3& C\rD-+/EGF \rD-+/10H?IFF \rD-+/10J?IF H-+/A08;:000;+=ie. "!$#%K&:+=LJNMOE \rD-+/10J?Wecouldinprincipleevaluatethisforany#,butwithonly datapointstostartwith,only naloutputswillbesignicant.YoumayrememberthatthecontinuousFouriertransformcouldbeevaluatedoveraniteinterval(usuallythefundamentalperiod@)ratherthanfromQPto82 FPifthewaveformwasperiodic.Similarly,sincethereareonlyanitenumberofinputdatapoints,theDFTtreatsthedataasifitwereperiodic(i.e. to HisthesameasRto SH.)HencethesequenceshownbelowinFig.7.1(a)isconsideredtobeoneperiodoftheperiodicsequenceinplot(b).0123456789101100.20.40.60.81(a)05101520253000.20.40.60.81(b)Figure7.1:(a)Sequenceof &TUsamples.(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_&Zih SH83 _\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.&~.DFTexampleLetthecontinuoussignalbeK&dcF $UH\@1HzF O\2Hz012345678910-4-20246810Figure7.2:ExamplesignalforDFT.Letussampleat4timespersecond(ie.=4Hz)from&rto&qs.Thevaluesofthediscretesamplesaregivenby: \r&tF$5WV@F$\{byputting&r&Js84 i.e.\n \r&t, \r&, \r&t, \r&Z, &ZRTherefore _\r&qLE \rd-+/cbfJ&qLJNMOE \rA!fJjkkl C\r \r \r \rmnno&jkkl!!!!mnnojkkl C\r \r \r \rmnno&jkkl$!RH!RmnnoThemagnitudeoftheDFTcoefcientsisshownbelowinFig.7.3.012305101520f (Hz)|F[n]|Figure7.3:DFToffourpointsequence.InverseDiscreteFourierTransformTheinversetransformof _\r&:+=LJaMOE \rd-+/bdcegfJ85 is\n 4\r& :+=LfMOE _\rD-U/bdcefJi.e.theinversematrixis:timesthecomplexconjugateoftheoriginal(symmet-ric)matrix.Notethatthe _\rcoefcientsarecomplex.Wecanassumethatthe\n 4\rvaluesarereal(thisisthesimplestcase;therearesituations(e.g.radar)inwhichtwoinputs,ateach,aretreatedasacomplexpair,sincetheyaretheoutputsfromoandodemodulators).Intheprocessoftakingtheinversetransformtheterms _\rand _\r(re-memberthatthespectrumissymmetricalabout:V)combinetoproducefre-quencycomponents,onlyoneofwhichisconsideredtobevalid(theoneatthelowerofthetwofrequencies,_*]VXW?Hzwhere_ :V;thehigherfrequencycomponentisatanaliasingfrequency(_¡: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&-+/VXWJ1forall-/$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\Yo(asexpected)3. \r&ºH_&:Vnoother S_componenthere)andthisimpliesacomponentV \r& \rD-/bdce¼»VJ& 4H\rd-/WJ&\{(asexpected)since¨¯D°\{i&tforall87 01230123456f (Hz)|F[n]|sqrt(2)3/sqrt(2)Figure7.4:DFToffourpointsignal.Thus,theconventionalwayofdisplayingaspectrumisnotasshowninFig.7.3butasshowninFig.7.4(obviously,theinformationcontentisthesame):Intypicalapplications, ismuchgreaterthan;forexample,for &½UR, _\rhasUcomponents,but^URarethecomplexconjugatesof^$,leaving¾¿EÀVsasthed.c.component,VVs{Á¾¿ÁÂVtoVVsGÁ¾¿ÃÁÂVascompletea.c.com-ponentsandVs¾¿ÃVÀÂVasthecosine-onlycomponentatthehighestdistinguishablefrequency_&:V.MostcomputerprogrammesevaluateÁ¾¿fÀÁ:(orÁ¾¿fÀÁb:forthepowerspectralden-sity)whichgivesthecorrectshapeforthespectrum,exceptforthevaluesat_&Zand:V.7.2DiscreteFourierTransformErrorsTowhatdegreedoestheDFTapproximatetheFouriertransformofthefunctionunderlyingthedata?ClearlytheDFTisonlyanapproximationsinceitprovidesonlyforanitesetoffrequencies.Buthowcorrectarethesediscretevaluesthemselves?TherearetwomaintypesofDFTerrors:aliasingandleakage:88 7.2.1AliasingThisisanothermanifestationofthephenomenonwhichwehavenowencounteredseveraltimes.Iftheinitialsamplesarenotsufcientlycloselyspacedtorepresenthigh-frequencycomponentspresentintheunderlyingfunction,thentheDFTval-ueswillbecorruptedbyaliasing.Asbefore,thesolutioniseithertoincreasethesamplingrate(ifpossible)ortopre-lterthesignalinordertominimiseitshigh-frequencyspectralcontent.7.2.2LeakageRecallthatthecontinuousFouriertransformofaperiodicwaveformrequirestheintegrationtobeperformedovertheinterval-PtoFPoroveranintegernumberofcyclesofthewaveform.IfweattempttocompletetheDFToveranon-integernumberofcyclesoftheinputsignal,thenwemightexpectthetransformtobecorruptedinsomeway.Thisisindeedthecase,aswillnowbeshown.Considerthecaseofaninputsignalwhichisasinusoidwithafractionalnum-berofcyclesinthe datasamples.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,thisnumberisdirectlyrelatedto V(matrixmultiplicationofavector),where isthelengthofthetransform.Formostproblems, ischosentobeatleast256inordertogetareasonableapproximationforthespectrumofthesequenceunderconsiderationhencecomputationalspeedbecomesamajorcon-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:isaperiodicfunctionwithonly distinctvalues.Forexample,consider &9(theFFTissimplestbyfarif isanintegralpowerof2)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-timealgorithmLetusbeginbysplittingthesinglesummationover