TransWikia.com

Moving Average Filter's Magnitude Response

Signal Processing Asked by varungupta on November 5, 2021

I am working on filtering of data using the Moving average filter in MATLAB.

My data is recorded temperature values on the Y-axis and Time(in seconds) on the X-axis

(I’m getting the magnitude response curve of the Moving average filter as attached)

enter image description here

The shape of the curve seems fair for the moving average filter, according to the theory but,

I want to ask, why am I getting all the magnitude value for MA filter positive? (is this correct?)

Implementing other filters like Butterworth etc. on the same data gives the magnitude values to be negative (image attached)

enter image description here

Here is my MATLAB Code for MA (if it helps)

%T.Temp is table column containing Temperature values in double format.

MovAvg = dsp.MovingAverage(5)

movAvgOut = MovAvg(T.Temp)

fvtool(movAvgOut)

%Gives output the first image I attached

Any help is appreciated.
Thank you.

Ps – DSP is not my field. This work is part of a bigger project i’m involved in, and need some help. Please bear with me if I sound irrational.

One Answer

A true moving average would have unity gain coefficients but also be divided by the total number of samples (as per the definition of average). This is trivial since it is just a scaling factor, but if the OP divides the output of the moving average by the total number of samples in the filter then the magnitude response will be normalized to 0 on a dB scale, with all other magnitude values given in negative dB.

Answered by Dan Boschen on November 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP