How Is a Moving Average Filter Different from an FIR Filter? | Moving average filter

The moving average filter is a special case of the regular FIR filter. Both filters have finite impulse responses. The moving average filter uses a sequence ...SkiptocontentDocumentationHelpCenterDocumentationSearchSupportSupportMathWorksSearchMathWorks.comMathWorksSupportCloseMobileSearchOpenMobileSearchOff-CanvasNavigationMenuToggleDocumentationHomeDSPSystemToolboxStatisticsandLinearAlgebraMeasurementsandStatisticsDSPSystemToolboxStatisticsandLinearAlgebraHowIsaMovingAverageFilterDifferentfromanFIRFilter?OnthispageFrequencyResponseofMovingAverageFilterandFIRFilterRelatedTopicsDocumentationAllExamplesFunctionsBlocksAppsVideosAnswersTrialSoftwareTrialSoftwareProductUpdatesProductUpdatesResourcesDocumentationAllExamplesFunctionsBlocksAppsVideosAnswersMainContentHowIsaMovingAverageFilterDifferentfromanFIRFilter?ThemovingaveragefilterisaspecialcaseoftheregularFIRfilter.Bothfiltershavefiniteimpulseresponses.Themovingaveragefilterusesasequenceofscaled1sascoefficients,whiletheFIRfiltercoefficientsaredesignedbasedonthefilterspecifications.Theyarenotusuallyasequenceof1s.Themovingaverageofstreamingdataiscomputedwithafiniteslidingwindow:movAvg=x[n]+x[n−1]+...+x[n−N]N+1N+1isthelengthofthefilter.ThisalgorithmisaspecialcaseoftheregularFIRfilterwiththecoefficientsvector,[b0,b1,...,bN].FIROutput=b0x[n]+b1x[n−1]+...+bNx[n−N]Tocomputetheoutput,theregularFIRfiltermultiplieseachdatasamplewithacoefficientfromthe[b0,b1,...,bN]vectorandaddstheresult.Themovingaveragefilterdoesnotuseanymultipliers.Thealgorithmaddsallthedatasamplesandmultipliestheresultwith1/filterLength.FrequencyResponseofMovingAverageFilterandFIRFilterOpenLiveScriptComparethefrequencyresponseofthemovingaveragefilterwiththatoftheregularFIRfilter.SetthecoefficientsoftheregularFIRfilterasasequenceofscaled1's.Thescalingfactoris1/|filterLength|.Createadsp.FIRFilterSystemobject™andsetitscoefficientsto1/40.Tocomputethemovingaverage,createadsp.MovingAverageSystemobjectwithaslidingwindowoflength40.Bothfiltershavethesamecoefficient


常見投資理財問答


延伸文章資訊