Low-Pass Filters

Low-pass filters are a natural extension of averaging filters. If you are unfamiliar with averaging filters, it is worth reviewing them first, as the motivation here builds directly on those ideas.

Motivation

Sensor measurements are rarely clean. In practice, noise tends to occupy the high-frequency portion of a signal’s spectrum, while the true underlying state evolves slowly at low frequencies. A low-pass filter is designed precisely for this situation: it passes low-frequency content while attenuating high-frequency components, hence the name.

The moving average filter is one simple example, but it assigns equal weight to all past measurements. This is inefficient: a measurement from ten samples ago should carry less information about the current state than a measurement from one sample ago. The low-pass filter addresses this by weighting the most recent measurement more heavily.

Discrete-Time Update Equation

The first-order discrete-time low-pass filter is:

\[\hat{x}_k = \alpha \cdot \hat{x}_{k-1} + (1 - \alpha) \cdot z_k, \qquad 0 < \alpha < 1\]

where \(\hat{x}_k\) is the filtered estimate at time step \(k\), \(z_k\) is the raw measurement, and \(\alpha\) is the smoothing factor.

The equation is a convex combination of the previous estimate and the new measurement. Expanding it recursively reveals that the filter is an infinite impulse response (IIR) filter whose weights decay geometrically:

\[\hat{x}_k = (1 - \alpha) \sum_{i=0}^{k} \alpha^i \cdot z_{k-i}\]

Each past measurement contributes, but with exponentially diminishing influence.

Note on notation. Some texts write the equation as \(\hat{x}_k = \alpha \cdot z_k + (1-\alpha) \cdot \hat{x}_{k-1}\), which is identical — just with \(\alpha\) and \((1-\alpha)\) swapped in meaning. Always verify which convention a reference is using before implementing.

Role of the Smoothing Factor α

The scalar \(\alpha\) governs the trade-off between noise rejection and tracking speed:

  • \(\alpha \to 1\): the filter “trusts” its own previous estimate almost entirely, resulting in heavy smoothing but significant lag when the true signal changes.
  • \(\alpha \to 0\): the filter adopts each new measurement almost immediately, reducing lag but admitting more noise.

Neither extreme is desirable in practice. The appropriate value depends on the noise characteristics of the sensor and the dynamics of the system being observed.

Continuous-Time Transfer Function

In the Laplace domain, the equivalent first-order low-pass filter has the transfer function:

\[\frac{Y(s)}{X(s)} = \frac{1}{\tau s + 1}\]

where \(\tau\) is the time constant. The cutoff frequency is \(f_c = \frac{1}{2\pi\tau}\) Hz. Signals at frequencies well below \(f_c\) pass with near-unity gain; signals well above \(f_c\) are attenuated at \(-20\,\text{dB/dec}\).

The discrete-time smoothing factor relates to the continuous-time cutoff frequency and sample period \(T_s\) as:

\[\alpha = \frac{\tau}{\tau + T_s} = \frac{1}{1 + 2\pi f_c T_s}\]

This provides a principled way to choose \(\alpha\) from physical specifications rather than by trial and error.

Interactive Demo

The plot below simulates a noisy sinusoidal signal and applies the first-order low-pass filter. Adjust \(\alpha\) to observe how the smoothing factor affects the filtered output.

Blue — noisy measurement  |  Orange — filtered estimate

Choosing α in Practice

In the absence of a formal system model, a reasonable approach is:

  1. Record a representative signal segment with the sensor at rest (pure noise).
  2. Compute the noise standard deviation \(\sigma_n\).
  3. Choose \(f_c\) to be roughly one decade below the lowest frequency of interest in the true signal.
  4. Convert to \(\alpha\) using the relation above with the known sample period \(T_s\).

When the dynamics are well-characterized, the Kalman filter provides an optimal, time-varying alternative that adapts its weighting based on the estimated process and measurement noise covariances.

See Also

References

  1. Kim, P. (2011). Kalman Filter for Beginners: with MATLAB Examples. CreateSpace Independent Publishing Platform.
  2. Brown, R. G., & Hwang, P. Y. C. (1997). Introduction to Random Signals and Applied Kalman Filtering (3rd ed.). Wiley.