1.4.2.58 DSP_VectorAbs32 Function

Calculate the absolute value of a vector.

Description

void DSP_VectorAbs32(int32_t *outdata, int32_t *indata, int N);

Computes the absolute value of each element of indata and stores it to outdata. The number of samples to process is given by the parameter N. Data is in a Q31 fractional format.

outdata filled with N elements of abs(indata)

Preconditions

The pointers outdata and indata must be aligned on 4-byte boundaries. N must be greater than or equal to eight and a multiple of eight.

Parameters

outdata pointer to output array of 16-bit elements (int32_t)

indata pointer to input array of 16-bit elements (int32_t)

N number of samples (int)

Returns

None.

Remarks

This must be assembled with .set microMIPS.

Example

int16_t *pOutdata;

int32_t outVal[8];

int32_t inBufTest[16] = {-5,2,-3,4,-1,0,-2,-8,-21,21,10,100,200,127,-127,-2};

int Num = 8;

pOutdata = &outVal;

DSP_VectorAbs32(pOutdata, inBufTest, Num);

_// outVal[i] = {5,2,3,4,1,0,2,8}_

C

void  DSP_VectorAbs32 (int32_t * outdata , int32_t * indata , int  N );