If your GPS is cheap and noisy, the filter trusts the prediction more.
A classic aerospace example of estimating position and velocity.
zk=Hxk+vkbold z sub k equals bold cap H bold x sub k plus bold v sub k xkbold x sub k : The true state vector at time Abold cap A : State transition matrix (predicts physics). Bbold cap B : Control input matrix (handles steering/acceleration). ukbold u sub k : Known control inputs. wkbold w sub k : Process noise (untracked wind, friction). zkbold z sub k : Measured data from sensors. Hbold cap H : Measurement matrix (maps state to sensor data). vkbold v sub k : Measurement noise (sensor static). The Five Famous Equations The filter runs these five equations recursively: Predict future state Predict 2 Predict error covariance Update 1 Calculate Kalman Gain Update 2 Update state estimate Update 3 Update error covariance 3. Practical MATLAB Example: Simple Temperature Filtering If your GPS is cheap and noisy, the
The Kalman Filter is a powerful mathematical tool used to estimate the hidden state of a dynamic system from noisy measurements. Named after Rudolf E. Kálmán, it is widely used in GPS navigation, autonomous vehicles, robotics, and aerospace engineering.
$$ \hatx k-1 = F_k \hatx k-1 + B_k u_k $$ Bbold cap B : Control input matrix (handles
% Define the system dynamics model A = [1 1; 0 1]; % state transition matrix H = [1 0]; % measurement matrix Q = [0.001 0; 0 0.001]; % process noise covariance R = [1]; % measurement noise covariance
We define $\hatx k-1$ as the a priori estimate (prediction) and $\hatx k$ as the a posteriori estimate (corrected value). zkbold z sub k : Measured data from sensors
Phil Kim’s book sits perfectly in the middle. It explains the intuition behind the math and immediately demonstrates the mechanics through code.