3 releases
Uses new Rust 2024
| 0.1.2 | Mar 16, 2026 |
|---|---|
| 0.1.1 | Mar 15, 2026 |
| 0.1.0 | Mar 15, 2026 |
#2603 in Algorithms
489 downloads per month
105KB
2.5K
SLoC
impiir
Digital filter design for Rust.
Features
- Filter design — digital IIR filter generation matching industry-standard algorithms:
- Butterworth — maximally flat passband, no ripple
- Chebyshev Type I — equiripple passband, sharper rolloff than Butterworth
- Chebyshev Type II — flat passband, equiripple stopband
Design a filter and apply it
use impiir::{ButterworthFilter, SosFilterBuilder, FilterPadding};
// Design a 4th-order Butterworth lowpass at 100 Hz (fs = 1000 Hz)
let sos = ButterworthFilter::new(4)
.lowpass(100.0)
.sample_rate(1000.0)
.sos()?;
SOS vs BA
Always prefer SOS output (.sos()) over BA (.ba()) for orders above 4. The second-order section representation avoids the numerical precision issues that accumulate when multiplying high-order polynomial coefficients together.
This project is licensed under either of
at your option.
Dependencies
~4MB
~81K SLoC