% Measurement Noise Covariance R (How noisy is the sensor) R = measurement_noise_std^2; % = 25
# In terminal, navigate to your folder zip -r Kalman_Beginner_Package.zip kalman_beginner_example1.m kalman_beginner_example2.m README.txt
Invented by Rudolf E. Kálmán in 1960, the Kalman Filter is a mathematical algorithm that uses a series of measurements observed over time, containing statistical noise and other inaccuracies, to produce estimates of unknown variables that are more accurate than those based on a single measurement alone. % Measurement Noise Covariance R (How noisy is
% State transition with known input (gravity) % x(k+1) = F x(k) + B u(k) F = [1, dt; 0, 1]; B = [0.5*dt^2; dt]; % Control input matrix for acceleration u = g; % Control input (gravity)
subplot(2,1,2); plot(t, stored_x(2,:), 'b-', 'LineWidth', 2); yline(true_vel, 'g--', 'True Velocity'); xlabel('Time (s)'); ylabel('Velocity (m/s)'); title('Estimated Velocity (Kalman Filter)'); legend('Estimated Velocity', 'True Velocity'); grid on; SIMULATE THE REAL WORLD dt = 0
%% Noisy measurement (measuring position only) meas_noise_std = 0.5; % 0.5 meter noise measurements = true_pos + meas_noise_std * randn(1, N);
%% 1. SIMULATE THE REAL WORLD dt = 0.1; % Time step (seconds) t = 0:dt:10; % Time vector (10 seconds) N = length(t); % Number of time steps % Number of time steps Now
Now, imagine you also have a speedometer (a sensor that measures velocity). How do you combine the noisy position (GPS) and the noisy velocity (speedometer) to produce one smooth, highly accurate estimate of where the car actually is?