Skip to content

Kalman Filter

Matthew Daigle edited this page Feb 8, 2017 · 3 revisions

Class implementing Kalman filter algorithm.

This class implements the Kalman filter algorithm. It maintains the current state and output estimates, and updates these when new data is provided. The system model is given in the form of the state space matrices A, B, C, D, and process and sensor noise covariance matrices Q and R:

   x(k+1) = A x(k) + B u(k) + N(0,Q)
     y(k) = C x(k) + D u(k) + N(0,R)

where N is the standard normal distribution with zero mean and covariance Q or R.

This class implements the Observer interface.

Methods

  • initialize(KF,t0,x0,u0) - Initialize filter given initial time, state, and inputs
  • estimate(KF,t,u,z) - Update the state and outpute estimates given new input and output data.
  • getStateEstimate(KF) - Return a state estimate structure with mean and covariance.

Note that although these methods take time as an input, the state space matrices are time-invariant and so must be defined with respect to the desired sampling rate. The filter only keeps track of the current time given to it and does not use time in any calculations.

See also ExtendedKalmanFilter, UnscentedKalmanFilter.

Clone this wiki locally