[Speex-dev] math_approx.c

Jean-Marc Valin jean-marc.valin at usherbrooke.ca
Wed Aug 1 04:26:12 PDT 2007


Oleg Homenko a écrit :
> Hi,
> I started to optimize math_approx fixed point functions to ARM CPU. And
> found out that approximations are not Taylor series, 

That's right.

for example:
> spx_exp2(x) = D0 + D1*x + D2*x^2 +D3*x^3,
> where D0 = 1, D1 = log(2), D2 = (log(2))^2 / 2, D3 = (log(2))^3 / 6 for
> Taylor serie,
> but Speex source code uses different coefficients:
> D0 = 1, D1 = log(2), D2 = 3 - 4*log(2), D3 = 3*log(2) - 2
> 
> Can anyone explain the difference? Was it done to equalize error along
> range? How were obtained D2 and D3?

It's actually a polynomial fit. That's better than Taylor series
because, as you say, the error is better distributed.

	Jean-Marc


More information about the Speex-dev mailing list