korken89 / biquad-rs Goto Github PK
View Code? Open in Web Editor NEWA Rust library for digital second order IIR filtrers, also known as biquads
License: Apache License 2.0
A Rust library for digital second order IIR filtrers, also known as biquads
License: Apache License 2.0
Hi,
Thanks for making this library available.
I'm just starting to try it out. My goal is to use it to create bandpass filters.
I noticed however, that there is only one freq parameter in the Coefficients struct: f0
.
How does one determine the lower and upper frequency ranges for a bandpass filter ?
For now I've set f0
to the middle of my desired frequency range. Any suggestions?
Hi, it's me again! I was wondering if you could push the changes to crates.io? As something like 0.3.1 or 0.4.0, that would be great! I don't know how to help with that.
Hello, thank you for your work.
I would like to use this crate with discrete-time audio samples.
What is the floating point input value n supposed to represent in the Biquad::run(n) function? Can this be a sample? If so is there a range (for example -1.0..1.0) that works best?
I'd appreciate any guidance in this matter.
Hi!
First of all, thank you very much for this crate! I'm new to signal processing and this works like a charm!
I was wondering if it was possible to implement other filter types? In a few online resources such as this one I saw that there are other filter types such as peak, low shelf and high shelf.
I had a go at implementing the peak filter myself, but it is not working (I don't hear any change in the signal). I used this code:
let omega_s = omega.sin();
let omega_c = omega.cos();
let alpha = omega_s / (2.0 * q_value);
let gain_abs = 10.0f32.powf(1. / 40.);
let beta = (gain_abs + gain_abs).powf(0.5);
let b0 = 1.0 + (alpha * gain_abs);
let b1 = -2.0 * omega_c;
let b2 = 1.0 - (alpha * gain_abs);
let a0 = 1.0 + (alpha / gain_abs);
let a1 = -2.0 * omega_c;
let a2 = 1.0 - (alpha / gain_abs);
I was following this reference implementation in java, which is very similar to the code that is already in the crate.
Since it is not working, and it is also not implemented so far, I was wondering if there are some inherent problems with these filters? They are listed along with the already implemented types in here: https://shepazu.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html as well, so I'm a bit confused.
The Audio EQ Cookbook has a few extra filters not currently implemented in this crate. These are the low shelf filter, the high shelf filter, the peaking EQ filter, and the all pass filter. These seem pretty simple to add. These filters are useful in audio EQing since these allow for a bit more control on how much the filter reduces/adds the signal via a gain parameter.
On the docs page for biquad::coefficients
, it says that the coefficient formulas used for the 2nd order filters are taken from the "Audio EQ Cookbook" and links http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt. However, this link does not work.
However, it looks like there exists this page: https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbook.html. This page seems to have the same information as the one that the docs reference.
Hello,
I am currently using your crate (thanks by the way) in a project.
But I am handling f64 everywhere, which has forced me to make manual changes to the crate.
The other solution (casting to f32 and back to f64) is impossible in my case.
So is it possible to make the crate generic to the type of float being used?
Cheers :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.