A course for guidance, navigation and control students

An Intuitive Introduction to Kalman Filtering

Ten modules that go from “what is sensor noise?” to a working error-state Kalman filter. Each module adds one idea, starts from something the previous module got wrong, and has a MATLAB script where you build the idea yourself.

“How much should I trust this new measurement, compared with what I already believe?”

That question runs through the whole course. The answer is always a gain K between 0 and 1, used the same way every time: estimate = prediction + K · (measurement − prediction).

Modules

How each module works

1. Slides. Open the module’s slides from the list above. Use the arrow keys or the on-screen buttons to move, and press N for instructor notes.

2. MATLAB. Open the module’s mNN_student.m and press Run. It works as it is. Fill in the TODO blocks one at a time and run again; the Command Window prints PASS or FAIL for each. The finished version is mNN_solution.m. Only base MATLAB is needed, no toolboxes.

3. Scoreboard. Each module ends by adding a bar to a chart of RMS error, so you can see each technique improve on the last.

Color code

Used in every figure, widget and MATLAB plot: blue is the truth, red is a sensor measurement, green is our estimate.

Notation

SymbolMeaningFirst used
p, v, aTrue position, velocity and acceleration of the sledModule 1
zA sensor measurementModule 1
nMeasurement noiseModule 1
σ, σ²Standard deviation (“one sigma”) and varianceModule 1
kSample index: zk is the reading at sample kModule 1
x̂A hat marks an estimate: p̂ is our estimate of pModule 2
KGain: how much of the measurement’s disagreement we accept, from 0 to 1Module 2
x̂−A minus superscript marks a prediction, before the measurement is usedModule 3
PVariance (later, covariance matrix) of our estimateModule 4
RVariance of the measurement noiseModule 4
QVariance of the process noise: how much uncertainty each prediction step addsModule 4