
特别说明:完整45期数字信号处理教程,原创高性能示波器代码全开源地址:链接 第14章 SupportFunctions的使用(二) 本期教程主要讲解支持函数中的Q7,Q15和Q31分别向其它类型数据转换。 14.1 定点数Q7转换 14.2 定点数Q15转换 14.3 定点数Q31转换 14.4 总结 14.1 定点数Q7转换14.1.1 arm_q7_to_float 公式描述: pDst[n] = (float32_t) pSrc[n] / 128; 0 <= n < blockSize. 函数定义如下: void arm_q7_to_float(q7_t * pSrc, float32_t * pDst, uint32_t blockSize) 参数定义: [in] *pSrc points to the Q7 input vector [out] *pDst points to the floating-point output vector [in] blockSize length of the input vector 14.1.2 arm_q7_to_q31 公式描述: pDst[n] = (q31_t) pSrc[n] << 24; 0 <= n < blockSize. 函数定义如下: void arm_q7_to_q31(q7_t * pSrc, q31_t * pDst, uint32_t blockSize) 参数定义: [in] *pSrc points to the Q7 input vector [out] *pDst points to the Q31 output vector [in] blockSize length of the input vector 14.1.3 arm_q7_to_q15 公式描述: pDst[n] = (q15_t) pSrc[n] << 8; 0 <= n < blockSize. 函数定义如下: void arm_q7_to_q15(q7_t * pSrc, q15_t * pDst, uint32_t blockSize) 参数定义: [in] *pSrc points to the Q7 input vector [out] *pDst points to the Q15 output vector [in] blockSize length of the input vector 14.1.4 实例讲解 实验目的: 1. 学习SupportFunctions中Q7格式数据的转换 实验内容: 1. 按下按键K1, 串口打印函数DSP_Q7的输出结果 实验现象: 通过窗口上位机软件SecureCRT(V5光盘里面有此软件)查看打印信息现象如下: ![]() 程序设计:
|
14.2.2 arm_q15_to_q31
14.2.3 arm_q15_to_q7
14.2.4 实例讲解
14.3.2 arm_q31_to_q15
14.3.3 arm_q31_to_q7
14.3.4 实例讲解