31.5.7 mips_vec_dotp16

Description

Computes the dot product of the Q15 vectors indata1 and indata2. The number of samples to be processed is given by the parameter N. The scale parameter specifies the amount of right shift applied to the final result.

Mathematically,

r e s u l t = 1 2 s c a l e n = 0 N 1   i n d a t a 1 n × i n d a t a 2 n

Include

dsplib_dsp.h

Prototype

int16
mips_vec_dotp16
(
       int16 *indata1,
       int16 *indata2,
       int N,
       int scale
);

Argument

indata1: First input array with 16-bit fixed point elements in Q15 format.

indata2: Second input array.

N: Number of samples.

scale: Scaling factor: divide the result by 2scale.

Return Value

Scaled result of the calculation in fractional Q15 format.

Remarks

  • The pointers outdata and indata must be aligned on 4-byte boundaries.
  • N must be larger than or equal to 4 and a multiple of 4.