Advanced Filtering: Unscented Kalman vs Standard Kalman
The Kalman filter is a recursive algorithm that combines noisy measurements with a system model's prediction to give the best estimate of states that are noisy or cannot be measured directly (position, velocity, weight trend and so on). The Extended (EKF) and Unscented (UKF) Kalman filters carry the same idea over to non-linear systems.
How does the standard Kalman filter work?
Two stages repeat at every step:
- Predict: the model projects the previous state forward; the uncertainty (P) grows by the process noise (Q).
- Update: a new measurement arrives; the difference between prediction and measurement is weighted by the Kalman gain (K) and added to the state.
The standard Kalman filter gives the optimal estimate when the model is linear and the noises are Gaussian. "Linear" here does not mean moving at constant speed; it means the state transition and measurement relationship can be written as matrices.
Worked example (one-dimensional)
In a weighing system the previous estimate is 100.0 kg with uncertainty P = 4 kg²; a new measurement reads 102.0 kg with measurement noise variance R = 1 kg²:
K = P / (P + R) = 4 / 5 = 0.8New estimate = 100.0 + 0.8 × (102.0 − 100.0) = 101.6 kgNew uncertainty = (1 − K) × P = 0.8 kg²
Because the measurement is more trustworthy than the prediction (R < P), the result sits close to the measurement. Increase R and the filter trusts measurements less, giving a smoother but slower response.
EKF vs UKF
| EKF | UKF | |
|---|---|---|
| Handling non-linearity | Linearizes the model at the operating point with Jacobian (derivative) matrices | Propagates 2n + 1 sigma points through the model for an n-dimensional state |
| Needs derivatives | Yes | No |
| Under strong non-linearity | Linearization error can grow | Often more accurate mean and covariance |
| Computational load | Same order | Same order, more model evaluations as n grows |
For example, with a 3-state system the UKF uses 7 sigma points per step. The UKF is often more stable on strongly non-linear systems, but it is not better in every case. For multi-modal or non-Gaussian distributions, methods such as particle filters may be needed.
Common mistakes
- Picking Q and R by trial and error instead of basing them on measured noise.
- Using a Kalman filter on steady signals where a simple moving average would do.
- Not checking numerical stability (keeping the covariance positive definite) on an embedded processor.
Where is it used?
Robotics and position estimation, sensor fusion (IMU + GNSS), dynamic weighing and condition tracking for predictive maintenance are typical applications. Running these algorithms on a microcontroller is a matter of embedded systems design. For Amazeng's model development work on sensor data, see Industrial AI; for on-device inference, see Predictive Maintenance with NPU MCUs.
Related Terms
- What are Digital Filters? (Moving Average, Butterworth, Kalman)What digital filters are: moving average, exponential, median, Butterworth and Kalman, with formulas, delay and noise maths, and how to choose one.
- What is Signal Noise and How to Prevent It?What signal noise is: EMI sources, SNR and noise-free resolution maths, shielding and differential inputs, filtering and common wiring mistakes.
- What are Embedded Systems?What is an embedded system? MCU vs MPU, bare-metal vs RTOS vs embedded Linux, a real-time timing budget example and the role in industrial devices.
- What is Industrial AI?How Industrial AI differs from general-purpose AI: field measurement data, validation on unseen sites and an application that runs every day.