mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-30 20:52:28 -04:00
Use ran1 instead of random_number().
This commit is contained in:
parent
3434faf84a
commit
0531f339e8
28
lib/superfox/ran1.f90
Normal file
28
lib/superfox/ran1.f90
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
FUNCTION ran1(idum)
|
||||||
|
INTEGER idum,IA,IM,IQ,IR,NTAB,NDIV
|
||||||
|
REAL ran1,AM,EPS,RNMX
|
||||||
|
PARAMETER (IA=16807,IM=2147483647,AM=1./IM,IQ=127773,IR=2836, &
|
||||||
|
NTAB=32,NDIV=1+(IM-1)/NTAB,EPS=1.2e-7,RNMX=1.-EPS)
|
||||||
|
INTEGER j,k,iv(NTAB),iy
|
||||||
|
SAVE iv,iy
|
||||||
|
DATA iv /NTAB*0/, iy /0/
|
||||||
|
if (idum.le.0.or.iy.eq.0) then
|
||||||
|
idum=max(-idum,1)
|
||||||
|
do j=NTAB+8,1,-1
|
||||||
|
k=idum/IQ
|
||||||
|
idum=IA*(idum-k*IQ)-IR*k
|
||||||
|
if (idum.lt.0) idum=idum+IM
|
||||||
|
if (j.le.NTAB) iv(j)=idum
|
||||||
|
enddo
|
||||||
|
iy=iv(1)
|
||||||
|
endif
|
||||||
|
k=idum/IQ
|
||||||
|
idum=IA*(idum-k*IQ)-IR*k
|
||||||
|
if (idum.lt.0) idum=idum+IM
|
||||||
|
j=1+iy/NDIV
|
||||||
|
iy=iv(j)
|
||||||
|
iv(j)=idum
|
||||||
|
ran1=min(AM*iy,RNMX)
|
||||||
|
|
||||||
|
return
|
||||||
|
END FUNCTION ran1
|
@ -12,7 +12,7 @@ program synctest
|
|||||||
complex clo(NMAX) !Complex Local Oscillator
|
complex clo(NMAX) !Complex Local Oscillator
|
||||||
complex cnoise(NMAX) !Complex noise
|
complex cnoise(NMAX) !Complex noise
|
||||||
complex crcvd(NMAX) !Signal as received
|
complex crcvd(NMAX) !Signal as received
|
||||||
real xdat(ND) !Temporary: for generating idat
|
! real xdat(ND) !Temporary: for generating idat
|
||||||
integer*1 idat(ND) !Encoded data, 7-bit integers
|
integer*1 idat(ND) !Encoded data, 7-bit integers
|
||||||
integer*1 jdat(ND) !Recovered hard-decision symbols
|
integer*1 jdat(ND) !Recovered hard-decision symbols
|
||||||
character fname*17,arg*12
|
character fname*17,arg*12
|
||||||
@ -39,9 +39,11 @@ program synctest
|
|||||||
rms=100.
|
rms=100.
|
||||||
fsample=12000.0 !Sample rate (Hz)
|
fsample=12000.0 !Sample rate (Hz)
|
||||||
baud=12000.0/nsps !Keying rate, 11.719 baud for nsps=1024
|
baud=12000.0/nsps !Keying rate, 11.719 baud for nsps=1024
|
||||||
|
idummy=0
|
||||||
|
|
||||||
call random_number(xdat)
|
do i=1,ND
|
||||||
idat=int(127.9999*xdat)
|
idat(i)=128*ran1(idummy)
|
||||||
|
enddo
|
||||||
|
|
||||||
h=default_header(12000,NMAX)
|
h=default_header(12000,NMAX)
|
||||||
fname='000000_000001.wav'
|
fname='000000_000001.wav'
|
||||||
@ -99,3 +101,4 @@ program synctest
|
|||||||
include 'gen_sfox.f90'
|
include 'gen_sfox.f90'
|
||||||
include 'sync_sf.f90'
|
include 'sync_sf.f90'
|
||||||
include 'hard_symbols.f90'
|
include 'hard_symbols.f90'
|
||||||
|
include 'ran1.f90'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user