ยท Hankyu Kim ยท Filter  ยท 2 min read

Average Filter

The average filter is the simplest form of recursive estimation. Despite its simplicity, it provides strong noise reduction and forms the foundation of more advanced filters such as the Kalman filter.

The average filter is the simplest form of recursive estimation. Despite its simplicity, it provides strong noise reduction and forms the foundation of more advanced filters such as the Kalman filter.

Introduction

This post introduces the Average Filter, one of the simplest yet most powerful tools in signal processing and estimation.

Although the idea of taking an average is trivial, expressing it as a recursive filter reveals a structure that appears throughout modern estimation theory, including the Kalman filter.


One-Sentence Definition

  • Average Filter

    An average filter updates an estimate by combining the previous average with the current measurement.


Basic Definition of an Average

Given NN samples, the arithmetic mean is defined as

Average=1Nโˆ‘i=1Nxi\text{Average} = \frac{1}{N} \sum_{i=1}^{N} x_i

For example,

[1,2,3,4,5]โ€…โ€Šโ†’โ€…โ€Š1+2+3+4+55=3[1,2,3,4,5] \;\rightarrow\; \frac{1+2+3+4+5}{5} = 3

This is the most familiar form of averaging.


Recursive Interpretation

Assume that the average of the first kโˆ’1k-1 samples is already known:

xห‰kโˆ’1=1kโˆ’1โˆ‘i=1kโˆ’1xi\bar{x}_{k-1} = \frac{1}{k-1} \sum_{i=1}^{k-1} x_i

When a new sample xkx_k arrives, the updated average can be written as

xห‰k=kโˆ’1kโ€‰xห‰kโˆ’1+1kโ€‰xk\bar{x}_k = \frac{k-1}{k}\,\bar{x}_{k-1} + \frac{1}{k}\,x_k

This can be rewritten in a generic form:

xห‰k=(1โˆ’a)โ€‰xห‰kโˆ’1+aโ€‰xk\bar{x}_k = (1-a)\,\bar{x}_{k-1} + a\,x_k

where

a=1ka = \frac{1}{k}

Key Insight

  • The average is updated incrementally
  • Past information is not discarded
  • The structure is inherently recursive

This recursive form is far more useful in real-time systems than recomputing the full sum at every step.


Example: Noisy Voltage Measurement

Consider a car battery with a true voltage of approximately 14V.

Due to sensor noise, the measured voltage fluctuates between 10V and 18V.

Assume:

  • Sampling interval: 1 second
  • Total duration: 100 seconds

Applying an average filter:

  • Early estimates fluctuate significantly
  • As more samples accumulate, the estimate stabilizes
  • The filtered voltage converges toward 14V

Despite its simplicity, the average filter effectively suppresses noise.

Super wide


General Average Filter Equation

The average filter can be expressed as

xห‰k=(1โˆ’a)โ€‰xห‰kโˆ’1+aโ€‰xk\bar{x}_k = (1-a)\,\bar{x}_{k-1} + a\,x_k

where:

  • xห‰k\bar{x}_k is the current estimate
  • xห‰kโˆ’1\bar{x}_{k-1} is the previous estimate
  • xkx_k is the current measurement
  • aa is the weighting factor

This structure directly appears in:

  • Exponential moving averages
  • Low-pass filters
  • Kalman filters

Why This Matters

  • The average filter is the simplest recursive estimator
  • All practical filters rely on recursion
  • Understanding this structure is essential before studying Kalman filters

If the recursive nature of the average filter is not clear, advanced estimation methods will remain opaque.


Summary

  • The average filter is simple but fundamental
  • It combines past estimates with new measurements
  • It provides effective noise reduction
  • It forms the conceptual foundation of modern estimation theory

Simple mathematics, powerful implications.

Back to Blog
Kalman Filter (Part 1)

Kalman Filter (Part 1)

The Kalman filter is an optimal recursive estimator for linear systems, combining system models and noisy measurements through simple matrix operations.

Kalman Filter (Part 2)

Kalman Filter (Part 2)

This post explains the physical meaning of the error covariance P and the Kalman gain K, showing how the Kalman filter adaptively balances model prediction and sensor measurements.

Low Pass Filter (LPF)

Low Pass Filter (LPF)

A low pass filter reduces noise while emphasizing recent measurements, overcoming the limitations of uniform averaging in moving average filters.

Moving Average Filter

Moving Average Filter

The moving average filter reduces noise while preserving the dynamic behavior of time-varying signals by averaging only a recent window of measurements.