/* 
 *  Copyright 2002 by Soos, Antal 
 *  All rights reserved. Property of Soos, Antal. 
 *  Restricted rights to use, duplicate or disclose this code are 
 *  granted through contract.   
 */ 
/***************************************************************************/ 
/*                                                                         */ 
/*     KF . hpp															   */ 
/*                                                                         */ 
/*     Recoursive Kalman Filter Algorithm inplementation.				   */ 
/*																	       */ 
/*                                                                         */ 
/***************************************************************************/ 
 
#ifndef _KF_HPP_ 
#define _KF_HPP_ 
 
#include "sysIdent.hpp" 
 
class KF_alg : public sysid { 
 
	protected:
	float P_KF_v[(ARMAX_dim*ARMAX_dim)+2];
	Matrix P_KF; 
	float R_v[1+2];
	Matrix R; 
	float Q_v[(ARMAX_dim*ARMAX_dim)+2];
	Matrix Q; 
	float k_v[ARMAX_dim+2];
	Matrix k; 
	float MtempA_v[(ARMAX_dim*ARMAX_dim)+2];
	Matrix MtempA; // Temporary result holder matrix
	float MtempB_v[(ARMAX_dim*ARMAX_dim)+2];
	Matrix MtempB; // Temporary result holder matrix 

 
public: 
 
	void update(float y_n, float u_n_1); 
	KF_alg(float r,float q) ; 
	~KF_alg(); 
}; 
 
 
#endif // _KF_HPP_
