<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.5.6">
  <compounddef id="ekf__obj_8h" kind="file">
    <compoundname>ekf_obj.h</compoundname>
    <includes local="no">itpp/itbase.h</includes>
    <includes refid="libKF_8h" local="no">estim/libKF.h</includes>
    <includes refid="fixed_8h" local="yes">fixed.h</includes>
    <includes refid="matrix_8h" local="yes">matrix.h</includes>
    <includes refid="reference_8h" local="yes">reference.h</includes>
    <includes refid="parametry__motoru_8h" local="yes">parametry_motoru.h</includes>
    <includedby refid="ekf__obj_8cpp" local="yes">work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.cpp</includedby>
    <incdepgraph>
      <node id="741">
        <label>libBM.h</label>
        <link refid="libBM_8h"/>
        <childnode refid="738" relation="include">
        </childnode>
      </node>
      <node id="744">
        <label>../itpp_ext.h</label>
        <link refid="itpp__ext_8h-source"/>
        <childnode refid="738" relation="include">
        </childnode>
      </node>
      <node id="742">
        <label>../stat/libEF.h</label>
        <link refid="libEF_8h"/>
        <childnode refid="738" relation="include">
        </childnode>
        <childnode refid="743" relation="include">
        </childnode>
        <childnode refid="741" relation="include">
        </childnode>
        <childnode refid="744" relation="include">
        </childnode>
      </node>
      <node id="740">
        <label>../stat/libFN.h</label>
        <link refid="libFN_8h-source"/>
        <childnode refid="738" relation="include">
        </childnode>
        <childnode refid="741" relation="include">
        </childnode>
      </node>
      <node id="748">
        <label>reference.h</label>
        <link refid="reference_8h-source"/>
      </node>
      <node id="738">
        <label>itpp/itbase.h</label>
      </node>
      <node id="746">
        <label>fixed.h</label>
        <link refid="fixed_8h-source"/>
      </node>
      <node id="745">
        <label>../math/chmat.h</label>
        <link refid="chmat_8h"/>
        <childnode refid="738" relation="include">
        </childnode>
        <childnode refid="743" relation="include">
        </childnode>
        <childnode refid="744" relation="include">
        </childnode>
      </node>
      <node id="739">
        <label>estim/libKF.h</label>
        <link refid="libKF_8h"/>
        <childnode refid="738" relation="include">
        </childnode>
        <childnode refid="740" relation="include">
        </childnode>
        <childnode refid="742" relation="include">
        </childnode>
        <childnode refid="745" relation="include">
        </childnode>
      </node>
      <node id="743">
        <label>../math/libDC.h</label>
        <link refid="libDC_8h"/>
        <childnode refid="738" relation="include">
        </childnode>
      </node>
      <node id="747">
        <label>matrix.h</label>
        <link refid="matrix_8h-source"/>
      </node>
      <node id="749">
        <label>parametry_motoru.h</label>
        <link refid="parametry__motoru_8h-source"/>
      </node>
      <node id="737">
        <label>work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.h</label>
        <link refid="ekf_obj.h"/>
        <childnode refid="738" relation="include">
        </childnode>
        <childnode refid="739" relation="include">
        </childnode>
        <childnode refid="746" relation="include">
        </childnode>
        <childnode refid="747" relation="include">
        </childnode>
        <childnode refid="748" relation="include">
        </childnode>
        <childnode refid="749" relation="include">
        </childnode>
      </node>
    </incdepgraph>
    <innerclass refid="classEKFfixed" prot="public">EKFfixed</innerclass>
      <sectiondef kind="func">
      <memberdef kind="function" id="ekf__obj_8h_120a104802ddcb544b8de3fe3e5e03253" prot="public" static="no" const="no" explicit="no" inline="no" virt="non-virtual">
        <type>double</type>
        <definition>double minQ</definition>
        <argsstring>(double Q)</argsstring>
        <name>minQ</name>
        <param>
          <type>double</type>
          <declname>Q</declname>
        </param>
        <briefdescription>
        </briefdescription>
        <detaileddescription>
        </detaileddescription>
        <inbodydescription>
        </inbodydescription>
        <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.h" line="25" bodyfile="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.cpp" bodystart="7" bodyend="7"/>
      </memberdef>
      </sectiondef>
    <briefdescription>
