[Vorbis-dev] Qyery on bark equation in floor0 code

Monty xiphmont at xiph.org
Tue Dec 28 14:12:23 PST 2004




On Mon, Dec 20, 2004 at 11:26:32AM +1100, Michael Smith wrote:
> On Friday 17 December 2004 15:25, nagaraja.sreerama at wipro.com wrote:
> > Hi All,
> > I need some clarifications regarding the mismatch I found in the code
> > and the specification.
> >
> > (a) In the specification, the bark(x) equation is given as:
> >
> > bark(x) = 13.1 atan(.00074x) + 2.24 atan(.0000000158(x^2)) + .0001x
> >
> > whereas in the code it is given as:
> >
> > #define toBARK(n)
> > (13.1f*atan(.00074f*(n))+2.24f*atan((n)*(n)*1.85e-8f)+1e-4f*(n))
> >
> > Which one of these is the proper one ?
> 
> The one from the code is what is in wide use - it also matches more closely 
> with the commonly quoted references for this scale. 
> 
> I'm pretty sure this is a typo in the spec - I'll wait to see if Monty replies 
> before changing it, though. Thanks for picking up on it!

Sorry, was on Xmas holiday.

The spec has the digits transposed.  The code is correct.

Monty


More information about the Vorbis-dev mailing list