rlabbe/filterpy
Python Kalman filtering and optimal estimation library. Implements Kalman filter, particle filter, Extended Kalman filter, Unscented Kalman filter, g-h (alpha-beta), least squares, H Infinity, smoothers, and more. Has companion book 'Kalman and Bayesian Filters in Python'.
What it solves
FilterPy provides a collection of tools for optimal and non-optimal estimation, primarily focusing on Kalman filters. It helps users implement algorithms to estimate the state of a system—such as location or velocity—even when measurements are noisy or uncertain.
How it works
The library uses NumPy and SciPy to perform the underlying mathematical computations. It is designed to be pedagogical, with code structures that closely mirror the equations found in standard estimation literature. Users initialize filter objects with specific matrices (like state transition and measurement noise) and then run a loop that alternates between predicting the next state and updating it with new measurements.
Who it’s for
It is intended for students, researchers, and engineers who need to implement filtering algorithms. It is particularly useful for those following the author's companion book, Kalman and Bayesian Filters in Python, as the library serves as the practical implementation for the concepts taught there.
Highlights
- Includes a wide variety of filters: Kalman, Extended Kalman, Unscented Kalman, Kalman smoothers, Least Squares, fading memory, g-h filters, and discrete Bayes.
- Designed for clarity, with code that maps directly to mathematical equations.
- Built on standard Python scientific libraries (NumPy, SciPy, Matplotlib).
- Includes extensive documentation and is tightly integrated with the author's educational materials.
Related
- Project
- Project
- Project
- Project