Extended-Kalman-Filter---Matlab

版本 0.1 (302.0 KB) 作者: Ahmed Mahfouz
Easy implementation of the extended Kalman Filter
356.0 次下载
更新时间 2022/3/1

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

引用格式

Ahmed Mahfouz (2025). Extended-Kalman-Filter---Matlab (https://github.com/AhmedTahaha/Extended-Kalman-Filter---Matlab/releases/tag/v0.1), GitHub. 检索时间: .

MATLAB 版本兼容性
创建方式 R2021b
兼容任何版本
平台兼容性
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
0.1

要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库
要查看或报告此来自 GitHub 的附加功能中的问题,请访问其 GitHub 仓库