PULP DSP  Version 1.0
Digital Signal Processing library for PULP processors (pulp-platform.org)
 All Classes Files Functions Groups Pages
Modules | Functions


 Mean Kernels


void plp_mean_i32 (const int32_t *__restrict__ pSrc, uint32_t blockSize, int32_t *__restrict__ pRes)
 Glue code for mean value of a 32-bit integer vector. More...

Detailed Description

Calculates the mean of the input vector. Mean is defined as the average of the elements in the vector. The underlying algorithm is used:

Result = (pSrc[0] + pSrc[1] + pSrc[2] + ... + pSrc[blockSize-1]) / blockSize;

There are separate functions for floating point, integer, and fixed point 32- 16- 8-bit data types. For lower precision integers (16- and 8-bit), functions exploiting SIMD instructions are provided.

The naming scheme of the functions follows the following pattern (for example plp_dot_prod_i32s):

<pulp> _ <function name> _ <data type> <precision> <method> _ <isa extension>, with
data type = {f, i, q} respectively for floats, integers, fixed points
precision = {32, 16, 8} bits
method = {s, v, p} meaning single (or scalar, i.e. not using packed SIMD), vectorized (i.e. using SIMD instructions), and parallel (for multicore parallel computing), respectively.
isa extension = rv32im, xpulpv2, etc. of which rv32im is the most general one.

Function Documentation

void plp_mean_i32 ( const int32_t *__restrict__  pSrc,
uint32_t  blockSize,
int32_t *__restrict__  pRes 

Glue code for mean value of a 32-bit integer vector.

[in]pSrcpoints to the input vector
[in]blockSizenumber of samples in input vector
[out]pResmean value returned here