14
$\begingroup$

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?

$\endgroup$
  • 9
    $\begingroup$ 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). $\endgroup$ – Dilip Sarwate Dec 22 '11 at 15:56
  • $\begingroup$ 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? $\endgroup$ – GorillaApe Dec 22 '11 at 16:01
  • $\begingroup$ You put the gain into the short-term averager; you take it out! $\endgroup$ – Dilip Sarwate Dec 22 '11 at 16:04
  • $\begingroup$ 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 $\endgroup$ – JSmith Mar 16 '18 at 3:25
16
$\begingroup$

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

enter image description here

As you can see, this clearly is a low-pass filter. You can easily calculate the cut-off frequency from here on.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.