# Why is $y(n) = x(n) + x(n-1)$ a low pass filter?

I have found that this is a simple, but bad lowpass filter:

$$y(n) = x(n) + x(n-1)$$

However, I can't understand why it is a lowpass filter. What is its cutoff frequency?

• Your filter is what could be called a "short-term averager with gain": $(x(n) + x(n-1))/2$ is the average of the current and past samples, twice that gives you the short-term average with a gain of $2$. A longer-term (but still short-term compared to infinity!) average would be the average of the current and past $k$ sample values, $k > 1$. It is a low-pass filter since it smooths out short-term variations. In particular, the highest possible frequency signal $(\cdots, -1, +1, -1, +1, -1, +1, \cdots)$ is nulled by the short-term averager (with or without gain). – Dilip Sarwate Dec 22 '11 at 15:56
• thanks for helping it is clearer to me now. But that filter with low frequency (1,1,1,1,1,1) it going to have too much amplitude.. isnt this a problem? – GorillaApe Dec 22 '11 at 16:01
• You put the gain into the short-term averager; you take it out! – Dilip Sarwate Dec 22 '11 at 16:04
• I get a highpass filter with (x(n)-x(n−1)) but I only have a upper gain with x(n)+x(n−1) any clue why I have this result? thx in advance – JSmith Mar 16 '18 at 3:25

What you have here is the equivalent of a moving-average filter. Specifically, it is a filter of order 1, whose impuse response is

$$h(n)=\delta(n)+\delta(n-1)$$

Taking its $Z$-transform, we get

$$H(z)=1+z^{-1}=\frac{z+1}{z}$$

There is a pole at $z=0$ and a zero at $z=-1$. Plotting the magnitude of the frequency response $H(\omega)\triangleq H(e^{-\imath \omega})=2\vert \cos(\omega/2)\vert$, you get the following curve As you can see, this clearly is a low-pass filter. You can easily calculate the cut-off frequency from here on.

• For computation of the half-power point (as opposed to the first null point) as above, see here – Dilip Sarwate Dec 23 '11 at 18:42