1.4.2.60 DSP_VectorAdd32 Function

Calculate the sum of two vectors.

Description

void DSP_VectorAdd32(int32_t *outdata, int32_t *indata1, int32_t *indata2, int N);

Computes the sum value of each element of indata1 + indata2 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 indata1 + indata2

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 output array of 16-bit elements (int32_t)

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

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

N number of samples

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};

int32_t inBuf2[16]= { 1,2, 3,4, 5,6, 7, 8, 9, 10,-1,-100,-127,127,-7, 0};

int Num = 8;

pOutdata = &outVal;

DSP_VectorAdd32(pOutdata, inBufTest, inBuf2, Num);

_// outVal[i] = inBufTest[i] + inBuf2[i] = {-4,4,0,8,4,6,5,0}_

C

void  DSP_VectorAdd32 (int32_t * outdata , int32_t * indata1 , int32_t * indata2 , int  N );