MATLAB Answers

set process noise 1D Constant Velocity

3 views (last 30 days)
I can define a Kalman filter with the code:
KF = trackingKF ('MotionModel','1D Constant Velocity');
How do I set the process noise? I mean I can set it with e.g:
but since the process noise should be a function of one parameter only there should be som other way.

Accepted Answer

Elad Kivelevitch
Elad Kivelevitch on 26 Jun 2019
Thanks for the question.
I think I understand your confusion, but let's see if I do. You expect the process noise to be a*Bmat(dt) where a represents the magnitude of the process noise and Bmat(dt) is a time dependent factor that multiplies the acceleration according to the time difference, dt.
We currently don't have that option when you use trackingKF with a defined MotionModel. When you call predict(KF, dt), we assume that a=1 and then the process noise is simply [0.25 0.5;0.5 1];
There are two ways around that:
  1. You can use a trackingEKF (or a trackingABF) and set it to a constant velocity model.
  2. You can use trackingKF with a Custom motion model and set ProcessNoise yourself at every step.
Option 1: trackingEKF
sigmasq = 3;
EKF = trackingEKF(@constvel,@cvmeas,zeros(2,1),'HasAdditiveProcessNoise', false,'ProcessNoise',sigmasq)
[x_pred,P_pred] = predict(EKF,2) % Predict 2 seconds to the future
Note that P_pred is calculated correctly by taking into account the process noise, sigma, as an acceleration term.
Option 2: trackingKF with custom model:
% Defind the KF custom model:
A = [1 1;1 0];
H = [1 0];
KF = trackingKF(A,H)
% Now predict with sigma = 3 and dt = 2
sigmasq = 3;
dt = 2;
Q = sigmasq * [dt^4/4 dt^3/2; dt^3/2 dt^2];
A = [1 dt; 0 1];
[x_pred, P_pred] = predict(KF, A, Q)
Hope this helps,

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by