Extended-Kalman-Filter---Matlab

Version 0.1 (302 KB) von Ahmed Mahfouz
Easy implementation of the extended Kalman Filter
323 Downloads
Aktualisiert 1. Mär 2022

Extended-Kalman-Filter---Matlab

This repo implements the extended Kalman Filter class which is a multi-purpose EKF to facilitate the implementation and verification of EKFs in Matlab for the post-processing setting.

The user has to define the following functions, and then pass them to the class initializer in order to build an instant of the EKF class:

  1. <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$[\pmb{y}_{k|k-1},\pmb{\Phi}_{k-1\rightarrow k}]$</math-renderer> = <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\text{st\_model}(t_{k-1}, t_{k}, \pmb{y}_{k-1|k-1}, \pmb{P}_{k-1|k-1})$</math-renderer>, which is a propagation function of the state vector. The output of this function must be <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{y}_{k|k-1}$</math-renderer>, the predicted value of the state vector, and <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{\Phi}_{k-1\rightarrow k}$</math-renderer> where <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{\Phi}_{k-1\rightarrow k}$</math-renderer> is the state transition matrix between the two time instants <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$t_{k-1}$</math-renderer> and <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$t_{k}$</math-renderer>
  2. <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{z}_{k}$</math-renderer> = <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\text{meas}(t_k)$</math-renderer> which is a function that returns the measurement vector at time <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$t_k$</math-renderer>.
  3. <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$[\pmb{H}_k, \pmb{H}_k, \pmb{z}_k]$</math-renderer> = <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\text{meas\_model}(t_{k}, \pmb{y}_{k|k-1}, \pmb{z}_k)$</math-renderer>: is the measurement model function. The output must be the vector <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{H}_k$</math-renderer> of modeled measurements, the matrix <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{H}_k = \frac{\partial \pmb{H}_k}{\partial \pmb{y}_k}$</math-renderer>, and optionally the measrement vector after removing outlaiar measuremets.
  4. <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{Q}_{k}$</math-renderer>, the state model covarience matrix (constant or callable), <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{Q}(t_{k}, \pmb{y}_{k|k-1})$</math-renderer>
  5. <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{R}_{k}$</math-renderer>: measurement covarience matrix (constant or callable), <math-renderer class="js-inline-math" style="display: inline" data-static-url="https://github.githubassets.com/static" data-run-id="84b5bd432c93d3ab9960635ca19df3f2">$\pmb{R}(t_{k}, \pmb{z}_{k})$</math-renderer>

The EKF class has some visualization cababilities, which are illustrated in the example.

View Extended-Kalman-Filter---Matlab on File Exchange

Zitieren als

Ahmed Mahfouz (2024). Extended-Kalman-Filter---Matlab (https://github.com/AhmedTahaha/Extended-Kalman-Filter---Matlab/releases/tag/v0.1), GitHub. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2021b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
0.1

Um Probleme in diesem GitHub Add-On anzuzeigen oder zu melden, besuchen Sie das GitHub Repository.
Um Probleme in diesem GitHub Add-On anzuzeigen oder zu melden, besuchen Sie das GitHub Repository.