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

Sebastian Gesemann sgeseman at uni-paderborn.de
Tue Dec 28 15:14:45 PST 2004


On Tue, 28 Dec 2004, Monty wrote:
> 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.

They are not equivalent. See the first formula: the last 
"0.0001x" is *outside* the ATAN().

> Monty


Ghis!
Sebastian

--
PGP-Key-ID (long): 572B1778A4CA0707



More information about the Vorbis-dev mailing list