<para>Bayesian Filtering for linear Gaussian models (<ref refid="classKalman" kindref="compound">Kalman</ref> Filter) and extensions. </para>    </briefdescription>
    <detaileddescription>
<para><simplesect kind="author"><para>Vaclav Smidl.</para></simplesect>
----------------------------------- BDM++ - C++ library for Bayesian Decision Making under Uncertainty</para><para>Using IT++ for numerical operations ----------------------------------- </para>    </detaileddescription>
    <programlisting>
<codeline lineno="1"></codeline>
<codeline lineno="13"><highlight class="preprocessor">#ifndef<sp/>EKFfix_H</highlight></codeline>
<codeline lineno="14"><highlight class="preprocessor"></highlight><highlight class="preprocessor">#define<sp/>EKFfix_H</highlight></codeline>
<codeline lineno="15"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="16"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;itpp/itbase.h&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="17"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&lt;<ref refid="libKF_8h" kindref="compound" tooltip="Bayesian Filtering for linear Gaussian models (Kalman Filter) and extensions.">estim/libKF.h</ref>&gt;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="18"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;fixed.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="19"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;matrix.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="20"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;reference.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="21"><highlight class="normal"></highlight><highlight class="preprocessor">#include<sp/>&quot;parametry_motoru.h&quot;</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="22"><highlight class="normal"></highlight></codeline>
<codeline lineno="23"><highlight class="normal"></highlight><highlight class="keyword">using<sp/>namespace<sp/></highlight><highlight class="normal">itpp;</highlight></codeline>
<codeline lineno="24"><highlight class="normal"></highlight></codeline>
<codeline lineno="25"><highlight class="normal"></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>minQ(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Q);</highlight></codeline>
<codeline lineno="26"><highlight class="normal"></highlight></codeline>
<codeline lineno="32" refid="classEKFfixed" refkind="compound"><highlight class="keyword">class<sp/></highlight><highlight class="normal"><ref refid="classEKFfixed" kindref="compound" tooltip="Extended Kalman Filter with full matrices in fixed point arithmetic.">EKFfixed</ref><sp/>:<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classBM" kindref="compound" tooltip="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</ref>,<sp/></highlight><highlight class="keyword">public</highlight><highlight class="normal"><sp/><ref refid="classBMcond" kindref="compound" tooltip="Conditional Bayesian Filter.">BMcond</ref><sp/>{</highlight></codeline>
<codeline lineno="33"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="34"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>init_ekf(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>Tv);</highlight></codeline>
<codeline lineno="35"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>ekf(</highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>ux,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>uy,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>isxd,<sp/></highlight><highlight class="keywordtype">double</highlight><highlight class="normal"><sp/>isyd);</highlight></codeline>
<codeline lineno="36"><highlight class="normal"></highlight></codeline>
<codeline lineno="37"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Declaration<sp/>of<sp/>local<sp/>functions<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="38"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>prediction(</highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>*ux);</highlight></codeline>
<codeline lineno="39"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>correction(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="40"><highlight class="normal"></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/>update_psi(</highlight><highlight class="keywordtype">void</highlight><highlight class="normal">);</highlight></codeline>
<codeline lineno="41"><highlight class="normal"></highlight></codeline>
<codeline lineno="42"><highlight class="normal"></highlight><highlight class="comment">/*<sp/>Constants<sp/>-<sp/>definovat<sp/>jako<sp/>konstanty<sp/>??<sp/>?kde<sp/>je<sp/>vyhodnejsi<sp/>aby<sp/>v<sp/>pameti<sp/>byli?*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="43"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Q[16];<sp/></highlight><highlight class="comment">/*<sp/>matrix<sp/>[4,4]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="44"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>R[4];<sp/></highlight><highlight class="comment">/*<sp/>matrix<sp/>[2,2]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="45"><highlight class="normal"></highlight></codeline>
<codeline lineno="46"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>x_est[4];</highlight></codeline>
<codeline lineno="47"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>x_pred[4];</highlight></codeline>
<codeline lineno="48"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>P_pred[16];<sp/></highlight><highlight class="comment">/*<sp/>matrix<sp/>[4,4]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="49"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>P_est[16];<sp/></highlight><highlight class="comment">/*<sp/>matrix<sp/>[4,4]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="50"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Y_mes[2];</highlight></codeline>
<codeline lineno="51"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>ukalm[2];</highlight></codeline>
<codeline lineno="52"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>Kalm[8];<sp/></highlight><highlight class="comment">/*<sp/>matrix<sp/>[5,2]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="53"><highlight class="normal"></highlight></codeline>
<codeline lineno="54"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>PSI[16];<sp/></highlight><highlight class="comment">/*<sp/>matrix<sp/>[4,4]<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="55"><highlight class="normal"></highlight></codeline>
<codeline lineno="56"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>temp15a[16];</highlight></codeline>
<codeline lineno="57"><highlight class="normal"></highlight></codeline>
<codeline lineno="58"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>cA,<sp/>cB,<sp/>cC,<sp/>cG,<sp/>cH;<sp/><sp/></highlight><highlight class="comment">//<sp/>cD,<sp/>cE,<sp/>cF,<sp/>cI<sp/>...<sp/>nepouzivane</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="59"><highlight class="normal"></highlight></codeline>
<codeline lineno="60"><highlight class="normal"><sp/></highlight><highlight class="keywordtype">long</highlight><highlight class="normal"><sp/>temp30a[4];<sp/></highlight><highlight class="comment">/*<sp/>matrix<sp/>[2,2]<sp/>-<sp/>temporary<sp/>matrix<sp/>for<sp/>inversion<sp/>*/</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="61"><highlight class="normal"><sp/><ref refid="classenorm" kindref="compound" tooltip="Gaussian density with positive definite (decomposed) covariance matrix.">enorm&lt;fsqmat&gt;</ref><sp/>E;</highlight></codeline>
<codeline lineno="62"><highlight class="normal"><sp/>mat<sp/>Ry;</highlight></codeline>
<codeline lineno="63"><highlight class="normal"><sp/><sp/></highlight></codeline>
<codeline lineno="64"><highlight class="normal"></highlight><highlight class="keyword">public</highlight><highlight class="normal">:</highlight></codeline>
<codeline lineno="66" refid="classEKFfixed_164d7b1a39c27b1846bcd5628928748ef" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classEKFfixed_164d7b1a39c27b1846bcd5628928748ef" kindref="member" tooltip="Default constructor.">EKFfixed</ref><sp/>(<sp/><ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/>rvx,<ref refid="classRV" kindref="compound" tooltip="Class representing variables, most often random variables.">RV</ref><sp/><ref refid="classBMcond_19ba793c8ec453f04d372d17195ed8dec" kindref="member" tooltip="Identificator of the conditioning variable.">rvc</ref><sp/>):<ref refid="classBM" kindref="compound" tooltip="Bayesian Model of the world, i.e. all uncertainty is modeled by probabilities.">BM</ref>(rvx),<ref refid="classBMcond" kindref="compound" tooltip="Conditional Bayesian Filter.">BMcond</ref>(rvc),E(rvx),Ry(2,2){</highlight></codeline>
<codeline lineno="67"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">int</highlight><highlight class="normal"><sp/>i;</highlight></codeline>
<codeline lineno="68"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;16;i++){Q[i]=0;}</highlight></codeline>
<codeline lineno="69"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;4;i++){R[i]=0;}</highlight></codeline>
<codeline lineno="70"><highlight class="normal"></highlight></codeline>
<codeline lineno="71"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;4;i++){x_est[i]=0;}</highlight></codeline>
<codeline lineno="72"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;4;i++){x_pred[i]=0;}</highlight></codeline>
<codeline lineno="73"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;16;i++){P_pred[i]=0;}</highlight></codeline>
<codeline lineno="74"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;16;i++){P_est[i]=0;}</highlight></codeline>
<codeline lineno="75"><highlight class="normal"><sp/>P_est[0]=0x7FFF;</highlight></codeline>
<codeline lineno="76"><highlight class="normal"><sp/>P_est[5]=0x7FFF;</highlight></codeline>
<codeline lineno="77"><highlight class="normal"><sp/>P_est[10]=0x7FFF;</highlight></codeline>
<codeline lineno="78"><highlight class="normal"><sp/>P_est[15]=0x7FFF;</highlight></codeline>
<codeline lineno="79"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;2;i++){Y_mes[i]=0;}</highlight></codeline>
<codeline lineno="80"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;2;i++){ukalm[i]=0;}</highlight></codeline>
<codeline lineno="81"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;8;i++){Kalm[i]=0;}</highlight></codeline>
<codeline lineno="82"><highlight class="normal"></highlight></codeline>
<codeline lineno="83"><highlight class="normal"><sp/></highlight><highlight class="keywordflow">for</highlight><highlight class="normal">(i=0;i&lt;16;i++){PSI[i]=0;}</highlight></codeline>
<codeline lineno="84"><highlight class="normal">};</highlight></codeline>
<codeline lineno="86"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKFfixed_1ddf5334bc1207658fd53698fffbac028" kindref="member" tooltip="Here dt = [yt;ut] of appropriate dimensions.">bayes</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;dt<sp/>);</highlight></codeline>
<codeline lineno="88" refid="classEKFfixed_1085cf16c573eda32d8d03619c6c4b518" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><ref refid="classepdf" kindref="compound" tooltip="Probability density function with numerical statistics, e.g. posterior density.">epdf</ref>&amp;<sp/><ref refid="classEKFfixed_1085cf16c573eda32d8d03619c6c4b518" kindref="member" tooltip="dummy!">_epdf</ref>(){</highlight><highlight class="keywordflow">return</highlight><highlight class="normal"><sp/>E;};</highlight></codeline>
<codeline lineno="89" refid="classEKFfixed_1c7fee79e75ad7f0c0e96c5a322cbf44e" refkind="member"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="keywordtype">void</highlight><highlight class="normal"><sp/><ref refid="classEKFfixed_1c7fee79e75ad7f0c0e96c5a322cbf44e" kindref="member" tooltip="Substitute val for rvc.">condition</ref><sp/>(<sp/></highlight><highlight class="keyword">const</highlight><highlight class="normal"><sp/>vec<sp/>&amp;Q0<sp/>)<sp/>{</highlight></codeline>
<codeline lineno="90"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight></codeline>
<codeline lineno="91"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Q[0]=prevod(minQ(Q0(0)),15);<sp/><sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>0.05</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="92"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Q[5]=prevod(minQ(Q0(1)),15);</highlight></codeline>
<codeline lineno="93"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Q[10]=prevod(minQ(Q0(2)),15);<sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>1e-3</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="94"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>Q[15]=prevod(minQ(Q0(3)),15);<sp/><sp/><sp/><sp/><sp/><sp/></highlight><highlight class="comment">//<sp/>1e-3</highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="95"><highlight class="normal"></highlight></codeline>
<codeline lineno="96"><highlight class="normal"><sp/><sp/><sp/><sp/><sp/><sp/><sp/><sp/>}</highlight></codeline>
<codeline lineno="97"><highlight class="normal">};</highlight></codeline>
<codeline lineno="98"><highlight class="normal"></highlight></codeline>
<codeline lineno="99"><highlight class="normal"></highlight></codeline>
<codeline lineno="100"><highlight class="normal"></highlight><highlight class="preprocessor">#endif<sp/>//<sp/>KF_H</highlight></codeline>
<codeline lineno="101"><highlight class="preprocessor"></highlight><highlight class="normal"></highlight></codeline>
<codeline lineno="102"><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="/home/smidl/work/git/mixpp/pmsm/simulator_zdenek/ekf_example/ekf_obj.h"/>
  </compounddef>
</doxygen>
