Tutorial Series · Part 7 of 27
Combining Measurements: The Simplest Sensor Fusion Demo
Derive weighted averaging as a first step toward Kalman filtering.
Navigation from First Principles
This article is part of an ordered course. Use the previous and next links to stay in sequence.
Sensor fusion does not mean “average everything”. It means combining information according to how much each source should be trusted. This post introduces the idea with two sensors measuring the same one-dimensional position. It is a simple doorway into Kalman filtering.
Welch and Bishop describe the Kalman filter as a recursive computational solution related to least-squares estimation and state estimation under uncertainty.1 Before using matrices and prediction models, we can teach the core intuition with weighted averages.
The problem
Two sensors disagree:
Which one is right? The answer depends on uncertainty. A high-quality sensor with should influence the fused result more than a poor sensor with .
The model
For two independent unbiased scalar measurements:
The variance-weighted fused estimate is:
The fused variance is:
The smaller the variance, the larger the weight.
Interactive demo: weighted fusion playground
The number line below shows two simulated measurements and the fused estimate they produce. You can change each sensor’s uncertainty and bias, generate new samples, and compare the variance-weighted result with the simple arithmetic mean.
Weighted Fusion Playground
Lower variance means higher weight. The fused estimate moves toward the more trusted sensor, even when that sensor is biased.
Blue is sensor A, orange is sensor B, and green is the fused estimate with its one-sigma interval.
What to watch
- When Sensor A has lower uncertainty, the fused estimate moves toward A.
- When both sensors have equal uncertainty, the fused estimate sits near the arithmetic mean.
- Adding bias shows that a confident but miscalibrated sensor can pull the fused result in the wrong direction.
- The true position can stay hidden until you want to reveal whether the fused answer is actually better.
Try this
Set and . Generate measurements. The fused result should sit close to Sensor A. Then deliberately bias Sensor A by . The fused estimate becomes confidently wrong, which introduces the importance of calibration and outlier detection.
Where this breaks
This demo assumes independent, unbiased, one-dimensional measurements. Real navigation measurements may be correlated, nonlinear and biased. Kalman filters generalise this idea by adding prediction, covariance propagation and measurement models.
Footnotes
-
Greg Welch and Gary Bishop, “An Introduction to the Kalman Filter”, TR 95-041. https://homepages.inf.ed.ac.uk/rbf/CVonline/LOCAL_COPIES/WELCH/kalman.html - Practical introduction to the discrete Kalman filter and EKF. Accessed 2026-06-11. ↩