CMSIS-DSP: Statistics Functions

| CMSIS-DSP Version 1.8.0 CMSIS DSP Software Library

- Main Page
- Usage and Description
- Reference

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Content | Functions
Statistics Functions

## Content

| Maximum
| Mean
| Minimum
| Power
| Root mean square (RMS)
| Standard deviation
| Variance

## Functions

float32_t | arm_entropy_f32 (const float32_t *pSrcA, uint32_t blockSize)
| Entropy. More...
float64_t | arm_entropy_f64 (const float64_t *pSrcA, uint32_t blockSize)
| Entropy. More...
float32_t | arm_kullback_leibler_f32 (const float32_t *pSrcA, const float32_t *pSrcB, uint32_t blockSize)
| Kullback-Leibler. More...
float64_t | arm_kullback_leibler_f64 (const float64_t *pSrcA, const float64_t *pSrcB, uint32_t blockSize)
| Kullback-Leibler. More...
float32_t | arm_logsumexp_dot_prod_f32 (const float32_t *pSrcA, const float32_t *pSrcB, uint32_t blockSize, float32_t *pTmpBuffer)
| Dot product with log arithmetic. More...
float32_t | arm_logsumexp_f32 (const float32_t *in, uint32_t blockSize)
| Computation of the LogSumExp. More...

## Description

## Function Documentation

float32_t arm_entropy_f32 | ( | const float32_t * | pSrcA,
|  | uint32_t | blockSize
| ) |  |

Parameters

  [in] | pSrcA | Array of input values.
  [in] | blockSize | Number of samples in the input array.

Returns
  Entropy -Sum(p ln p)

float64_t arm_entropy_f64 | ( | const float64_t * | pSrcA,
|  | uint32_t | blockSize
| ) |  |

Parameters

  [in] | pSrcA | Array of input values.
  [in] | blockSize | Number of samples in the input array.

Returns
  Entropy -Sum(p ln p)

float32_t arm_kullback_leibler_f32 | ( | const float32_t * | pSrcA,
|  | const float32_t * | pSrcB,
|  | uint32_t | blockSize
| ) |  |

Distribution A may contain 0 with Neon version. Result will be right but some exception flags will be set.

Distribution B must not contain 0 probability.

Parameters

  [in] | *pSrcA | points to an array of input values for probaility distribution A.
  [in] | *pSrcB | points to an array of input values for probaility distribution B.
  [in] | blockSize | number of samples in the input array.

Returns
  Kullback-Leibler divergence D(A || B)

float64_t arm_kullback_leibler_f64 | ( | const float64_t * | pSrcA,
|  | const float64_t * | pSrcB,
|  | uint32_t | blockSize
| ) |  |

Parameters

  [in] | *pSrcA | points to an array of input values for probaility distribution A.
  [in] | *pSrcB | points to an array of input values for probaility distribution B.
  [in] | blockSize | number of samples in the input array.

Returns
  Kullback-Leibler divergence D(A || B)

float32_t arm_logsumexp_dot_prod_f32 | ( | const float32_t * | pSrcA,
|  | const float32_t * | pSrcB,
|  | uint32_t | blockSize,
|  | float32_t * | pTmpBuffer
| ) |  |

Vectors are containing the log of the samples

Parameters

  [in] | *pSrcA | points to the first input vector
  [in] | *pSrcB | points to the second input vector
  [in] | blockSize | number of samples in each vector
  [in] | *pTmpBuffer | temporary buffer of length blockSize

Returns
  The log of the dot product.

float32_t arm_logsumexp_f32 | ( | const float32_t * | in,
|  | uint32_t | blockSize
| ) |  |

In probabilistic computations, the dynamic of the probability values can be very wide because they come from gaussian functions. To avoid underflow and overflow issues, the values are represented by their log. In this representation, multiplying the original exp values is easy : their logs are added. But adding the original exp values is requiring some special handling and it is the goal of the LogSumExp function.

If the values are x1...xn, the function is computing:

ln(exp(x1) + ... + exp(xn)) and the computation is done in such a way that rounding issues are minimised.

The max xm of the values is extracted and the function is computing: xm + ln(exp(x1 - xm) + ... + exp(xn - xm))

Parameters

  [in] | *in | Pointer to an array of input values.
  [in] | blockSize | Number of samples in the input array.

Returns
  LogSumExp