1.4.2.86 DSP_VectorNegate Function
Inverses the sign (negates) the elements of a vector.
Description
void DSP_VectorNegate(int32_t *outdata, int32_t *indata, int N);
Sign inversion of the first N values of an indata are assigned to outdata. N must be a multiple of four and greater than or equal to four or it will be truncated to the nearest multiple of four. The vector result and the scalar value to fill are both Q31 fractional format.
Preconditions
The pointers outdata and indata must be aligned on 4-byte boundaries. N must be greater than or equal to four and a multiple of four.
Parameters
outdata pointer to destination array of elements (int32_t)
indata pointer to source array of elements (int32_t)
N number of samples (int)
Returns
None.
Remarks
None.
Example
int Num = 4; int32_t inBufTestA[8]={0x7FFFFFFF, 0x80000000, 0x73333333, 0x66666666, 0x19999999, 0x40000000, 0x7FFFFFFF, 0xB3333334}; _// 1, -1, 0.9, 0.8, 0.2, 0.5, 1, -0.6_ int32_t outBufTest[8]={0x0CCCCCCD, 0x0CCCCCCD, 0x40000000, 0xC0000000, 0xE6666667, 0x40000000, 0x00000000, 0x0CCCCCCD}; _// 0.1, 0.1, 0.5, -0.5, -0.2, 0.5, 0, 0.1;_ DSP_VectorNegate(outBufTest, inBufTestA, Num); _// inBufTestA = {0x80000000, 0x7FFFFFFF, 0x8CCCCCCD, 0x9999999A,_ _// 0x19999999, 0x40000000, 0x7FFFFFFF, 0xB3333334} // first 4 values neg_ _// -1, 1, -0.9, -0.8, -0.2, 0.5, 0, 0.1_
C
void DSP_VectorNegate (int32_t * outdata , int32_t * indata , int N );