simper-filter

Crates.iosimper-filter
lib.rssimper-filter
version0.1.0
sourcesrc
created_at2023-10-19 07:27:40.783706
updated_at2023-10-19 07:27:40.783706
descriptionState Variable Filters for real-time audio in pure Rust
homepagehttps://neodsp.com/
repositoryhttps://github.com/neodsp/simper-filter/
max_upload_size
id1007539
size22,058
Stephan Eckes (steckes)

documentation

README

simper-filter

State Variable IIR Filters for real-time audio in pure Rust. Based on the filter design by Andrew Simper (Cytomic).

Example

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);
}
Commit count: 13

cargo fmt