MWEngine icon indicating copy to clipboard operation
MWEngine copied to clipboard

biquad lp and hp filter

Open scar20 opened this issue 3 years ago • 2 comments

I have made two biquad filter with resonnane from this source: https://www.musicdsp.org/en/latest/Filters/259-simple-biquad-filter-from-apple-com.html which I've incorporated into a stripped MWEngine Filter.

My assignment is to port Fonofone, an iOs app to Android. They use a peticuliar filter controlled with a x-y controler and all they told me is that it was Apple code and they combined lp and hp to build the "lump".

The result is now quite close, the filters are 12db/oct but can be cascaded. I was considering cascading X2 to get 24db/oct but they have also a +25db Q and I dont know if cascading will affect also this value. With hi Q, the combination of the two filters give a quite strong resonnance already.

Of course, I can provide the code if you are interested, but as I'm new to git, I dont know yet how to extract just the needed part. At least you can take a look at the example - which is a modified MWEngineActivity; the two filters combi are on the "upper" sound with the spinner - 3 sounds (but "guitare" just didnt want to play I dont know why). Also, my lack of knowledge of git made me push the whole MWEngine repository, which is not what I was indended, sorry about that. So you'll decide of you want them to include in the lib, they have ugly name: ABiquadLPFilter and ABiquadHPFilter... https://bitbucket.org/androfone/filtertest/src/filter/

scar20 avatar Apr 21 '21 10:04 scar20

Thanks for this addition. I'll put it on my TODO list to see if this can be extracted in a reusable manner. Judging from the code this should be an easy task but I think it might be worthwhile to check whether this could be an alternate mode of the existing filter just to offer more flexibility from a single processor.

igorski avatar May 10 '21 18:05 igorski

Well I can say I've been lucky since this is from musicdsp.org which fave the reputation of having old or broken code and most of all, I don't have experience with dsp. I mean I'm a user of dsp (like in max or in with analog real devices) but I barely know the theory of it. Right now, I've begun studying it. It make me feel when the first time I was looking at OpenGL matrix. Now its the Euler equation and imaginary number that I must get.

Indeed, those filters are very similar to Filter. Probably it would be better to have an option to make Filter either low or hi pass inverting one of the term (which I don't know how to do yet) and not clutter the library with almost identical processes. Or maybe a generic filter with a constructor having an algorithm choice from an enum with or without resonance as an option.

scar20 avatar May 11 '21 01:05 scar20