Public Member Functions | Private Attributes | Friends
KalmanFilter Class Reference

#include <kalman_filter.h>

List of all members.

Public Member Functions

 KalmanFilter (unsigned int ns, unsigned int nm, unsigned int nc, const vnl_matrix< double > &Ai, const vnl_matrix< double > &Hi, const vnl_matrix< double > &Bi, const vnl_matrix< double > &z_initial, const vnl_matrix< double > &x_initial, const vnl_matrix< double > &Pi)
 Constructor.
 KalmanFilter (unsigned int ns, unsigned int nm, const vnl_matrix< double > &Ai, const vnl_matrix< double > &Hi, const vnl_matrix< double > &z_initial, const vnl_matrix< double > &x_initial, const vnl_matrix< double > &Pi)
 Constructor.
void set_initial_input (const vnl_matrix< double > &x_initial)
void measurement_update (const vnl_matrix< double > &zk, const vnl_matrix< double > &Rk)
 measurement_update.
vnl_matrix< double > predict (const vnl_matrix< double > &Qk)
 predict.
vnl_matrix< double > predict (const vnl_matrix< double > &Qk, const vnl_matrix< double > &uk)
 predict.
vnl_matrix< double > update_predict (const vnl_matrix< double > &zk, const vnl_matrix< double > &Rk, const vnl_matrix< double > &Qk)
 update_predict.
vnl_matrix< double > estimate () const
vnl_matrix< double > prediction () const

Private Attributes

unsigned int num_signal_dimensions
unsigned int num_measurement_dimensions
unsigned int num_control_dimensions
vnl_matrix< double > A
vnl_matrix< double > H
vnl_matrix< double > B
vnl_matrix< double > x
vnl_matrix< double > x_pred
vnl_matrix< double > z
vnl_matrix< double > P
vnl_matrix< double > K

Friends

vcl_ostream & operator<< (vcl_ostream &os, const KalmanFilter &kf)
 output operator.

Detailed Description

Definition at line 36 of file kalman_filter.h.


Constructor & Destructor Documentation

KalmanFilter::KalmanFilter ( unsigned int  ns,
unsigned int  nm,
unsigned int  nc,
const vnl_matrix< double > &  Ai,
const vnl_matrix< double > &  Hi,
const vnl_matrix< double > &  Bi,
const vnl_matrix< double > &  z_initial,
const vnl_matrix< double > &  x_initial,
const vnl_matrix< double > &  Pi 
)

Constructor.

Initialises the necessary parameters and matrices

Parameters:
nsnumber of dimensions in signal
nmnumber of dimensions in measurement
ncnumber of dimensions in control input
Athe ns*ns matrix relating signal at time k to signal at time k+1.
Hthe nm*ns matrix relating the measurement to the signal.
Bthe nc*ns matrix relating the signal to the control input. I'm not sure what this is used for, but I've included it for completeness.
x_initialthe initial ns*1 estimate of the signal.
p_initialthe initial error variance vector. P = p_initial.transpose()*p_initial.
Todo:
under development
Author:
Brendan McCane

Definition at line 54 of file kalman_filter.cxx.

KalmanFilter::KalmanFilter ( unsigned int  ns,
unsigned int  nm,
const vnl_matrix< double > &  Ai,
const vnl_matrix< double > &  Hi,
const vnl_matrix< double > &  z_initial,
const vnl_matrix< double > &  x_initial,
const vnl_matrix< double > &  Pi 
)

Constructor.

Initialises the necessary parameters and matrices

Parameters:
nsnumber of dimensions in signal
nmnumber of dimensions in measurement
Athe ns*ns matrix relating signal at time k to signal at time k+1.
Hthe nm*ns matrix relating the measurement to the signal.
x_initialthe initial ns*1 estimate of the signal.
p_initialthe initial error variance vector. P = p_initial.transpose()*p_initial.
Todo:
under development
Author:
Brendan McCane

Definition at line 131 of file kalman_filter.cxx.


Member Function Documentation

vnl_matrix<double> KalmanFilter::estimate ( ) const [inline]

Definition at line 117 of file kalman_filter.h.

void KalmanFilter::measurement_update ( const vnl_matrix< double > &  zk,
const vnl_matrix< double > &  Rk 
)

measurement_update.

Calculate the Kalman gain, update the signal estimate from the last time point using the previous estimate and the new measurement, and update the error covariance matrix.

Parameters:
zkthe new measurement
Rkthe measurement error covariance matrix
Todo:
under development
Author:
Brendan McCane

Definition at line 192 of file kalman_filter.cxx.

vnl_matrix< double > KalmanFilter::predict ( const vnl_matrix< double > &  Qk)

predict.

Calculate the next state given the current estimate and project the error covariance matrix ahead in time as well. In this case, I am assuming there is no control input.

Parameters:
Qkthe process error covariance matrix
Todo:
under development
Author:
Brendan McCane

Definition at line 248 of file kalman_filter.cxx.

vnl_matrix< double > KalmanFilter::predict ( const vnl_matrix< double > &  Qk,
const vnl_matrix< double > &  uk 
)

predict.

Calculate the next state given the current estimate and project the error covariance matrix ahead in time as well.

Parameters:
Qkthe process error covariance matrix
ukthe control input
Todo:
under development
Author:
Brendan McCane

Definition at line 281 of file kalman_filter.cxx.

vnl_matrix<double> KalmanFilter::prediction ( ) const [inline]

Definition at line 119 of file kalman_filter.h.

void KalmanFilter::set_initial_input ( const vnl_matrix< double > &  x_initial) [inline]

Definition at line 89 of file kalman_filter.h.

vnl_matrix< double > KalmanFilter::update_predict ( const vnl_matrix< double > &  zk,
const vnl_matrix< double > &  Rk,
const vnl_matrix< double > &  Qk 
)

update_predict.

A wrapper function to both update the measurement and predict the new state.

Parameters:
zkthe new measurement
Rkthe measurement error covariance matrix
Qkthe process error covariance matrix
Todo:
under development
Author:
Brendan McCane

Definition at line 324 of file kalman_filter.cxx.


Friends And Related Function Documentation

vcl_ostream& operator<< ( vcl_ostream &  os,
const KalmanFilter kf 
) [friend]

output operator.

Parameters:
kfthe Kalman filter to output
Todo:
under development
Author:
Brendan McCane

Definition at line 342 of file kalman_filter.cxx.


Member Data Documentation

vnl_matrix<double> KalmanFilter::A [private]

Definition at line 48 of file kalman_filter.h.

vnl_matrix<double> KalmanFilter::B [private]

Definition at line 54 of file kalman_filter.h.

vnl_matrix<double> KalmanFilter::H [private]

Definition at line 51 of file kalman_filter.h.

vnl_matrix<double> KalmanFilter::K [private]

Definition at line 69 of file kalman_filter.h.

unsigned int KalmanFilter::num_control_dimensions [private]

Definition at line 45 of file kalman_filter.h.

Definition at line 42 of file kalman_filter.h.

unsigned int KalmanFilter::num_signal_dimensions [private]

Definition at line 39 of file kalman_filter.h.

vnl_matrix<double> KalmanFilter::P [private]

Definition at line 66 of file kalman_filter.h.

vnl_matrix<double> KalmanFilter::x [private]

Definition at line 57 of file kalman_filter.h.

vnl_matrix<double> KalmanFilter::x_pred [private]

Definition at line 60 of file kalman_filter.h.

vnl_matrix<double> KalmanFilter::z [private]

Definition at line 63 of file kalman_filter.h.


The documentation for this class was generated from the following files: