SigPack - the C++ signal processing library
sp::KF Class Reference

#include <kalman.h>

Inheritance diagram for sp::KF:
Inheritance graph
Collaboration diagram for sp::KF:
Collaboration graph

Public Member Functions

 KF (arma::uword _N, arma::uword _M, arma::uword _L)
 
 ~KF ()
 
void clear (void)
 
void set_state_vec (const arma::mat &_x)
 
void set_trans_mat (const arma::mat &_A)
 
void set_control_mat (const arma::mat &_B)
 
void set_meas_mat (const arma::mat &_H)
 
void set_err_cov (const arma::mat &_P)
 
void set_proc_noise (const arma::mat &_Q)
 
void set_meas_noise (const arma::mat &_R)
 
void set_kalman_gain (const arma::mat &_K)
 
void set_trans_fcn (fcn_v _f)
 
void set_meas_fcn (fcn_v _h)
 
arma::mat get_state_vec (void)
 
arma::mat get_err (void)
 
arma::mat get_kalman_gain (void)
 
arma::mat get_err_cov (void)
 
void predict (const arma::mat u)
 
void predict (void)
 
void update (const arma::mat z)
 
void rts_smooth (const arma::mat &Xf, const arma::cube &Pf, arma::mat &Xs, arma::cube &Ps)
 

Protected Attributes

arma::uword N
 
arma::uword M
 
arma::uword L
 
bool lin_proc
 
bool lin_meas
 
arma::mat x
 
arma::mat z_err
 
arma::mat A
 
arma::mat B
 
arma::mat H
 
arma::mat P
 
arma::mat Q
 
arma::mat R
 
arma::mat K
 
fcn_v f
 
fcn_v h
 

Detailed Description

Implements Kalman functions for the discrete system

\[ x_k = Ax_{k-1}+Bu_{k-1} + w_{k-1} \]

with measurements

\[ z_k = Hx_k + v_k \]

The predicting stage is

\[ \hat{x}^-_k = A\hat{x}_{k-1}+Bu_{k-1} \]

\[ P^-_k = AP_{k-1}A^T+Q \]

and the updates stage

\[ K_k = P^-_kH^T(HP^-_kH^T+R)^{-1} \]

\[ \hat{x}_k = \hat{x}^-_k + K_k(z_k-H\hat{x}^-_k) \]

\[ P_k = (I-K_kH)P^-_k \]

For detailed info see: http://www.cs.unc.edu/~welch/media/pdf/kalman_intro.pdf

Examples:
kalman_linear.cpp.

Definition at line 129 of file kalman.h.


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