# 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
```rust
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](LICENSE.md))
- Apache License, Version 2.0 (see [LICENSE](LICENSE-APACHE.md))

at your option.
