Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Embedded-Kalman-Filter

Deterministic scalar discrete Kalman filter implementation in C99 designed for resource-constrained microcontrollers.

Design Constraints

  • Zero dynamic memory allocation (malloc free).
  • Constant time execution: $\mathcal{O}(1)$ runtime complexity.
  • Static state footprint: 20 bytes on 32-bit architectures.

Mathematical Formulation

1. State Prediction

$$\hat{x}_{k\vert{}k-1} = \hat{x}_{k-1\vert{}k-1}$$ $$P_{k\vert{}k-1} = P_{k-1\vert{}k-1} + Q$$

2. Measurement Update

$$K_k = \frac{P_{k\vert{}k-1}}{P_{k\vert{}k-1} + R}$$ $$\hat{x}_{k\vert{}k} = \hat{x}_{k\vert{}k-1} + K_k (z_k - \hat{x}_{k\vert{}k-1})$$ $$P_{k\vert{}k} = (1 - K_k) P_{k\vert{}k-1}$$

Build & Run

cmake -B build
cmake --build build
./build/bench_kalman

On Windows with the MSYS2 MinGW toolchain, use PowerShell:

cmake -B build -G "MinGW Makefiles"
cmake --build build
.\build\bench_kalman.exe

Plot Results

Install the Python plotting dependency once:

python -m pip install matplotlib

After building the benchmark, generate the convergence plot from its live output:

python .\graph.py

This saves convergence_plot.png in the project directory. You can choose another output path with python .\graph.py --output path\to\plot.png.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages