\hypertarget{classEKFfixed}{
\section{EKFfixed Class Reference}
\label{classEKFfixed}\index{EKFfixed@{EKFfixed}}
}
Extended \hyperlink{classKalman}{Kalman} Filter with full matrices in fixed point arithmetic.  


{\tt \#include $<$ekf\_\-obj.h$>$}

Inheritance diagram for EKFfixed:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=72pt]{classEKFfixed__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for EKFfixed:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=400pt]{classEKFfixed__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
\hypertarget{classEKFfixed_cece920bbf58fc72b25a6417b3ef0259}{
void \textbf{init\_\-ekf} (double Tv)}
\label{classEKFfixed_cece920bbf58fc72b25a6417b3ef0259}

\item 
\hypertarget{classEKFfixed_491e636b259dda3b876b7bd492df6b7c}{
void \textbf{ekf} (double ux, double uy, double isxd, double isyd)}
\label{classEKFfixed_491e636b259dda3b876b7bd492df6b7c}

\item 
\hypertarget{classEKFfixed_e77b35e1a11356dbfb1fdfa3017f60d3}{
void \textbf{prediction} (int $\ast$ux)}
\label{classEKFfixed_e77b35e1a11356dbfb1fdfa3017f60d3}

\item 
\hypertarget{classEKFfixed_83ed56b86a056d7dbdd6ce44145fa5f3}{
void \textbf{correction} (void)}
\label{classEKFfixed_83ed56b86a056d7dbdd6ce44145fa5f3}

\item 
\hypertarget{classEKFfixed_dce43355681cfe8f1905db207b4dde8d}{
void \textbf{update\_\-psi} (void)}
\label{classEKFfixed_dce43355681cfe8f1905db207b4dde8d}

\item 
\hypertarget{classEKFfixed_64d7b1a39c27b1846bcd5628928748ef}{
\hyperlink{classEKFfixed_64d7b1a39c27b1846bcd5628928748ef}{EKFfixed} (\hyperlink{classRV}{RV} rvx, \hyperlink{classRV}{RV} \hyperlink{classBMcond_9ba793c8ec453f04d372d17195ed8dec}{rvc})}
\label{classEKFfixed_64d7b1a39c27b1846bcd5628928748ef}

\begin{CompactList}\small\item\em Default constructor. \item\end{CompactList}\item 
\hypertarget{classEKFfixed_ddf5334bc1207658fd53698fffbac028}{
void \hyperlink{classEKFfixed_ddf5334bc1207658fd53698fffbac028}{bayes} (const vec \&dt)}
\label{classEKFfixed_ddf5334bc1207658fd53698fffbac028}

\begin{CompactList}\small\item\em Here dt = \mbox{[}yt;ut\mbox{]} of appropriate dimensions. \item\end{CompactList}\item 
\hypertarget{classEKFfixed_085cf16c573eda32d8d03619c6c4b518}{
\hyperlink{classepdf}{epdf} \& \hyperlink{classEKFfixed_085cf16c573eda32d8d03619c6c4b518}{\_\-epdf} ()}
\label{classEKFfixed_085cf16c573eda32d8d03619c6c4b518}

\begin{CompactList}\small\item\em dummy! \item\end{CompactList}\item 
\hypertarget{classEKFfixed_c7fee79e75ad7f0c0e96c5a322cbf44e}{
void \hyperlink{classEKFfixed_c7fee79e75ad7f0c0e96c5a322cbf44e}{condition} (const vec \&Q0)}
\label{classEKFfixed_c7fee79e75ad7f0c0e96c5a322cbf44e}

\begin{CompactList}\small\item\em Substitute {\tt val} for {\tt rvc}. \item\end{CompactList}\item 
\hypertarget{classBM_0186270f75189677f390fe088a9947e9}{
virtual void \hyperlink{classBM_0186270f75189677f390fe088a9947e9}{bayesB} (const mat \&Dt)}
\label{classBM_0186270f75189677f390fe088a9947e9}

\begin{CompactList}\small\item\em Batch Bayes rule (columns of Dt are observations). \item\end{CompactList}\item 
\hypertarget{classBM_8554809fec160bee279bcd5fa14ead5c}{
virtual const \hyperlink{classepdf}{epdf} \& \hyperlink{classBM_8554809fec160bee279bcd5fa14ead5c}{\_\-epdf} () const =0}
\label{classBM_8554809fec160bee279bcd5fa14ead5c}

\begin{CompactList}\small\item\em Returns a reference to the \hyperlink{classepdf}{epdf} representing posterior density on parameters. \item\end{CompactList}\item 
\hypertarget{classBM_db500c4836f883c175a3cf3ab5a3ce24}{
virtual const \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classBM_db500c4836f883c175a3cf3ab5a3ce24}{\_\-e} () const =0}
\label{classBM_db500c4836f883c175a3cf3ab5a3ce24}

