Reputation: 345
I would like to use the Kalman Filter in the GPS Doppler speed. Even if I read some tutorials in the web, I have no idea how to do it.
Is there a matlab script that can do it only by given in input the GPS speed. Maybe I have to precise the sample frequency also ?
Upvotes: 0
Views: 468
Reputation: 312
Here is the minimal matlab code with vision.KalmanFilter
class. assuming your measurements are column vectors of matrix data
[latitude, latitude_speed, longitude, longitude_speed]'. constant velocity model is assumed here. You should define ProcessNise
, MeasurementNoise
and the initialization yourself.
data = randn(4,100); % load your data here
delta = 1; % sampling frequency
% state model asuming constant velocity
stateModel = [1 delta 0 0 ;
0 1 0 0 ;
0 0 1 delta;
0 0 0 1 ];
% measurements are simply the state
measurementModel = eye(4);
kalman = vision.KalmanFilter(stateModel, ...
measurementModel, ...
'ProcessNoise',1, ...
'MeasurementNoise',1);
%initialize
kalman.State = [0; 0; 0; 0];
kalman.StateCovariance = eye(4);
T = size(data,2); % length of measurements
filtered = [];
for t=1:T
measurement = data(:,t);
kalman.predict(); % prediction
kalman.correct(measurement);
filtered = [filtered, kalman.State];
end
Upvotes: 1