Search code examples
algorithmmatlabmathoctavenumerical

Get equidistant intervals on approximated bark scale


Wikipedia says we can approximate Bark scale with the equation:

b(f) = 13*atan(0.00076*f)+3.5*atan(power(f/7500,2))

How can I divide frequency spectrum into n intervals of the same length on Bark scale (interval division points will be equidistant on Bark scale)?

The best way would be to analytically inverse function (express x by function of y). I was trying doing it on paper but failed. WolframAlpha search bar couldn't do it also. I tried Octave finverse function, but I got error.

Octave says (for simpler example):

octave:2> x = sym('x');
octave:3> finverse(2*x)
error: `finverse' undefined near line 3 column 1

This is finverse description from Matlab: http://www.mathworks.com/help/symbolic/finverse.html

There could be also numerical way to do it. I can imagine that you just start from dividing the y axis equally and search for ideal division by binary search. But maybe there are some existing tools that do it?


Solution

  • You need to numerically solve this equation (there is no analytical inverse function). Set values for b equally spaced and solve the equation to find the various f. Bissection is somewhat slow but a very good alternative is Brent's method. See http://en.wikipedia.org/wiki/Brent%27s_method