你好!
在相关线程中、我能够确认是否有可能使用 MSP_Mac_Q15通过 LEA 应用具有 940个样本的两个矢量的 MAC 操作、因为它至少需要一个 Q31变量将结果存储在.leaRAM 中。 再次感谢 TI 的支持!
但我在测试中看到错误的结果。 例如、使用一个一向量+一个直流值为10的向量执行 MAC 操作、这两个向量都具有940个样本、它将返回18800、是预期值9400的两倍。
示例代码:
#define LEN 940 DSPLIB_DATA(x, 4) static int16_t x[940]; DSPLIB_DATA(y, 4) static int16_t y[940]; DSPLIB_DATA(mac, 4) static int32_t mac; static msp_status Status; static msp_mac_q15_params MacSumParams; for (uint16_t i = 0; i < LEN; i++) { x[i] = 10; y[i] = 1; } MacSumParams.length = LEN; Status = msp_mac_q15(&MacSumParams, x, y, &(mac)); msp_checkStatus(Status); // Breakpoint here and watch mac
我已经阅读 了有关 MSP DSP 库:真实矢量(TI.com)的文档 、它显示了以下预期操作:
伪代码: result = sum(srcA .* srcB)
为什么我看到这种错误的结果?
Thank you and best regards,
-
罗德里戈