What is Kalman Filtering?

What is the Kalman Filter?

Suppose you are in a car: your GPS tells you where you are positioned and is inaccurate and your speedometer tells you how fast you are going and is inaccurate. Kalman Filter is a mathematical technique in which several noisy inputs are integrated so as to present the most appropriate guess on the status of a system (such as location or speed).

The core idea of the Kalman Filter is as following:

Predict
Predict the next state with modelling a system model
Update
Based on the new measurements correct the prediction
Iterate
Keep looping to the predict-update cycle
Weight
Carry out the assignment of weights on the uncertainty estimates

It is a recursive algorithm that is computationally and offers optimal estimates to linear systems with Gaussian noise.

True Position
Measurement
Kalman Estimate

How Does the Kalman Filter Work?

Kalman Filter works in two stages which are the prediction stage and the update stage. This is the simplified mathematical explanation of it:

1

Prediction Phase

Based on the system model predict the current state:

Predicted State:
x̂ₖ⁻ = F x̂ₖ₋₁ + B uₖ
Predicted Covariance:
Pₖ⁻ = F Pₖ₋₁ Fᵀ + Q

Where:

  • x̂ₖ⁻: Prior state estimate
  • F: State transition matrix
  • uₖ: Control input
  • Pₖ⁻: Prior estimate covariance
  • Q: Process noise covariance
2

Update Phase

Put a value on the estimate with the measurements:

Kalman Gain:
Kₖ = Pₖ⁻ Hᵀ (H Pₖ⁻ Hᵀ + R)⁻¹
Updated State:
x̂ₖ = x̂ₖ⁻ + Kₖ (zₖ – H x̂ₖ⁻)
Updated Covariance:
Pₖ = (I – Kₖ H) Pₖ⁻

Where:

  • Kₖ: Kalman Gain
  • R: Measurement noise covariance
  • zₖ: Actual measurement
  • H: Observation matrix

Simplified understanding: the process of finding K is the process of multiplying two Gaussian distributions to obtain a new Gaussian distribution.

The clever bit of the Kalman Filter is the Kalman Gain which decides how strongly we should believe the prediction of the Kalman Filter and how strongly we should believe the measurement of the Kalman Filter. When measurements are trustworthy (low R), then the gain is high, which means that more weight is attached to the measurements. The prediction gets weighted by noise in measurement.

Real-World Applications

The Kalman Filter has transformed many areas through the accurate state estimation:

Aerospace & Navigation

It finds use in guidance of rockets, satellites determination of orbit and determination of the position of the ISS. Gives accurate navigation in places where there are no signals of the GPS.

Kalman filter for sensor fusion, Combines camera and radar, lidar and GPS data to build an accurate map of the environment around a vehicle to safely navigate.

Smartphones & IoT

Compares and analyses motion sensor data to count steps, orientation of the screen, and recognizing physical activity in the mobile device.

Medical Technology

Noise filters in medical application like ECG and EEG monitoring equipment that enhance diagnostic quality of signals.

Kalman Filter vs. Traditional Methods

MethodAdvantagesLimitationsBest Use Cases
Kalman FilterProcesses in real time, optimal estimation, noise should be dealt effectivelyRequires model of the system, more complex of calculationDynamical system state estimation
Moving AverageEasy to implement, Far less calculation;Lag effect, poor in sudden fluctuationSmoothing stable signals
Low-Pass FilterEasy to implement in hardware, filters out the high frequencies noisePhase delay, can remove useful signalsStationary frequency noise removal
Particle FilterDeals with non- linear systems, multi-modal distributionsComputational expensive, complicated implementationworks with highly non- linear systems

Evolution of Kalman Filtering

Kalman filtering has taken a major evolution since Rudolf Kalman published the simplest of the algorithm in 1960:

1960

Basic Kalman Filter

Linear systems optimal estimation

1970

Extended Kalman Filter (EKF)

Linearizes non-linearity

1990

Unscented Kalman Filter (UKF)

Makes non-linear systems use unscented transform

2000

Particle Filter (PF)

Monte Carlo-based non-linear filtering

The Wisdom of Kalman Filtering

The Kalman Filter is giving us an important lesson about how to make decisions in an uncertain world: the world does not provide perfect information, but is it possible by combining predictions (based on our past experience) with observations (our current data) and by cleverly assigning weight to their reliability, we can make superior decisions.

Such a “predict-update” approach is not only useful in the engineering system but also in economics, finance and in daily life decision making.

Related Articles

Latest Articles