Other Parts Discussed in Thread: MATHLIB
Tool/software: TI-RTOS
Hi
I need to get " log10 " in my program but i couldn't find any library.
What sould I do?
Best Reards
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI-RTOS
Hi
I need to get " log10 " in my program but i couldn't find any library.
What sould I do?
Best Reards
Hi
Thanks, I saw the general RTS library function in " spru187n.pdf ".
I need a C64+ DSP architecture optimized function, Please guide me.
Regards
Dariush,
Have you tried the standard run-time support library?
Our documentation is not as robust as it once was, so we do not include documentation of all of the standard C library routines. We do support all standard C library routines, though. Doing an online search for "c library log10" found this tutorial. It includes a simple code example. Please let us know if you are able to get this build and have any other questions.
Regards,
RandyP
Using math.h and mathf.h, this is useful and gives answer in 101 CPU clock cycles per sample.
#include <math.h> #include <mathf.h> _out = log10f(_in);
the other alternative suggested is great too. using logf() / logf(10)
temp = (float) 1/ logf(10); // calculated once - before the for loop of an array for (i = 0; i < BUFFER; i++) _out[i] = logf(_in[i])*temp;
This gave me 84 cycles per floating point sample. Mathlib.lib has functions logsp and log10sp calculating faster than above mentioned. The following gave me logarithm base-10 in 72 cycles.
#include <ti/mathlib/src/common/drvsp.h> #include <ti/mathlib/src/log10sp/log10sp.h> for (i = 0; i < BUFFER; i++) _out[i] = log10sp(_in[i]);