LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

random number generator - seed choice

Hi all,

 

I'm using the Gaussian White Noise.vi function with a user-defined seed value to produce a repeatable stream of random numbers.

 

Does anyone have suggestions on what seed(s) to use or not to use? 

 

How does the seeding determine how the random numbers are generated (particularly for the VI I'm using)?  What is the theory?  Know any good references?

 

Cheers,

 

Battler.

0 Kudos
Message 1 of 14
(7,934 Views)

Pseudorandom number generators are often based on recurrence relations, and the seed is simply the starting point for the sequence.  If you don't specify one explicitly, it is typically chosen based on the state of the computer clock.

 

I suggest you read the chapter in Numerical Recipes and then decide if you still want to use a linear congruence method for your application. 

Message 2 of 14
(7,917 Views)

Thanks for that reply.  Keep em coming if anyone else has any suggestions.

 

Any links?  Any suggestions on the best seed(s) to use?

 

Cheers,

 

Battler.

0 Kudos
Message 3 of 14
(7,901 Views)

There is NO best seed. 

 

Most people do not need to  give a seed to "Gaussian White Noise.vi". User need to give a seed most likely that he want to get a deterministic result. That is with the same seed, the output of this VI will be the same. But if you do not give a seed, the algorithm will select a seed automatically, and the output of "Gaussian White Noise.vi" will be different each time you run this VI. 

 

 

0 Kudos
Message 4 of 14
(7,869 Views)

What is the proof that there is no best seed?  Can you explain further please..

 

Appreciate it.

0 Kudos
Message 5 of 14
(7,867 Views)

The seed is really just the initial condition. The pseudo random number generator will repeat after a certain number of iterations you will eventually go through the entire set of possibilities, i.e. you will pass through all the numbers. Some seeds are probably forbidden, like 0. 

 

You would want to set the seed if you desired to re-run the same list of random numbers, i.e. you were simulating something and wanted to get exactly the same inputs again.

 

There is little need to worry about picking the seed, just leave it unwired and let entropy take care of the rest for you 🙂

 

That said, I recall seeing a post (quite a while back now) where a scientist/mathematician had queried the accuracy of the AWGN generator. This can be tested I suppose by generating a lot of random numbers and having a look at the distribution. It should be perfectly flat for white noise.

 

0 Kudos
Message 6 of 14
(7,856 Views)

What does the best seed mean?

 

I guess you mean with a given seed, the output of "Gaussian White Noise.vi" is more like an ideal gaussian white noise, then this seed will be a best seed for you. Am I correct? 

 

Can you tell me why do you want to get a "best" seed?  

0 Kudos
Message 7 of 14
(7,854 Views)

Thanks NRP.

 

I need to set the seed value so that I can repeat the same random numbers.  I suppose what I'm getting at is if I do set the seed what value which give the "most random" (is it a function of amplitude also?) set of random numbers?

 

For instance I have heard of people using a seed with the same number of 1s and 0s (binary).  I'm not sure why they did it.

 

Cheers,

 

Battler.

0 Kudos
Message 8 of 14
(7,853 Views)

Why wouldn't you want the "best" (one which produces the most random series) seed?

 

Yes, the seed which produces the most ideal Gaussian Noise.  Is it also a function of amplitude?

0 Kudos
Message 9 of 14
(7,852 Views)

To prove seed1 is better than seed2, you must prove white noise 1 with seed1 is better than white noise 2 with seed2. Since the noise is randomly produced, you can not say white noise 1 is better than white noise 2 with a single experiment. Because this is a thing of statistic. 

 

But if you have two algorithm, say algorithm 1 and algorithm 2, you can do some experiments to find the best one.  For example, you can write a program to generate many many white noise with both algorithms, and then you can statistic the distribution of the generated signal. After this experiment you will find out which algorithm is better. 

0 Kudos
Message 10 of 14
(7,848 Views)