\begin{CompactList}\small\item\em Returns a pointer to the \hyperlink{classepdf}{epdf} representing posterior density on parameters. Use with care! \item\end{CompactList}\item 
virtual double \hyperlink{classBM_8a8ce6df431689964c41cc6c849cfd06}{logpred} (const vec \&dt) const 
\item 
\hypertarget{classBM_cd0660f2a1a344b56ac39802708ff165}{
vec \hyperlink{classBM_cd0660f2a1a344b56ac39802708ff165}{logpred\_\-m} (const mat \&dt) const }
\label{classBM_cd0660f2a1a344b56ac39802708ff165}

\begin{CompactList}\small\item\em Matrix version of logpred. \item\end{CompactList}\item 
\hypertarget{classBM_5594d68ee9aa6fc8c1e79019da5c9d56}{
virtual \hyperlink{classepdf}{epdf} $\ast$ \hyperlink{classBM_5594d68ee9aa6fc8c1e79019da5c9d56}{predictor} (const \hyperlink{classRV}{RV} \&\hyperlink{classBM_af00f0612fabe66241dd507188cdbf88}{rv}) const }
\label{classBM_5594d68ee9aa6fc8c1e79019da5c9d56}

\begin{CompactList}\small\item\em Constructs a predictive density (marginal density on data). \item\end{CompactList}\item 
\hypertarget{classBM_126bd2595c48e311fc2a7ab72876092a}{
const \hyperlink{classRV}{RV} \& \hyperlink{classBM_126bd2595c48e311fc2a7ab72876092a}{\_\-rv} () const }
\label{classBM_126bd2595c48e311fc2a7ab72876092a}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
\hypertarget{classBM_87f4a547d2c29180be88175e5eab9c88}{
double \hyperlink{classBM_87f4a547d2c29180be88175e5eab9c88}{\_\-ll} () const }
\label{classBM_87f4a547d2c29180be88175e5eab9c88}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
\hypertarget{classBM_1ffa9f23669aabecc3760c06c6987522}{
void \hyperlink{classBM_1ffa9f23669aabecc3760c06c6987522}{set\_\-evalll} (bool evl0)}
\label{classBM_1ffa9f23669aabecc3760c06c6987522}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\item 
virtual \hyperlink{classBM}{BM} $\ast$ \hyperlink{classBM_eb58c81d6a7b75b05fc6f276eed78887}{\_\-copy\_\-} (bool changerv=false)
\item 
\hypertarget{classBMcond_3fa60348b2da6b4208bb95b8d146900a}{
const \hyperlink{classRV}{RV} \& \hyperlink{classBMcond_3fa60348b2da6b4208bb95b8d146900a}{\_\-rvc} () const }
\label{classBMcond_3fa60348b2da6b4208bb95b8d146900a}

\begin{CompactList}\small\item\em access function \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classEKFfixed_d04ddf049475a15e1ba93161aa5586ab}{
int \textbf{Q} \mbox{[}16\mbox{]}}
\label{classEKFfixed_d04ddf049475a15e1ba93161aa5586ab}

\item 
\hypertarget{classEKFfixed_d914213d413b4d8f8d7bb728c5063d5e}{
int \textbf{R} \mbox{[}4\mbox{]}}
\label{classEKFfixed_d914213d413b4d8f8d7bb728c5063d5e}

\item 
\hypertarget{classEKFfixed_7fd20a80b00e9782da676e48eb5b54b3}{
int \textbf{x\_\-est} \mbox{[}4\mbox{]}}
\label{classEKFfixed_7fd20a80b00e9782da676e48eb5b54b3}

