NMSIS-DSP
Version 1.3.1
NMSIS DSP Software Library
|
Calculates the standard deviation of the elements in the input vector. More...
Functions | |
RISCV_DSP_ATTRIBUTE void | riscv_std_f16 (const float16_t *pSrc, uint32_t blockSize, float16_t *pResult) |
Standard deviation of the elements of a floating-point vector. More... | |
RISCV_DSP_ATTRIBUTE void | riscv_std_f32 (const float32_t *pSrc, uint32_t blockSize, float32_t *pResult) |
Standard deviation of the elements of a floating-point vector. More... | |
RISCV_DSP_ATTRIBUTE void | riscv_std_f64 (const float64_t *pSrc, uint32_t blockSize, float64_t *pResult) |
Standard deviation of the elements of a floating-point vector. More... | |
RISCV_DSP_ATTRIBUTE void | riscv_std_q15 (const q15_t *pSrc, uint32_t blockSize, q15_t *pResult) |
Standard deviation of the elements of a Q15 vector. More... | |
RISCV_DSP_ATTRIBUTE void | riscv_std_q31 (const q31_t *pSrc, uint32_t blockSize, q31_t *pResult) |
Standard deviation of the elements of a Q31 vector. More... | |
Calculates the standard deviation of the elements in the input vector.
The float implementation is relying on riscv_var_f32 which is using a two-pass algorithm to avoid problem of numerical instabilities and cancellation errors.
Fixed point versions are using the standard textbook algorithm since the fixed point numerical behavior is different from the float one.
Algorithm for fixed point versions is summarized below:
Result = sqrt((sumOfSquares - sum2 / blockSize) / (blockSize - 1))
sumOfSquares = pSrc[0] * pSrc[0] + pSrc[1] * pSrc[1] + ... + pSrc[blockSize-1] * pSrc[blockSize-1] sum = pSrc[0] + pSrc[1] + pSrc[2] + ... + pSrc[blockSize-1]
There are separate functions for floating point, Q31, and Q15 data types.
RISCV_DSP_ATTRIBUTE void riscv_std_f16 | ( | const float16_t * | pSrc, |
uint32_t | blockSize, | ||
float16_t * | pResult | ||
) |
Standard deviation of the elements of a floating-point vector.
[in] | pSrc | points to the input vector |
[in] | blockSize | number of samples in input vector |
[out] | pResult | standard deviation value returned here |
RISCV_DSP_ATTRIBUTE void riscv_std_f32 | ( | const float32_t * | pSrc, |
uint32_t | blockSize, | ||
float32_t * | pResult | ||
) |
Standard deviation of the elements of a floating-point vector.
[in] | pSrc | points to the input vector |
[in] | blockSize | number of samples in input vector |
[out] | pResult | standard deviation value returned here |
RISCV_DSP_ATTRIBUTE void riscv_std_f64 | ( | const float64_t * | pSrc, |
uint32_t | blockSize, | ||
float64_t * | pResult | ||
) |
Standard deviation of the elements of a floating-point vector.
[in] | pSrc | points to the input vector |
[in] | blockSize | number of samples in input vector |
[out] | pResult | standard deviation value returned here |
Standard deviation of the elements of a Q15 vector.
[in] | pSrc | points to the input vector |
[in] | blockSize | number of samples in input vector |
[out] | pResult | standard deviation value returned here |
Standard deviation of the elements of a Q31 vector.
[in] | pSrc | points to the input vector. |
[in] | blockSize | number of samples in input vector. |
[out] | pResult | standard deviation value returned here. |