GithubHelp home page GithubHelp logo

korken89 / biquad-rs Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 12.0 54 KB

A Rust library for digital second order IIR filtrers, also known as biquads

License: Apache License 2.0

Rust 93.65% Python 6.35%

biquad-rs's People

Contributors

a2aaron avatar eriknatanael avatar fhennig avatar korken89 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

biquad-rs's Issues

Support for more filter types?

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.

New release?

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.

How to set the freq range for a bandpass filter

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?

Supporting f64

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 :)

Question On Usage

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.

Implement the rest of the filters described in the Audio EQ Cookbook.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.