Custom EQ AudioUnit on iOS

AudioUnit's only effect on iOS is iTunes EQ, which allows you to use EQ presets. I would like to use custom eq in my sound graph

I stumbled upon this question on this question and saw an answer suggesting using this DSP code in a render callback. It looks promising, and people seem to be using it effectively across platforms. However, my implementation has a ton of noise even with a flat equation.

Here's my 20-line integration into the MixerHostAudio class of the Apple MixerHost application (all in one commit):

https://github.com/tassock/mixerhost/commit/4b8b87028bfffe352ed67609f747858059a3e89b

Any ideas on how I can make this work? Any other EQ integration strategies?

Edit: Here is an example of the distortion I experience (with the equator): http://www.youtube.com/watch?v=W_6JaNUvUjA

+6
ios objective-c audio core-audio audiounit
source share
2 answers

In EQ3Band.c code, EQ3Band.c coefficients are used without initialization. The init_3band_state method initializes only the gain and frequency, but the coefficients themselves are es->f1p0 , etc. They are not initialized and therefore contain some garbage values. This can be the cause of poor performance.

0
source share

This code seems to be incorrect in more than one way.

A digital filter is usually represented by filter coefficients, which are a constant , a filter of the history of the internal state (since in most cases the output depends on the history) and the filter topology , which is the arithmetic used to calculate the output based on input and filter (coeffs + state history). In most cases, and, of course, when filtering audio data, you expect to get 0 on the output if you feed 0 to the input.

Problems in the code you are attached to:

  • In each processing method call, the filter coefficients are changed :

    es-> f1p0 + = (es-> lf * (sample-es-> f1p0)) + vsa;

  • The input pattern is usually multiplied by the filter coefficients, and not added to them. This makes no physical sense - the pattern and filter coefficients do not even have the same physical units.

  • If you feed 0, you will not get 0 in the output, just some values ​​that don't make any sense.

I suggest you look for another code - another option debugs it, and it will be harder.

In addition, it will be useful for you to read about digital filters:

http://en.wikipedia.org/wiki/Digital_filter

https://ccrma.stanford.edu/~jos/filters/

0
source share