/audio-filters

A collection of filters for real-time audio processing

Primary LanguageRustOtherNOASSERTION

Audio Filters - WIP

A collection of filters for real-time audio processing

The overall design is in progress, there can be frequent (usually minor) breaking changes.

Feature Progress

  • #![no_std] (via libm)
  • f32 & f64 capable (via num-traits)
  • SIMD (Some experimental support)
  • Documentation
  • Tests

Filter Types

  • Bell
  • Low Pass
  • High Pass
  • Low Shelf
  • High Shelf
  • Notch
  • Band Pass
  • All Pass
  • Higher Order Bell
  • Higher Order Band Pass
  • Asymmetrical
  • Tilt
  • Flat Tilt

Filter Features

  • Bode Plot (phase & amplitude)
  • 1st and 2nd order filter primitives
  • Higher orders via cascading
  • Virtual analog (VA) State Variable Filters (SVF) for both 1st & 2nd order IIR.
  • Linkwitz-Riley filters
  • Elliptic filters
  • Phase aligned crossovers
  • Decramping near nyquist
  • Minimum Phase IIR Mode
  • Linear Phase Mode
let sample_rate_hz = 48000.0;
let cutoff_hz = 1000.0;
let gain_db = 6.0;
let width_oct = 1.0;
let order = 4.0;

let coeffs = FilterBandCoefficients::highshelf(cutoff_hz, gain_db, width_oct, order, sample_rate_hz);

let mut filter_left = FilterBand::from(&coeffs);
let mut filter_right = FilterBand::from(&coeffs);

for i in 0..1000 {
    left[i] = (filter_left.process)(&mut filter_left, left[i]);
    right[i] = (filter_right.process)(&mut filter_right, right[i]);
}