CSI-DSP  Version 1.0.0
CSI DSP Software Library
Functions
Log Series Functions.

Functions

float64_t csky_log10_f64 (float64_t x)
 Fast approximation to the 10 base logarithm function for float64_t -point data. More...
 
float64_t csky_log2_f64 (float64_t x)
 Fast approximation to the 2 based logarithm function for float64_t -point data. More...
 
float64_t csky_log_f64 (float64_t x)
 Fast approximation to the 2 based logarithm function for float64_t -point data. More...
 

Description

Logarithm series functions includes log, log2 and log10, which are represented e based, 2 based and 10 based logarithm function repectively. As exponentional functions, the common methods to compute these functions are ploynomial approximation and table loop-up. And, it is a double floating version for the functions, say, the input and output are both double.

Function Documentation

float64_t csky_log10_f64 ( float64_t  x)
Parameters
[in]xinput value in double.
Returns
log10(x).

The implementation is based on base transform from 10 to e.

The steps used are:

  1. Processing of the special cases.
  2. The base transform is used to compute the result of log10(x).
float64_t csky_log2_f64 ( float64_t  x)
Parameters
[in]xinput value in double.
Returns
log2(x).

The implementation is based on the transform

log2(x)  = log2^k*(1+f)       where sqrt(2)/2 < 1+f < sqrt(2)
         = k + log(1+f)/log2. And then
log(1+f) = log(1+s) - log(1-s), where s = f/(1+f)
         = 2s + 2/3 s**3 + 2/5 s**5 + .....,
         = 2s + s*R
where R(z) ~ Lg1*s +Lg2*s +Lg3*s +Lg4*s +Lg5*s  +Lg6*s  +Lg7*s

So the steps used are:

  1. First, compute the value of k, while (1+f) should between sqrt(2)/2 and sqrt(2).
  2. Then, compute the value of R.
  3. Finally, compute the log2(x), and the processing of special case.
float64_t csky_log_f64 ( float64_t  x)
Parameters
[in]xinput value in double.
Returns
log(x).

The implementation is based on range of abs(x-1), when abs(x-1) < 0.03, series expansion is used, and when abs(x-1) > 0.03 series expansion combining with table loop up is used.

The steps used are:

  1. First, the processing of special cases.
  2. Then, compute the result when abs(x-1) < 0.03.
  3. Finally, compute the result when abs(x-1) > 0.03.