#filter #dsp #complex-numbers #svf

simper-filter

纯Rust实现的实时音频状态变量滤波器

1个不稳定版本

0.1.0 2023年10月19日

#763音频

MIT/Apache

23KB
442 代码行

simper-filter

纯Rust实现的实时音频状态变量IIR滤波器。基于Andrew Simper (Cytomic)的滤波器设计。

示例

use simper_filter::Svf;

// initialize filter with parameters
let mut filter = Svf::new(FilterType::Lowpass, 44100.0, 400.0, 0.771, 0.0);

// update filter with new parameters
filter.set(FilterType::Lowpass, 44100.0, 400.0, 0.771, 0.0);

// get response for specific frequency as complex number
let response = filter.get_response(400.0);

// process a whole buffer
let input = vec![0.0; 100];
let mut output = vec![0.0; 100];
filter.process(&input, &mut output);

// or process on sample basis
for sample in output.iter_mut() {
    *sample = filter.tick(*sample);
}

依赖项

~0.5–1MB
~23K SLoC