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

Download history 246/week @ 2026-05-28 243/week @ 2026-06-04

489 downloads per month

BSD-3-Clause OR Apache-2.0

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

  • BSD-3-Clause License (see LICENSE)
  • Apache License, Version 2.0 (see LICENSE)

at your option.

Dependencies

~4MB
~81K SLoC