Understand Moving Average Filter with Python & Matlab | Moving average filter

Understand Moving Average Filter with Python & Matlab · 1) It takes. L input points, computes the average of those. L · 2) Due to the computation ...SkiptocontentThemovingaveragefilterisasimpleLowPassFIR(FiniteImpulseResponse)filtercommonlyusedforsmoothinganarrayofsampleddata/signal.Ittakessamplesofinputatatimeandtakestheaverageofthose-samplesandproducesasingleoutputpoint.ItisaverysimpleLPF(LowPassFilter)structurethatcomeshandyforscientistsandengineerstofilterunwantednoisycomponentfromtheintendeddata.Asthefilterlengthincreases(theparameter)thesmoothnessoftheoutputincreases,whereasthesharptransitionsinthedataaremadeincreasinglyblunt.Thisimpliesthatthisfilterhasexcellenttimedomainresponsebutapoorfrequencyresponse.TheMAfilterperformsthreeimportantfunctions:1)Ittakesinputpoints,computestheaverageofthose-pointsandproducesasingleoutputpoint2)Duetothecomputation/calculationsinvolved,thefilterintroducesadefiniteamountofdelay3)ThefilteractsasaLowPassFilter(withpoorfrequencydomainresponseandagoodtimedomainresponse).ImplementationThedifferenceequationfora-pointdiscrete-timemovingaveragefilterwithinputrepresentedbythevectorandtheaveragedoutputvector,is Forexample,a-pointMovingAverageFIRfiltertakesthecurrentandpreviousfoursamplesofinputandcalculatestheaverage.ThisoperationisrepresentedasshownintheFigure1withthefollowingdifferenceequationfortheinputoutputrelationshipindiscrete-time.Figure1:Discrete-time5-pointMovingAverageFIRfilterTheunitdelayshowninFigure1isrealizedbyeitherofthetwooptions:RepresentingtheinputsamplesasanarrayinthecomputermemoryandprocessingthemUsingD-Flipflopshiftregistersfordigitalhardwareimplementation.Ifeachdiscretevalueoftheinputisrepresentedasa-bitsignallinefromADC(analogtodigitalconverter),thenwewouldrequire4setsof12-Flipflopstoimplementthe-pointmovingaveragefiltershowninFigure1.Z-TransformandTransferfunctionInsignalprocessing,delayingasignalbysampleperiod(unitdelay)isequivalenttomultiplyingtheZ-transformby.Byapplyingthisidea,wecanfindtheZ-transformofthe-po


常見投資理財問答


延伸文章資訊