How Averaging Becomes a Low-Pass Filter

We already know how to store the previous sample, multiply values, and add them. Put those three operations together and we can build a real filter.

The whole filter: take the current sample and the previous sample, halve each one, then add them.

1. The simplest filter we can build

y[n] = 0.5x[n] + 0.5x[n−1]
CURRENT SAMPLE × 0.5    +    PREVIOUS SAMPLE × 0.5    =    OUTPUT
+0.000
×0.5 +
+0.000
×0.5 =
+0.000

These are live sample values. As the input frequency changes, watch how similar — or different — adjacent samples become.

2. Drag from low frequency to high frequency

Fixed for this demonstration
Low frequency: adjacent samples are similar, so averaging changes the waveform only a little.

3. The extreme case: Nyquist

At the highest representable sine frequency, neighbouring samples can alternate approximately:

+1, −1, +1, −1, +1, −1 …

Now average adjacent samples:

(+1 + −1) ÷ 2 = 0     (−1 + +1) ÷ 2 = 0
The output disappears. Our tiny two-sample averaging machine naturally rejects the fastest possible alternation while leaving slowly changing signals relatively intact. That is low-pass behaviour.

4. Same behaviour — now shown as a frequency response

The dot shows the frequency selected above. The response graph is not a separate phenomenon — it is another way of describing what you are already seeing in the samples.

Waveform view: adjacent samples increasingly cancel as frequency rises.   Frequency-domain view: gain falls toward zero as frequency approaches Nyquist.

5. The DSP block diagram

x[n] ─────────────→ × 0.5 ──┐
  └→ z−1 → × 0.5 ──┴→ + → y[n]
z−1
Give us the previous sample.
× 0.5
Scale each contribution.
+
Add them to produce the output sample.
You've built a digital low-pass filter using nothing except STORE + MULTIPLY + ADD.

6. Hear the attenuation

Start the sine and sweep the frequency upward. With the filter on, the signal becomes progressively quieter as it approaches Nyquist. Bypass it and the source level remains constant.

7. What just happened?

SLOW CHANGE → ADJACENT SAMPLES SIMILAR → REINFORCE
FAST CHANGE → ADJACENT SAMPLES DIFFERENT / OPPOSE → CANCEL

This is the simple visual bridge between sample-by-sample arithmetic and frequency-selective filtering.

Next: extend the same idea with more stored samples, different coefficients, and eventually feedback. That's how simple averaging grows into practical FIR and IIR filters.