\item 
\hypertarget{classEKFfixed_9518fa723d7324f75df7822a589ee196}{
int \textbf{x\_\-pred} \mbox{[}4\mbox{]}}
\label{classEKFfixed_9518fa723d7324f75df7822a589ee196}

\item 
\hypertarget{classEKFfixed_0b731c546a474433c1ea6f36f0125774}{
int \textbf{P\_\-pred} \mbox{[}16\mbox{]}}
\label{classEKFfixed_0b731c546a474433c1ea6f36f0125774}

\item 
\hypertarget{classEKFfixed_b9ec9cb2d092ca3f4ad2a3b4420867ac}{
int \textbf{P\_\-est} \mbox{[}16\mbox{]}}
\label{classEKFfixed_b9ec9cb2d092ca3f4ad2a3b4420867ac}

\item 
\hypertarget{classEKFfixed_5a8040cdb8bb5dca753485dc67db3287}{
int \textbf{Y\_\-mes} \mbox{[}2\mbox{]}}
\label{classEKFfixed_5a8040cdb8bb5dca753485dc67db3287}

\item 
\hypertarget{classEKFfixed_9292e43fb8e6fedfabb3a9b3c2118e33}{
int \textbf{ukalm} \mbox{[}2\mbox{]}}
\label{classEKFfixed_9292e43fb8e6fedfabb3a9b3c2118e33}

\item 
\hypertarget{classEKFfixed_f754902bb769d3b58b89108c76d9a394}{
int \textbf{Kalm} \mbox{[}8\mbox{]}}
\label{classEKFfixed_f754902bb769d3b58b89108c76d9a394}

\item 
\hypertarget{classEKFfixed_bf4b3d55c8d277673bf77f37f6590217}{
int \textbf{PSI} \mbox{[}16\mbox{]}}
\label{classEKFfixed_bf4b3d55c8d277673bf77f37f6590217}

\item 
\hypertarget{classEKFfixed_8a677b253b54696701c1ca0cb6f7a622}{
int \textbf{temp15a} \mbox{[}16\mbox{]}}
\label{classEKFfixed_8a677b253b54696701c1ca0cb6f7a622}

\item 
\hypertarget{classEKFfixed_6d4354dad09286a7a209983732853c5b}{
int \textbf{cA}}
\label{classEKFfixed_6d4354dad09286a7a209983732853c5b}

\item 
\hypertarget{classEKFfixed_eac752adfb921c1c525f8c3b3fd15dad}{
int \textbf{cB}}
\label{classEKFfixed_eac752adfb921c1c525f8c3b3fd15dad}

\item 
\hypertarget{classEKFfixed_2f35ef3dce13131ae9b4427309a1d005}{
int \textbf{cC}}
\label{classEKFfixed_2f35ef3dce13131ae9b4427309a1d005}

\item 
\hypertarget{classEKFfixed_50b31e70bb17cbdde2e28c83b9612c47}{
int \textbf{cG}}
\label{classEKFfixed_50b31e70bb17cbdde2e28c83b9612c47}

\item 
\hypertarget{classEKFfixed_086e18ad28d139b0a2c0f77badc77a9a}{
int \textbf{cH}}
\label{classEKFfixed_086e18ad28d139b0a2c0f77badc77a9a}

\item 
\hypertarget{classEKFfixed_540046e3ab4d0bed4791f397062a626f}{
long \textbf{temp30a} \mbox{[}4\mbox{]}}
\label{classEKFfixed_540046e3ab4d0bed4791f397062a626f}

\item 
\hypertarget{classEKFfixed_ea92b06e2b66c6771828e689bb727b76}{
\hyperlink{classenorm}{enorm}$<$ \hyperlink{classfsqmat}{fsqmat} $>$ \textbf{E}}
\label{classEKFfixed_ea92b06e2b66c6771828e689bb727b76}

\item 
\hypertarget{classEKFfixed_6e5552506214757d24e59e508f91c8aa}{
mat \textbf{Ry}}
\label{classEKFfixed_6e5552506214757d24e59e508f91c8aa}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
\hypertarget{classBM_af00f0612fabe66241dd507188cdbf88}{
\hyperlink{classRV}{RV} \hyperlink{classBM_af00f0612fabe66241dd507188cdbf88}{rv}}
\label{classBM_af00f0612fabe66241dd507188cdbf88}

