Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

implement a white noise

anacondgame
Beginner
286 Views
I want implement a white noise... I have made a C++ function to return a number between [0,sigma], where sigma is a standard deviation for the gauss distribuzion.
For noise generator I have use the functions following :

vslNewStream(&stream,VSL_BRNG_R250,1);
status1 = vdRngGaussian(VSL_METHOD_DGAUSSIAN_BOXMULLER,stream,N,vet,0,noise);
vslDeleteStream(&stream);

but it is not work, becouse the function return numbers negative and positive... my output is:

vet= [ -0.00002, 0.00005, -0.000018, ..... , -0.000077]

how do I do to make number to return between [0,sigma]?
help me please!
0 Kudos
1 Reply
Andrey_N_Intel
Employee
286 Views

Normally distributed random numbers which have mathematical expectation 0 andstandard deviation sigma can be both positive and negative -chances tohave negative outputare 0.5. To generate random numbers from interval [0, sigma] you may want to use another generator, for examplegenerator of uniformly distributedrandom numbers.Type of the generator to use depends on the requirements of your problem (in particular, type of white noise).

Also,when you make call to the Gaussian generator, please make sure to pass correct set of parameters to the routine:

status1 = vdRngGaussian(VSL_METHOD_DGAUSSIAN_BOXMULLER,stream,N,vet,0,sigma);

Thanks,Andrey

0 Kudos
Reply