1.4.2.7 DSP_ComplexSub32 Function

Calculates the difference of two complex numbers.

Description

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

Calculates the difference of two complex numbers, indata1 less indata2, and stores the complex result in Output. Both numbers must be in a complex data structure, which includes real and imaginary components. The function saturates the output values if maximum or minimum are exceeded. Real and imaginary components are in the 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)

None.

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_ComplexSub32(input1, input2, res);

_// result = {0xCCCCCCCD, 0x59999998} = (-0.4 + 0.7i)_

C

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