1.4.2.82 DSP_VectorMul16 Function

Multiplication of a series of numbers in one vector to another vector.

Description

void DSP_VectorMul16(int16_t *outdata, int16_t *indata1, int16_t *indata2, int N);

Multiples the 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 the 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 inBufMultA[8]={0x7FFF, 0x8000, 0x7333, 0x6666, 0x1999, 0x4000, 0x7FFF, 0xB334};

_// 1, -1, 0.9, 0.8, 0.2, 0.5, 1, -0.6_

int16_t inBufMultB[8]={0x0CCD, 0x0CCD, 0x4000, 0xC000, 0xE667, 0x4000, 0x0000, 0x0CCD};

_// 0.1, 0.1, 0.5, -0.5, -0.2, 0.5, 0, 0.1_

int Num = 8;

pOutdata = &outVal;

DSP_VectorMul16(pOutdata, inBufMultA, inBufMultB, Num);

_// outVal[i] = inBufTest[i] * inBuf2[i] =_

_// {0x0CCD, 0xF333, 0x399A, 0xCCCD, 0xFAE2, 0x2000, 0x0000, 0xF852}_

_// 0.1, -0.1, 0.45, -0.4, -0.04, 0.25, 0, -0.06_

C

void  DSP_VectorMul16 (int16_t * outdata , int16_t * indata1 , int16_t * indata2 , int  N );