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.

[参考译文] TMS320F28069M:_IQacos 和_IQasin 函数计算错误

Guru**** 2342590 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/589781/tms320f28069m-_iqacos-and-_iqasin-function-calculation-error

器件型号:TMS320F28069M

我正在使用 IQmath 库的三角函数。 根据我的观察、_IQcos 和_IQsin 函数正常工作。 但是、对于_IQacos 和_IQasin 函数、我在输出端获得意外结果。 下面是我使用的代码:

_iq output1_IQ;
_iq output2_IQ;

_iq input1_iq;
_iq input2_iq;

Output1_IQ =_IQacos (input1_IQ);
output2_IQ =_IQasin (input2_IQ);

我使用 IQ24作为全局 Q 格式。 在下表中、您可以看到_IQacos 和_IQasin 函数的输入值。 您还可以在这些函数中看到预期结果和获得的结果。  

             _IQacos              _IQasin  
输入 预期 获得的 预期 获得的
0 1、5707963268 0、3140258789 0、0 1、2567704320
0、70710678 0、7853981634 0、2618502378 0、7853981634 1、3089460730
0、8660254 0、5235987756 -1、1154794100 1、0471975512. 2、6862757210
1 0、0 2、5135409830 1、5707963268 -0、9427446723
-0、707107 2、3561944902 2、8797424440 -0、7853981634 1、3089461330
-0、866025 2、6179938780 -3,7429279090 -1,0471975512. -2、6862757800
-1 3、1415926536 0、6280516982 -1,57079632668 0、9427446127

此问题的原因应该是什么? 如何解决此问题?

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您的预期结果是正确的、这就是我在 F28069上看到的结果。  arcos 和 arcsin 函数使用查找表。  这些可能未在链接器命令文件中正确指定。  对于 F28069、您应该具有如下所示的内容:

    IQMath:>RAML1,page = 0
    IQmathTables :>IQTABLES,PAGE = 0,TYPE = NOLOAD

    有关更多详细信息、请参阅 IQmath 用户指南中的第3.5节。

    此致、

    Richard

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。
    非常感谢、我已经完全解决了您刚才提到的问题。

    此致