请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
器件型号:TMS320C6455 主题中讨论的其他器件:MATHLIB
工具/软件:TI-RTOS
你(们)好
我需要在程序中获取" log10 "、但找不到任何库。
我该怎么办?
最佳佩戴方式
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.
工具/软件:TI-RTOS
你(们)好
我需要在程序中获取" log10 "、但找不到任何库。
我该怎么办?
最佳佩戴方式
使用 math.h 和 mathf.h、这很有用、并且在每个样本101个 CPU 时钟周期内给出了答案。
#include #include _out = log10f (_in);
建议的另一种选择也很好。 使用 logf()/logf(10)
temp =(float) 1/ logf (10);//在 (i = 0;i < buffer;i++) _out[i]= logf (_in[i])*temp 的数组 for 循环之前计算一次;
这为我提供了每个浮点样本84个周期。 Mathlib.lib 的函数 logsp 和 log10sp 的计算速度快于上述内容。 下面给出了72个周期内的对数、以10为基础。
#include #include 对于(i = 0;i < buffer;i++) _out[i]= log10sp (_in[i]);