STM32F1 CMSIS DSP Matrix Functions

Started by tha, July 20, 2021, 07:01:47 AM

Previous topic - Next topic

tha

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



Description

Matrix multiplication ถูกกำหนดเฉพาะถ้าจำนวนของ columns ของ the first matrix เท่ากันกับจำนวนของ rows ของ the second matrix. การคูณ an M x N matrix ด้วย an N x P matrix ได้ผลใน an M x P matrix. เมื่อ matrix size checking ถูกเปิดการใช้งาน, the functions จะเช็ค: (1) ว่า the inner dimensions ของ pSrcA และ pSrcB เท่ากัน; และ (2) ว่าขนาดของ the output matrix เท่ากับ the outer dimensions ของ pSrcA และ pSrcB.

tha


tha



Returns

The function คืนค่าอย่างใดอย่างหนึ่ง ARM_MATH_SIZE_MISMATCH หรือ ARM_MATH_SUCCESS ขึ้นอยู่กับผลที่ออกมาของ size checking.

Conditions for optimum performance

Input, output and state buffers ควรถูกวางแนวโดย 32-bit

Restrictions

ถ้า the silicon ไม่รองรับ unaligned memory access enable the macro UNALIGNED_SUPPORT_DISABLE  ในกรณีนี้ input, output, scratch buffers ควรถูกวางแนวโดย 32-bit

Scaling and Overflow Behavior:

The function ถูกจัดให้มีใช้โดยใช้ a 64-bit internal accumulator. The input เพื่อ  the multiplications อยู่ใน 1.15 format และการคูณให้ผล a 2.30 result  The 2.30 intermediate results ถูกสะสมใน a 64-bit accumulator ใน 34.30 format. การเข้าใกล้นี้จัดให้มี 33 guard bits และไม่มีความเสี่ยงของ overflow. The 34.30 result จากนั้นถูกตัดเป็น 34.15 format โดยการทิ้ง the low 15 bits และจากนั้นถูกทำให้อิ่มตัวเป็น 1.15 format.   

อ้างอิงถึง arm_mat_mult_fast_q15() สำหรับการเร็วขึ้นแต่เป็นเวอร์ชั่นที่ความเที่ยงตรงน้อยลงงของฟังชั่นนี้.

References __SIMD32, __SMUADX(), __SMUSD(), ARM_MATH_SIZE_MISMATCH, ARM_MATH_SUCCESS, arm_matrix_instance_q15::numCols, arm_matrix_instance_q15::numRows, arm_matrix_instance_q15::pData, and status.


tha



Returns

The function คืนค่าอย่างใดอย่างหนึ่ง ARM_MATH_SIZE_MISMATCH หรือ ARM_MATH_SUCCESS ขึ้นอยู่กับผลที่ออกมาของ size checking.

Scaling and Overflow Behavior:

The function ถูกจัดให้มีใช้โดยใช้ an internal 64-bit accumulator. The accumulator มี a 2.62 format และรักษา full precision ของ the intermediate multiplication results แต่จัดให้มีเฉพาะ a single guard bit. ไม่มี saturation บน intermediate additions. ดังนั้น, ถ้า the accumulator overflows มันจะพันรอบและบิดเบือน the result. The input signals ควรถูก scaled down เพื่อหลีกเลี่ยง intermediate overflows. The input ดังนั้นถูก scaled down โดย log2(numColsA) bits เพื่อหลีกเลี่ยง overflows, เนื่องจากทั้งหมดของ numColsA additions ถูกดำเนินการภายใน. The 2.62 accumulator ถูกเลื่อนไปทางขวาไป 31 bits และถูกทำให้อิ่มตัวเป็น 1.31 format เพื่อให้ผล the final result.

References ARM_MATH_SIZE_MISMATCH, ARM_MATH_SUCCESS, clip_q63_to_q31(), arm_matrix_instance_q31::numCols, arm_matrix_instance_q31::numRows, arm_matrix_instance_q31::pData, and status.