1.4.2.57 DSP_VectorAbs16 Function

Calculate the absolute value of a vector.

Description

void DSP_VectorAbs16(int16_t *outdata, int16_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 Q15 fractional format.

outdata filled with the absolute value of elements of 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 (int16_t)

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

N number of samples (int)

Returns

None.

Remarks

This must be assembled with .set microMIPS.

Example

int16_t *pOutdata;

int16_t outVal[8];

int16_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_VectorAbs16(pOutdata, inBufTest, Num);

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

C

void  DSP_VectorAbs16 (int16_t * outdata , int16_t * indata , int  N );