cv.KalmanFilter - MATLAB File Help Go to online doc for cv.KalmanFilter
cv.KalmanFilter

Kalman filter class

The class implements a standard Kalman filter, [Welch95]. However, you can modify transitionMatrix, controlMatrix, and measurementMatrix to get an extended Kalman filter functionality.

Example

% initialization
kf = cv.KalmanFilter(4,2);
kf.statePre = [10;20;0;0]; % initial state prediction
kf.transitionMatrix = [1,0,1,0; 0,1,0,1; 0,0,1,0; 0,0,0,1];
kf.measurementMatrix([1,4]) = 1;
kf.processNoiseCov = eye(4) * 1e-4;
kf.measurementNoiseCov = eye(2) * 1e-1;
kf.errorCovPost = eye(4) * 0.1;

% dynamics
p_pred = kf.predict();       % update internal state
measure = [11;21];           % measurement
p_est = kf.correct(measure); % correct

References

[Welch95]:

Greg Welch and Gary Bishop. An introduction to the kalman filter, 1995. PDF

See also
Class Details
Superclasses handle
Sealed false
Construct on load false
Constructor Summary
KalmanFilter KalmanFilter constructor 
Property Summary
controlMatrix control matrix `(B)` (not used if there is no control) 
errorCovPost posteriori error estimate covariance matrix 
errorCovPre priori error estimate covariance matrix 
gain Kalman gain matrix `(K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R`) 
id Object ID 
measurementMatrix measurement matrix `(H)` 
measurementNoiseCov measurement noise covariance matrix `(R)` 
processNoiseCov process noise covariance matrix `(Q)` 
statePost corrected state `(x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))` 
statePre predicted state `(x'(k)): x(k)=A*x(k-1)+B*u(k)` 
transitionMatrix state transition matrix `(A)` 
Method Summary
  addlistener Add listener for event. 
  correct Updates the predicted state from the measurement 
  delete Destructor 
  eq == (EQ) Test handle equality. 
  findobj Find objects matching specified conditions. 
  findprop Find property of MATLAB handle object. 
  ge >= (GE) Greater than or equal relation for handles. 
  gt > (GT) Greater than relation for handles. 
  init Re-initializes Kalman filter. The previous content is destroyed 
Sealed   isvalid Test handle validity. 
  le <= (LE) Less than or equal relation for handles. 
  listener Add listener for event without binding the listener to the source object. 
  lt < (LT) Less than relation for handles. 
  ne ~= (NE) Not equal relation for handles. 
  notify Notify listeners of event. 
  predict Computes a predicted state 
Event Summary
ObjectBeingDestroyed Notifies listeners that a particular object has been destroyed.