A port of the WebAudio API filters to Rust.
Audio or DSP filters, allow you to attenuate or accentuate some frequencies or range of frequencies in a signal. The signal can be of any kind, but in here, we will focus on 1D signals. Like audio signals. There can also occur differences in the signal phases, that vary with the filter and the frequency components of the signal.
This is a port of Audio filters, from Python to Rust. My port was made from TheAlgorithms GitHub in Python (see references below). That is, by it self a port from WebAudio API C++ filters implementation used by the browsers.
- low-pass
- high-pass
- band-pass
- all-pass
- peak
- low-shelf
- high-shelf
- notch
- 10 band equalizer
q_factor = 2 * sqrt(2) = 2.828
q_factor = 2 * sqrt(2) = 2.828
10 Band Equalizer
band_0: 29 Hz, gain: -10 dB
band_1: 59 Hz, gain: 0 dB
band_2: 119 Hz, gain: -5 dB
band_3: 237 Hz, gain: 5 dB
band_4: 474 Hz, gain: 0 dB
band_5: 947 Hz, gain: -5 dB
band_6: 1.889 Hz, gain: 0 dB
band_7: 3.770 Hz, gain: 5 dB
band_8: 7.523 Hz, gain: 10 dB
band_9: 15.011 Hz, gain: 12 dB
To make a project for this files do:
-Install Rust your computer (Linux, Win, Mac, Raspberry Pi).
cargo new audio_filters_in_rust
cd audio_filters_in_rust
-Copy the repository files to this directory and overlap them.
To compile do:
cargo build --release
To run do:
cargo run --release
to run the tests do:
cargo test
-
GitHub - TheAlgorithms / Python / audio_filters
https://github.com/TheAlgorithms/Python/tree/master/audio_filters -
WebAudio - Cookbook formulae for audio equalizer biquad filter coefficients
https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html -
Good resources on DSP – Digital Signal Processing
https://github.com/joaocarvalhoopen/How_to_learn_modern_electronics#dsp--digital-signal-programming -
Biquads - EarLevel
http://www.earlevel.com/main/2003/02/28/biquads/ -
Biquad C++ source code - EarLevel
https://www.earlevel.com/main/2012/11/26/biquad-c-source-code/ -
A biquad calculator v3 - EarLevel
https://www.earlevel.com/main/2021/09/02/biquad-calculator-v3/ -
WebAudio API - Mozilla Docs
https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API -
Audio Filters - Theory and Practice
by Ethan Winer
http://ethanwiner.com/filters.html -
Audio filter - Wikipedia
https://en.wikipedia.org/wiki/Audio_filter -
Electronic filter - Wikipedia
https://en.wikipedia.org/wiki/Electronic_filter
10 Bands Equalizer
-
Making an EQ from cascading filters
https://dsp.stackexchange.com/questions/10309/making-an-eq-from-cascading-filters -
Peak / Notch filter design
https://www.dsprelated.com/showcode/169.php -
The Equivalence of Various Methods of Computing
Biquad Coefficients for Audio Parametric Equalizers
http://www.thesounddesign.com/MIO/EQ-Coefficients.pdf -
How to learn modern Rust
https://github.com/joaocarvalhoopen/How_to_learn_modern_Rust
- MIT Open Source License, like the original license from
GitHub - TheAlgorithms / Python / audio_filters
https://github.com/TheAlgorithms/Python/tree/master/audio_filters
Best regards,
Joao Nuno Carvalho