VF_noiseVD_noiseVE_noise
FunctionInitialize a vector with "white" noise
Syntax C/C++#include <VFstd.h>
long VF_noise( fVector X, ui size, long seed, float Amp );
C++ VecObj#include <OptiVec.h>
long vector<T>::noise( long seed, const T& Amp );
Pascal/Delphiuses VFstd;
function VF_noise( X:fVector; size:UInt; Seed:LongInt; Amp:Single ): LongInt;
DescriptionWhite noise is generated with the amplitude Amp, i.e., the output values are between -Amp/2 and +Amp/2 (both extrema included). "seed" may be chosen completely arbitrary. Successive calls with the same seed yield identical results; for different values of seed, the obtained results are uncorrelated.

Internally, these functions employ a 32-bit integer random number generator by H.W.Lewis, with additional steps (so-called "Bays-Durham shuffle") to break sequential correlations. This ensures very good randomness, far superior to simpler generators (like the rand function shipped with C/C++ and the Random function of Pascal).

A long value is returned which may be used as new seed for subsequent calls.

Error handlingnone
Return valuelast 32-bit random number internally generated; may be used as new seed value for future calls.
See alsorand,   random,   VF_random

VectorLib Table of Contents  OptiVec home