31.5.15 mips_vec_sum_squares16

Description

Computes the sum of squared values of all elements of indata. 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 n 2

Include

dsplib_dsp.h

Prototype

int16
mips_vec_sum_squares16
(
       int16 *indata,
       int N,
       int scale
);

Argument

indata: Input array with 16-bit fixed-point elements in Q15 format

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 pointer indata must be aligned on a 4-byte boundary.
  • N must be larger than or equal to 4 and a multiple of 4.