# Moving average of a signal

Problem is to find 1 second moving average of a signal having sample time as Ts.

To solve this, it is suggested to pass the signal through a Butterworth low pass filter having the following specifications:

Cutoff frequency = $$\cfrac{1}{2\pi\times0.5} \texttt{Hz}$$

Can you please suggest how one second moving average is equivalent to the Butterworth low pass filter with the above cutoff frequency

Can you please suggest how one second moving average is equivalent to the Butterworth low pass filter with the above cutoff frequency

It's not. Full stop!

It is, however, also a low-pass filter, and thus has an averaging effect. However, if you're asked to design a moving average, you're not asked to design a Butterworth filter.

Cutoff frequency $$= 1/(2\pi\cdot0.5)$$ Hz

What they do here is say "here, look, a unit-length moving average filter has a (frequency) amplitude response, which has a zero at $$f=1/\pi$$. We just arbitrarily declare the Butteworth filter with a cutoff at that point to be equivalent!"

But that's, frankly speaking, nonsense. The cutoff frequency for a Butterworth filter is the point its amplitude response drops below -3 dB, not the point where it reaches 0, or after which it increases again.

So, I can't really see any case where I'd want to implement a moving average filter as a Butterworth filter, especially not for a sampled signal, where building a Butterworth filter is hard, but a moving average is very easy.

So, whoever recommended that had some other constraints in mind that they're not telling you here. It is not generally suggested to do what you are being suggested to do.

• Got your point, but my doubt here is; why specifically 1/pi, why not 2/pi or 3/pi, on what basis is time constant selected as 0.5
– ShiS
Dec 13, 2023 at 17:48
• I addressed that in my answer! It's where the sinc spectral shape of the moving average has a zero, but it makes no sense to use it as cutoff frequency. I'm sorry that I can't make the recommendation you've been given make any more sense: it's just not a very good or useful recommendation. Dec 13, 2023 at 17:53