# Magnitude and phase response and cut-off frequency of a moving average filter

The frequency response of a typical moving average filter of length $$N$$ is given by $$H(\omega)=\frac{1}{N}\frac{\sin(\omega N/2) e^{-j \omega ((N-1)/2)}}{\sin(\omega/2)}$$. Firstly, isn't the cut off frequency of an average filter equal to 0 Hz (an average filter passes the dc value and filters the rest out)? By that notion i will get the value of $$H(0)=1/N$$ (using L hospitals rule). But i don't think that's right. What am i missing here? Care to explain.

The cut-off frequency is whatever you define it to be. One standard definition would be the frequency $$\omega_c$$ at which the attenuation is $$3$$dB, i.e., $$\big|H(\omega_c)\big|=\frac{1}{\sqrt{2}}$$.

As far as we know there is no analytical formula for the exact computation of the $$3$$-dB cut-off frequency of a moving average filter. More than you ever might want to know about approximately computing the $$3$$-dB cut-off frequency can be found in the answers to this question.

Note that you made a mistake evaluating $$H(0)$$. The moving average filter satisfies $$H(0)=1$$ (and not $$H(0)=1/N$$). The real-valued amplitude function of a length $$N$$ moving average filter is

$$A(\omega)=\frac{\sin\left(\frac{N\omega}{2}\right)}{N\sin\left(\frac{\omega}{2}\right)}\tag{1}$$

Using $$\sin(x)\approx x$$ for $$x\approx 0$$ gives

$$A(\omega)\Big|_{\omega\approx 0}\approx\frac{\frac{N\omega}{2}}{N\frac{\omega}{2}}=1\tag{2}$$

A more straightforward way of seeing this is to note that

$$H(0)=\sum_nh[n]\tag{3}$$

where $$h[n]$$ are the filter coefficients. Since for a moving average filter we have $$N$$ filter coefficients with values $$1/N$$, the sum in $$(3)$$ equals $$1$$.