Hi All

When seeded with a positive number gr_noise_source_X seems to always
return the same sequence.

i.e.

call gr_noise_source_f(gr.GAUSSIAN,1,Z) where Z > 0 the sequence is
always the same.  Called with a negative seed (Z < 0 ) it behaves as I
would expect.

Am I missing something?

I think this is from lines below in gr_random, but the comment
made me scared to touch it :-)

/*
* This looks like it returns a uniform random deviate between 0.0 and 1.0
* It looks similar to code from "Numerical Recipes in C".
*/
float gr_random::ran1()
{
 int j;
 long k;
 float temp;

 if (d_seed <= 0 || !d_iy)  {
   if (-d_seed < 1)                    <<<<<<<<<<  HERE
     d_seed=1;                         <<<<<<<<<<  and HERE
   else
     d_seed = -d_seed;
   for (j=NTAB+7;j>=0;j--) {
     k=d_seed/IQ;
<snip>


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to