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:UIntSize; Seed:LongInt; Amp:Single ): LongInt;
CUDA function C/C++#include <cudaVFstd.h>
int cudaVF_noise( fVector X, ui size, long seed, float Amp );
CUDA function Pascal/Delphiuses VFstd;
function cudaVF_noise( X:fVector; size:UIntSize; Seed:LongInt; Amp:Single ): IntBool;
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.
A 32-bit integer suitable for use as a new seed value for another call is returned. That other call would, however, not simply continue the series, as a new "state" of the random-number generator needs to be built up. If you wish to be able to break off and continue the series in multiple sequential function calls, use VF_noiseLC instead.
Because the random numbers are only 32-bit, there is some granularity in the VD_ and VE_ versions. If higher resolution is desired, use VD_random instead.

A long value is returned which may be used as new seed for subsequent calls. Only the CUDA versions of this function do not return a new seed value, but the usual CUDA error flag.
There is no VFcu_ version of this function, as the random numbers are generated on the CPU anyway.

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,   VF_noiseLC

VectorLib Table of Contents  OptiVec home