Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Adaptif
Rust crate for DSP Adaptive Filters with Python bindings.
Overview
This project contains Rust implementations of adaptive filtering algorithms, with bindings for Python. Currently, the following algorithms are supported:
| Adaptive Filter Algorithm | Status |
|---|---|
| Least Mean Squares (LMS) | ✔ |
| Normalized Least Mean Squares (NLMS) | ✔ |
| Recursive Least Squares (RLS) | ✔ |
| Affine Projection Algorithm (APA) | in progress |
We're also working on real-time processing and no_std functionality for use in embedded systems, which are planned for the next major release.
Installation
The projects currently supports Rust stable (no MSRV) and Python 3.11 - 3.15.
Rust crate
Via crates.io:
Python bindings
Via PyPI:
# With uv (preferred).
# With pip.
Usage
This section shows basic examples for a least mean squares (LMS) filter in Rust and Python.
Here:
-
input_signalis the desired/noisy signal. Commonly referred to asd(n)in mathematical notation. -
noise_refis the reference noise signal. Commonly referred to asx(n)in mathematical notation.
More examples can be found in examples/.
Rust
use ;
use ;
// Sample inputs
let input_signal = new?;
let noise_ref = new?;
// Initialize the filter
let mut lms = new?;
// Adapt the filter to the inputs and get the iteratively cleaned signal.
let cleaned_signal = lms.adapt?;
Ok
Python
# setting up filter
=
# Assuming signals are already present and named accordingly
=
Contributing
See CONTRIBUTING.md for setup and contribution guidelines.
In short,
- Open an issue for a discussion. We will likely handle it.
- Undisclosed AI PRs will be closed and no further PRs from said user will be considered.
Citation
If you found any of this helpful, feel free to cite it, or just send us an email.