The filter operates in a recursive loop consisting of two main phases: 1. The Prediction (Time Update) The filter projects the current state forward in time.
end
%% Kalman Filter x_est = [0; 0]; % [pos; vel] P_est = eye(2) * 1; The filter operates in a recursive loop consisting
% Generate Noisy Measurements (Simulating a Sensor) measurement_noise = 10; % Variance of the sensor noise measurements = true_positions + sqrt(measurement_noise) * randn(1, n_iter); You don't need a massive database of past readings
It only needs the previous state to calculate the current state. You don't need a massive database of past readings. vel] P_est = eye(2) * 1
It sounds like you're looking for a resource for learning the Kalman filter, specifically one that includes MATLAB examples and is available for download.
% plot figure; plot(true_traj(1,:), true_traj(2,:), '-k'); hold on; plot(meas(1,:), meas(2,:), '.r'); plot(est(1,:), est(2,:), '-b'); legend('True','Measurements','Estimate'); xlabel('x'); ylabel('y'); axis equal;