Kalman Filter
Implementation of a Kalman filter. This class contains the state of a Kalman kilter. The state of a Kalman filter is updated by predict
and correct
functions.
The source code, notation and formulae below are borrowed from the JKalman tutorial [Welch95]:
x<sub>k</sub>=A*x<sub>k-1</sub>+B*u<sub>k</sub>+w<sub>k</sub>
z<sub>k</sub>=Hx<sub>k</sub>+v<sub>k</sub>,
Content copied to clipboard
where:
x<sub>k</sub> (x<sub>k-1</sub>)
Content copied to clipboard - state of the system at the moment k (k-1)
z<sub>k</sub>
Content copied to clipboard - measurement of the system state at the moment k
u<sub>k</sub>
Content copied to clipboard - external control applied at the moment k
w<sub>k</sub>
Content copied to clipboard and v<sub>k</sub>
Content copied to clipboard are normally-distributed process and
measurement noise, respectively:
p(w) ~ N(0,Q)
p(v) ~ N(0,R),
that is,
Q - process noise covariance matrix, constant or variable,
R - measurement noise covariance matrix, constant or variable
Content copied to clipboard
In case of standard Kalman filter, all the matrices: A, B, H, Q and R are initialized once after Kalman structure is allocated via constructor. However, the same structure and the same functions may be used to simulate extended Kalman filter by linearizing extended Kalman filter equation in the current system state neighborhood, in this case A, B, H (and, probably, Q and R) should be updated on every step.
Constructors
Properties
Link copied to clipboard
Control matrix (B) (it is not used if there is no control).
Link copied to clipboard
Independent measurement noise variance assumed when no measurement noise covariance matrix is provided.
Link copied to clipboard
Independent process noise variance assumed when no process noise covariance matrix is provided.
Link copied to clipboard
Posteriori error estimate covariance matrix (P(k)): P(k)=(I-K(k)*H)*P'(k)
Link copied to clipboard
Priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)
Link copied to clipboard
Measurement matrix (H).
Link copied to clipboard
Measurement noise covariance matrix (R).
Link copied to clipboard
Process noise covariance matrix (Q).
Link copied to clipboard
State transition matrix (A).
Functions
Link copied to clipboard
Obtains the number of control vector dimensions (control parameters).
Link copied to clipboard
Obtains the number of state vector dimensions (dynamic parameters).
Link copied to clipboard
Obtains the number of measurement vector dimensions (measure parameters).
Link copied to clipboard
Sets the number of measurement vector dimensions (measure parameters).