pub fn process_1pole_lowpass(
    input: f32,
    freq: f32,
    israte: f32,
    z: &mut f32
) -> f32
Expand description

Process a very simple one pole 6dB low pass filter. Useful in various applications, from usage in a synthesizer to damping stuff in a reverb/delay.

  • input - Input sample
  • freq - Frequency between 1.0 and 22000.0Hz
  • israte - 1.0 / samplerate
  • z - The internal one sample buffer of the filter.
    use synfx_dsp::*;

    let samples  = vec![0.0; 44100];
    let mut z    = 0.0;
    let mut freq = 1000.0;

    for s in samples.iter() {
        let s_out =
            process_1pole_lowpass(*s, freq, 1.0 / 44100.0, &mut z);
        // ... do something with the result here.
    }