1.4.2.61 DSP_VectorAddc16 Function

Calculate the sum of a vector and a constant.

Description

void DSP_VectorAddc16(int16_t *outdata, int16_t *indata, int16_t c, int N);

Computes the sum value of each element of (indata + c) 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 N elements of indata + c

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)

c constant value added to all indata1 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};

int16_t constValue = 3;

int Num = 8;

pOutdata = &outVal;

DSP_VectorAddc16(pOutdata, inBufTest, constValue, Num);

_// outVal[i] = inBufTest[i] + constValue = {-2,5,0,7,2,3,1,-5}_

C

void  DSP_VectorAddc16 (int16_t * outdata , int16_t * indata , int16_t c , int  N );