Initializes an EKF structure.
- Parameters
-
| ekf | pointer to EKF structure to initialize |
| n | number of state variables |
| m | number of observables |
ekf should be a pointer to a structure defined as follows, where N and M are constants:
int n; // number of state values
int m; // number of observables
double x[N]; // state vector
double P[N][N]; // prediction error covariance
double Q[N][N]; // process noise covariance
double R[M][M]; // measurement error covariance
double G[N][M]; // Kalman gain; a.k.a. K
double F[N][N]; // Jacobian of process model
double H[M][N]; // Jacobian of measurement model
double Ht[N][M]; // transpose of measurement Jacobian
double Ft[N][N]; // transpose of process Jacobian
double Pp[N][N]; // P, post-prediction, pre-update
double fx[N]; // output of user defined f() state-transition function
double hx[M]; // output of user defined h() measurement function
// temporary storage
double tmp0[N][N];
double tmp1[N][Msta];
double tmp2[M][N];
double tmp3[M][M];
double tmp4[M][M];
double tmp5[M];