Extended-Kalman-Filter---Matlab
Versione 0.1 (302 KB) da
Ahmed Mahfouz
Easy implementation of the extended Kalman Filter
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:
- <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>
- <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>.
- <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.
- <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>
- <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.
Cita come
Ahmed Mahfouz (2024). Extended-Kalman-Filter---Matlab (https://github.com/AhmedTahaha/Extended-Kalman-Filter---Matlab/releases/tag/v0.1), GitHub. Recuperato .
Compatibilità della release di MATLAB
Creato con
R2021b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxTag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.
examples
src/@EKF
src/@Filter
Versione | Pubblicato | Note della release | |
---|---|---|---|
0.1 |
Per visualizzare o segnalare problemi su questo componente aggiuntivo di GitHub, visita GitHub Repository.
Per visualizzare o segnalare problemi su questo componente aggiuntivo di GitHub, visita GitHub Repository.