Skip to main content

A clean, modular Python implementation of Kalman Filters and estimation algorithms.

Project description

kalbee 🐝

kalbee logo

kalbee is a clean, modular Python implementation of Kalman Filters and related estimation algorithms. Designed for simplicity and performance, it provides a standard interface for state estimation in various applications.

✨ Features

  • Standard Kalman Filter (KF): Linear estimation for dynamic systems.
  • Extended Kalman Filter (EKF): Support for non-linear systems using Jacobians.
  • Alpha-Beta-Gamma Filter: Lightweight filtering for kinematic tracking.
  • AutoFilter: Factory pattern for easy filter instantiation.
  • Modular Design: Easy to extend with new filter types.
  • NumPy Integration: Optimized for numerical computations.
  • Robustness: Uses Joseph form for numerically stable covariance updates.

🚀 Installation

You can install kalbee directly from the source:

git clone https://github.com/MinLee0210/kalbee.git
cd kalbee
pip install .

Or using uv (recommended):

uv pip install -e .

🛠️ Quick Start

1. Standard Kalman Filter

import numpy as np
from kalbee.modules.filters import KalmanFilter

# Define matrices
state = np.zeros((2, 1))  # [position, velocity]
cov = np.eye(2)
F = np.array([[1, 1], [0, 1]])  # Constant velocity model (dt=1)
Q = np.eye(2) * 0.01
H = np.array([[1, 0]])          # We measure position
R = np.array([[0.1]])

# Initialize
kf = KalmanFilter(state, cov, F, Q, H, R)

# Predict & Update
kf.predict()
kf.update(np.array([[1.2]]))

print(f"Estimated State:\n{kf.x}")

2. AutoFilter Factory

Easily switch between filters using the AutoFilter factory:

from kalbee.modules.filters import AutoFilter

# Create an EKF
ekf = AutoFilter.from_filter(
    state, cov, Q, R,
    mode='ekf',
    transition_function=my_f,
    measurement_function=my_h
)

📚 Documentation

Detailed documentation and examples can be found in the docs/ directory.

🧪 Testing

Run these commands to test the library:

uv run pytest tests/

📄 License

This project is licensed under the Apache License 2.0.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. Check TODO.md for ideas.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kalbee-0.1.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kalbee-0.1.0-py3-none-any.whl (12.8 kB view details)

Uploaded Python 3

File details

Details for the file kalbee-0.1.0.tar.gz.

File metadata

  • Download URL: kalbee-0.1.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for kalbee-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32721448857cb414361caeebf124fa03ae2ce54480fedd3e76f4118a08b019e3
MD5 37f8426d81040e6564db38c15e4ba7df
BLAKE2b-256 63ed7c6a5fa2c7791a49acd24fd175c73df68e9cb5b38486eb1cc990778de973

See more details on using hashes here.

File details

Details for the file kalbee-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: kalbee-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for kalbee-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 69bf6649cdeb9ea9945523f96c2fe87a50e5f465f3ef1ba2f5df7f2a53ab4056
MD5 03747ea24d14eec51cfbbec55a2cf82d
BLAKE2b-256 ef78e50a4869811af125464b2386fb10464aacf86d20eb85955d2c9629659f12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page