\begin{CompactList}\small\item\em Random variable of the posterior. \item\end{CompactList}\item 
\hypertarget{classBM_5623fef6572a08c2b53b8c87b82dc979}{
double \hyperlink{classBM_5623fef6572a08c2b53b8c87b82dc979}{ll}}
\label{classBM_5623fef6572a08c2b53b8c87b82dc979}

\begin{CompactList}\small\item\em Logarithm of marginalized data likelihood. \item\end{CompactList}\item 
\hypertarget{classBM_bf6fb59b30141074f8ee1e2f43d03129}{
bool \hyperlink{classBM_bf6fb59b30141074f8ee1e2f43d03129}{evalll}}
\label{classBM_bf6fb59b30141074f8ee1e2f43d03129}

\begin{CompactList}\small\item\em If true, the filter will compute likelihood of the data record and store it in {\tt ll} . Set to false if you want to save computational time. \item\end{CompactList}\item 
\hypertarget{classBMcond_9ba793c8ec453f04d372d17195ed8dec}{
\hyperlink{classRV}{RV} \hyperlink{classBMcond_9ba793c8ec453f04d372d17195ed8dec}{rvc}}
\label{classBMcond_9ba793c8ec453f04d372d17195ed8dec}

\begin{CompactList}\small\item\em Identificator of the conditioning variable. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Extended \hyperlink{classKalman}{Kalman} Filter with full matrices in fixed point arithmetic. 

An approximation of the exact Bayesian filter with Gaussian noices and non-linear evolutions of their mean. 

\subsection{Member Function Documentation}
\hypertarget{classBM_8a8ce6df431689964c41cc6c849cfd06}{
\index{EKFfixed@{EKFfixed}!logpred@{logpred}}
\index{logpred@{logpred}!EKFfixed@{EKFfixed}}
\subsubsection[logpred]{\setlength{\rightskip}{0pt plus 5cm}virtual double BM::logpred (const vec \& {\em dt}) const\hspace{0.3cm}{\tt  \mbox{[}inline, virtual, inherited\mbox{]}}}}
\label{classBM_8a8ce6df431689964c41cc6c849cfd06}


Evaluates predictive log-likelihood of the given data record I.e. marginal likelihood of the data with the posterior integrated out. 

Reimplemented in \hyperlink{classARX_e7f9e7823aec9bf7ddc3b42d9b3304c4}{ARX}, \hyperlink{classMixEF_424ca64f36d4e41de7a7e7ae921d35ea}{MixEF}, and \hyperlink{classmultiBM_13e26a61757278981fd8cac9a7ef91eb}{multiBM}.

Referenced by BM::logpred\_\-m().\hypertarget{classBM_eb58c81d6a7b75b05fc6f276eed78887}{
\index{EKFfixed@{EKFfixed}!\_\-copy\_\-@{\_\-copy\_\-}}
\index{\_\-copy\_\-@{\_\-copy\_\-}!EKFfixed@{EKFfixed}}
\subsubsection[\_\-copy\_\-]{\setlength{\rightskip}{0pt plus 5cm}virtual {\bf BM}$\ast$ BM::\_\-copy\_\- (bool {\em changerv} = {\tt false})\hspace{0.3cm}{\tt  \mbox{[}inline, virtual, inherited\mbox{]}}}}
\label{classBM_eb58c81d6a7b75b05fc6f276eed78887}


Copy function required in vectors, Arrays of \hyperlink{classBM}{BM} etc. Have to be DELETED manually! Prototype: BM$\ast$ \hyperlink{classBM_eb58c81d6a7b75b05fc6f276eed78887}{\_\-copy\_\-()}\{\hyperlink{classBM}{BM} Tmp$\ast$=new Tmp(this$\ast$); return Tmp; \} 

Reimplemented in \hyperlink{classARX_5de61fbd4f97fa3216760b1f733f5af0}{ARX}, and \hyperlink{classBMEF_97f5312efe4a5bedb86d2daec59d8651}{BMEF}.

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
work/git/mixpp/pmsm/simulator\_\-zdenek/ekf\_\-example/\hyperlink{ekf__obj_8h}{ekf\_\-obj.h}\item 
work/git/mixpp/pmsm/simulator\_\-zdenek/ekf\_\-example/ekf\_\-obj.cpp\end{CompactItemize}
