我想在GPS多普勒速度中使用卡尔曼滤波器。即使我在网上阅读了一些教程,我也不知道该怎么做。
是否有matlab脚本只能通过输入GPS速度来实现。也许我还需要精确的采样频率?
很高兴能就这个话题提供一些帮助。 谢谢。
答案 0 :(得分:1)
这是带有vision.KalmanFilter
类的最小matlab代码。假设您的测量值是矩阵data
[纬度,纬度_速度,经度,经度_速度]的列向量'。这里假设恒速模型。您应该定义ProcessNise
,MeasurementNoise
并自行初始化。
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