1.4.2.1 DSP_ComplexAdd32 Function

Calculates the sum of two complex numbers.

Description

void DSP_ComplexAdd32(int32c *indata1, int32c *indata2, int32c *Output);

Calculates the sum of two complex numbers, indata1 and indata2, and stores the complex result in Output. Complex numbers must be in the structural form that includes real and imaginary components. The function saturates the output values if maximum or minimum are exceeded. All values are in Q31 fractional data format. (a + bi) + (c + di) => (a + c) + (b + d)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_ComplexAdd32(input1, input2, res);

_// result = {0x73333333, 0xC0000000} = (0.9 - 0.5i)_

C

void  DSP_ComplexAdd32 (int32c * indata1 , int32c * indata2 , int32c * Output );