mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-03-23 04:28:36 -04:00
Change random number generation in qra66sim so results are exactly repeateble.
This commit is contained in:
parent
fb3c23492f
commit
45dac5bd18
@ -26,3 +26,9 @@ float gran_()
|
||||
iset++;
|
||||
return v2*fac;
|
||||
}
|
||||
|
||||
/* Generates evenly distributed numbers between 0 and 1. */
|
||||
float rran_()
|
||||
{
|
||||
return (float)rand()/(float)RAND_MAX;
|
||||
}
|
||||
|
@ -110,15 +110,13 @@ program qra66sim
|
||||
a=0.
|
||||
if(x.lt.3.0) then !Cutoff beyond x=3
|
||||
a=sqrt(1.111/(1.0+x*x)-0.1) !Lorentzian amplitude
|
||||
call random_number(r1)
|
||||
phi1=twopi*r1 !Random phase
|
||||
phi1=twopi*rran() !Random phase
|
||||
z=a*cmplx(cos(phi1),sin(phi1))
|
||||
endif
|
||||
cspread(i)=z
|
||||
z=0.
|
||||
if(x.lt.3.0) then !Same thing for negative freqs
|
||||
call random_number(r2)
|
||||
phi2=twopi*r2
|
||||
phi2=twopi*rran()
|
||||
z=a*cmplx(cos(phi2),sin(phi2))
|
||||
endif
|
||||
cspread(NFFT-i)=z
|
||||
|
Loading…
Reference in New Issue
Block a user