DSP_urand16
[Math]

Collaboration diagram for DSP_urand16:


Detailed Description

void DSP_urand16 (unsigned short *restrict seed, int size, void *restrict vector)


Function Documentation

void DSP_urand16 ( unsigned short *restrict  seed,
int  size,
void *restrict  vector 
)

This program stores 16-bit fixed-point random values in the provided vector.

Parameters:
seed = Pointer to an arbitrary seed (number) of type unsigned short.
size = The size of the vector to be filled with random values.
vector = The vector to be filled with random values.
Algorithm:
A linear congruential 16-bit random number generator is used. The equation is as follows

seed = (seed * 46341 + 1) % 65536

See Numerical Recipes in C
Assumptions:
The size of the vector to be filled is at least 16 and a multiple of 2
For optimal randomness, it is best that the user not seed the RNG with a value of zero.
Implementation notes:
Endian Support: The code supports both big and little endian modes.
Interruptibility: The code is not interruptible.


Copyright 2014, Texas Instruments Incorporated