1.4.2.4 DSP_ComplexDotProd32 Function
Calculates the dot product of two complex numbers.
Description
void DSP_ComplexDotProd32(int32c *indata1, int32c *indata2, int32c *Output);
Calculates the dot product of two complex numbers, indata1 and indata2, and stores the result in Output. All numbers must be in complex structural format that includes real and imaginary components, and the numbers are in fractional Q31 format. The function will saturate the output if it exceeds maximum or minimum ratings. The formula for the dot product is as follows:
Output(real) = (Input1.re * Input2.re) + (Input1.im * Input2.im); Output(img) = i (a + bi) dot (c + di) => (a * c + b * d) + (a * d - b * c)i
Preconditions
Complex numbers must be in the int32c format.
Parameters
indata1 pointer to input complex number (int32c)
indata2 pointer to input complex number (int32c)
Returns
pointer to result complex numbers (int32c)
Remarks
None.
Example
int32c *res, result; int32c *input1, *input2; int32c test_complex_1 = {0x40000000,0x0CCCCCCC}; _// (0.5 + 0.1i)_ int32c test_complex_2 = {0x73333333,0xB3333334}; _// (0.9 - 0.6i)_ res=&result; input1=&test_complex_1; input2=&test_complex_2; DSP_ComplexDotProd32(input1, input2, res); _// result = {0x31EB851E, 0xCE147AE3} = (0.39 - 0.39i)_
C
void DSP_ComplexDotProd32 (int32c * indata1 , int32c * indata2 , int32c * Output );