STM32F1 CMSIS DSP Matrix Functions

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

Previous topic - Next topic

tha


tha

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



Description

คูณ a matrix ด้วย a scalar. นี้ถูกทำให้สำเร็จโดยการคูณแต่ละ element ใน the matrix ด้วย the scalar. ตัวอย่างเช่น :

                                   

The function เช็คเพื่อให้แน่ใจว่า the input and output matrices มีขนาดเดียวกัน.

ใน the fixed-point Q15 and Q31 functions, scale ถูกแสดงโดย a fractional multiplication scaleFract และ an arithmetic shift shift. The shift ยอมให้ the gain ของ the scaling operation เกิน 1.0. The overall scale factor ที่ใช้กับ the fixed-point data คือ

    scale = scaleFract * 2^shift.

tha



tha


tha


tha

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



Description

คำนวณหา the inverse of a matrix.

The inverse ถูกกำหนดเฉพาะถ้า the input matrix เป็นสี่เหลี่ยมจัตุรัสและ non-singular (the determinant เป็น non-zero). The function เช็คว่า the input and output matrices เป็นสี่เหลี่ยมจัตุรัสและมีขนาดเดียวกัน.

Matrix inversion มีความละเอียดอ่อนเชิงตัวเลข และ the CMSIS DSP library รองรับเฉพาะ matrix inversion ของ floating-point matrices.

Algorithm

The Gauss-Jordan method ถูกใช้เพื่อหา the inverse. The algorithm ดำเนินการลำดับของ elementary row-operations จนกระทั่งมันลด the input matrix เป็น an identity matrix. การใช้ลำดับเดียวกันของ elementary row-operations ไปเป็น an identity matrix ให้ผล the inverse matrix. ถ้า the input matrix เป็น singular, ดังนั้น the algorithm จะสิ้นสุดและคืนค่า error status ARM_MATH_SINGULAR.

         

ปล. ลองดูนี่ก็ได้ การหา Matrix Inverse
      https://www.youtube.com/watch?v=MaTLj9c0J8c

tha



Returns

The function คืนค่า ARM_MATH_SIZE_MISMATCH ถ้า the input matrix ไม่เป็นสี่เหลี่ยมจัตุรัสหรือถ้าขนาดของ the output matrix ไม่ตรงกันกับขนาดของ the input matrix. ถ้า the input matrix ถูกพบว่าเป็น singular (ไม่สามารถ inverse ได้), ดังนั้น the function คืนค่า ARM_MATH_SINGULAR. มิฉะนั้น, the function คืนค่า ARM_MATH_SUCCESS.

References ARM_MATH_SINGULAR, ARM_MATH_SIZE_MISMATCH, ARM_MATH_SUCCESS, arm_matrix_instance_f32::numCols, arm_matrix_instance_f32::numRows, arm_matrix_instance_f32::pData, and status.

Referenced by main().

tha



Returns

The function คืนค่า ARM_MATH_SIZE_MISMATCH ถ้า the input matrix ไม่เป็นสี่เหลี่ยมจัตุรัสหรือถ้าขนาดของ the output matrix ไม่ตรงกันกับขนาดของ the input matrix. ถ้า the input matrix ถูกพบว่าเป็น singular (non-invertible), ดังนั้น the function คืนค่า ARM_MATH_SINGULAR. มิฉะนั้น, the function คืนค่า ARM_MATH_SUCCESS.

References ARM_MATH_SINGULAR, ARM_MATH_SIZE_MISMATCH, ARM_MATH_SUCCESS, arm_matrix_instance_f64::numCols, arm_matrix_instance_f64::numRows, arm_matrix_instance_f64::pData, and status.