STM32F1 CMSIS DSP Complex Math Functions

Started by tha, July 18, 2021, 07:30:46 AM

Previous topic - Next topic

tha

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



Description

เซ็ตของ functions นี้ทำงานบน complex data vectors. The data ใน the complex arrays ถูกเก็บใน an interleaved fashion (real, imag, real, imag, ...). ใน the API functions, the number ของ samples ใน a complex array อ้างอิงถึงจำนวนของ complex values; the array บรรจุเป็นสองเท่าจำนวนของ real values นี้.

ปล. ยังจำกันได้อยู่ไหม complex number 1+j2 ที่มีค่าจริงกับค่าจินตนาการ ลองไปทบทวนกันดูนะครับ

tha

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



Description

ผัน the elements of a complex data vector.

The pSrc ชี้ไปยัง the source data และ pDst ชี้ไปยังที่ๆผลลัพธ์ควรถูกเขียน. numSamples ระบุจำนวนของ complex samples และ the data ในแต่ละ array ถูกเก็บใน an interleaved fashion (real, imag, real, imag, ...). แต่ละ array มีทั้งหมด 2*numSamples values. The underlying algorithm ถูกใช้:

for(n=0; n<numSamples; n++) {
    pDst[(2*n)+0)] = pSrc[(2*n)+0];     // real part
    pDst[(2*n)+1)] = -pSrc[(2*n)+1];    // imag part
}

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

tha



tha



Scaling and Overflow Behavior:

The function ใช้ saturating arithmetic. The Q15 ค่า -1 (0x8000) จะถูกทำให้อิ่มตัวไปยัง the maximum allowable positive value 0x7FFF.

References __QASX(), __QSAX(), and __SIMD32.

tha



Scaling and Overflow Behavior:

The function ใช้ saturating arithmetic. The Q31 ค่า -1 (0x80000000) จะถูกทำให้อิ่มตัวไปยัง the maximum allowable positive value 0x7FFFFFFF.

References __QSUB().

tha

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



Description

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

The pSrcA ชี้ไปยัง the first complex input vector และ pSrcB ชี้ไปยัง the second complex input vector. numSamples ระบุจำนวนของ complex samples และ the data ในแต่ละ array ถูกเก็บใน an interleaved fashion (real, imag, real, imag, ...). แต่ละ array มีทั้งหมด 2*numSamples values

The underlying algorithm ถูกใช้:

realResult=0;
imagResult=0;
for(n=0; n<numSamples; n++) {
    realResult += pSrcA[(2*n)+0]*pSrcB[(2*n)+0] - pSrcA[(2*n)+1]*pSrcB[(2*n)+1];
    imagResult += pSrcA[(2*n)+0]*pSrcB[(2*n)+1] + pSrcA[(2*n)+1]*pSrcB[(2*n)+0];
}
มีฟังชั่นที่แยกกันสำหรับ floating-point, Q15 and Q31 data types.

tha


tha



Scaling and Overflow Behavior:

The function ถูกจัดให้มีใช้โดยใช้ an internal 64-bit accumulator. The intermediate 1.15 by 1.15 multiplications ถูกดำเนินการด้วย full precision และให้ผล a 2.30 result. เหล่านี้ถูก accumulated ใน a 64-bit accumulator ด้วย 34.30 precision. ในขั้นตอนสุดท้าย, the accumulators ถูกแปลงไปเป็น 8.24 format. The return results realResult และ imagResult อยู่ใน 8.24 format.