1.4.2.92 DSP_VectorSub16 Function
Calculate the difference of two vectors.
Description
void DSP_VectorSub16(int16_t *outdata, int16_t *indata1, int16_t *indata2, int N);
Computes the difference 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 Q15 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 eight and a multiple of eight.
Parameters
outdata pointer to output array of 16-bit elements (int16_t)
indata1 pointer to input array of 16-bit elements (int16_t)
indata2 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}; int16_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_VectorSub16(pOutdata, inBufTest, inBuf2, Num); _// outVal[i] = inBufTest[i] - inBuf2[i] = {-6,0,-6,0,-6,-6,-9,-16}_
C
void DSP_VectorSub16 (int16_t * outdata , int16_t * indata1 , int16_t * indata2 , int N );