DSPF_sp_nrand
[Math]

Collaboration diagram for DSPF_sp_nrand:


Detailed Description

void DSPF_sp_nrand (int size, float *vector, void *state)


Function Documentation

void DSPF_sp_nrand ( int  size,
float *  vector,
void *  state 
)

This function is used to fill an array with Gaussian normal distributed random numbers.These numbers are distributed assuming mean (mu) = 0 and standard deviation (sigma) = 1.

The output vector can be modified for an arbitrary mu and sigma by adding its contents by the desired value of mu and multiplying its contents by the desired value of sigma respectively as shown in the histogram below.

Parameters:
size The size of the array to be filled.
vector The array of type float which the user wants to fill with random values.
state The array which was initialized with the "DSP_urand32_init" function and maintained (but NEVER modified) by the user between subsequent calls to this function.
Algorithm:
The RNG utilizes the Tiny Mersene Twister (TinyMT) as its underlying RNG and an optimized version of George Marsaglia's Ziggurat algorithm as a wrapper RNG to generate a Gaussian normal distribution from the uniformly distributed TinyMT.
Assumptions:
The user has previously called the "DSP_urand32_init" function at least once, has maintained the state array, and allocated an array of float types of the desired width.
Implementation notes:
Endian Support: The code supports both big and little endian modes.
Interruptibility: The code is not interruptible.
DSPF_sp_nrand_histogram.png


Copyright 2014, Texas Instruments Incorporated