STM32F1 CMSIS DSP Basic Math Functions

Started by tha, July 13, 2021, 01:28:14 PM

Previous topic - Next topic

tha


tha


tha

file:///D:/System%20Workbench/STM32CubeF1-master/Drivers/CMSIS/docs/DSP/html/group__dot__prod.html



Description

คำนวณ the dot product ของ two vectors. The vectors ถูกคูณ element-by-element และจากนั้นถูกรวม.

    sum = pSrcA[0]*pSrcB[0] + pSrcA[1]*pSrcB[1] + ... + pSrcA[blockSize-1]*pSrcB[blockSize-1]

มีฟังชั่นที่แยกกันสำหรับ floating-point, Q7, Q15, and Q31 data types.


tha


tha



Scaling and Overflow Behavior:

The intermediate multiplications อยู่ใน 1.15 x 1.15 = 2.30 format และผลลัพธ์เหล่านี้ถูกบวกไปยัง a 64-bit accumulator ใน 34.30 format. Nonsaturating additions ถูกใช้และถูกให้ว่ามี 33 guard bits ใน the accumulator ไม่มีความเสี่ยงของ overflow. The return result อยู่ใน 34.30 format.

References __SIMD32, __SMLALD(), and blockSize.

tha



Scaling and Overflow Behavior:

The intermediate multiplications อยู่ใน 1.31 x 1.31 = 2.62 format และเหล่านี้ถูกตัดเป็น 2.48 format โดยการทิ้ง the lower 14 bits. The 2.48 result จากนั้นถูกบวกโดยไม่มีการอิ่มตัวไปยัง a 64-bit accumulator ใน 16.48 format. มี 15 guard bits ใน the accumulator และไม่มีความเสี่ยงขอ overflow ตราบเท่าที่ความยาวของ the vectors น้อยกว่า 2^16 elements. The return result อยู่ใน 16.48 format.

References blockSize.

tha



Scaling and Overflow Behavior:

The intermediate multiplications อยู่ใน 1.7 x 1.7 = 2.14 format และผลลัพธ์เหล่านี้ถูกบวกไปยัง an accumulator ใน 18.14 format. Nonsaturating additions ถูกใช้และไม่มีอันตรายของการพันรอบตราบเท่าที่ the vectors ยาวน้อยกว่า 2^18 elements. The return result อยู่ใน 18.14 format.

References __SIMD32, __SMLAD(), __SXTB16(), and blockSize.