mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-08-19 14:12:30 -04:00
Mods to jt65sim to use new seed for each invocation - for use in a script that estimates high-snr FER.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6227 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
7697fbe072
commit
cca493e28c
@ -25,7 +25,7 @@ CFLAGS = -I. -fbounds-check -fPIE
|
|||||||
%.o: %.F90
|
%.o: %.F90
|
||||||
${FC} ${FFLAGS} -c $<
|
${FC} ${FFLAGS} -c $<
|
||||||
|
|
||||||
all: libjt9.a jt65 jt65sim
|
all: libjt9.a jt65 jt65sim
|
||||||
|
|
||||||
OBJS1 = astrosub.o astro0.o astro.o sun.o coord.o tmoonsub.o \
|
OBJS1 = astrosub.o astro0.o astro.o sun.o coord.o tmoonsub.o \
|
||||||
fmtmsg.o deg2grid.o\
|
fmtmsg.o deg2grid.o\
|
||||||
@ -34,7 +34,7 @@ OBJS1 = astrosub.o astro0.o astro.o sun.o coord.o tmoonsub.o \
|
|||||||
four2a.o grid2deg.o wisdom.o \
|
four2a.o grid2deg.o wisdom.o \
|
||||||
symspec.o analytic.o db.o \
|
symspec.o analytic.o db.o \
|
||||||
encode232.o interleave9.o\
|
encode232.o interleave9.o\
|
||||||
entail.o fano232.o gran.o sync9.o decjt9.o \
|
entail.o fano232.o sgran.o gran.o sync9.o decjt9.o \
|
||||||
fil3.o decoder.o timer.o exp_decode65.o fqso_first.o\
|
fil3.o decoder.o timer.o exp_decode65.o fqso_first.o\
|
||||||
twkfreq.o symspec2.o shell.o sync65.o peakup.o slope.o xcor.o\
|
twkfreq.o symspec2.o shell.o sync65.o peakup.o slope.o xcor.o\
|
||||||
fillcom.o chkss2.o zplot9.o flat1.o flat2.o \
|
fillcom.o chkss2.o zplot9.o flat1.o flat2.o \
|
||||||
@ -55,7 +55,7 @@ jt65: $(OBJS7) libjt9.a libsfrsd.a
|
|||||||
$(CP) jt65 $(EXE_DIR)
|
$(CP) jt65 $(EXE_DIR)
|
||||||
|
|
||||||
OBJS2 = jt65sim.o wavhdr.o
|
OBJS2 = jt65sim.o wavhdr.o
|
||||||
jt65sim: $(OBJS2) libjt9.a
|
jt65sim: $(OBJS2) libjt9.a
|
||||||
$(FC) -o jt65sim $(OBJS2) -L. -L/opt/local/lib -ljt9 -lfftw3f
|
$(FC) -o jt65sim $(OBJS2) -L. -L/opt/local/lib -ljt9 -lfftw3f
|
||||||
$(CP) jt65sim $(EXE_DIR)
|
$(CP) jt65sim $(EXE_DIR)
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ subroutine extract(s3,nadd,nqd,ntrials,naggressive,ndepth,nexp_decode, &
|
|||||||
ncandidates=param(0)
|
ncandidates=param(0)
|
||||||
nhard=param(1)
|
nhard=param(1)
|
||||||
nsoft=param(2)
|
nsoft=param(2)
|
||||||
|
nerased=param(3)
|
||||||
|
|
||||||
if(nhard.lt.0 .and. ndepth.ge.5) then
|
if(nhard.lt.0 .and. ndepth.ge.5) then
|
||||||
call timer('exp_deco',0)
|
call timer('exp_deco',0)
|
||||||
@ -99,6 +100,9 @@ subroutine extract(s3,nadd,nqd,ntrials,naggressive,ndepth,nexp_decode, &
|
|||||||
call interleave63(correct,63,1)
|
call interleave63(correct,63,1)
|
||||||
call graycode65(correct,63,1)
|
call graycode65(correct,63,1)
|
||||||
call unpackmsg(dat4,decoded) !Unpack the user message
|
call unpackmsg(dat4,decoded) !Unpack the user message
|
||||||
|
! open(43,file='stats.dat',access='append',status='unknown')
|
||||||
|
! write(43,*) nhard,nsoft,nerased,ntry
|
||||||
|
! close(43)
|
||||||
ncount=0
|
ncount=0
|
||||||
if(iand(dat4(10),8).ne.0) ltext=.true.
|
if(iand(dat4(10),8).ne.0) ltext=.true.
|
||||||
nsf=1
|
nsf=1
|
||||||
|
@ -62,6 +62,9 @@ program jt65sim
|
|||||||
h=default_header(12000,npts)
|
h=default_header(12000,npts)
|
||||||
dfsig=2000.0/nsigs !Freq spacing between sigs in file (Hz)
|
dfsig=2000.0/nsigs !Freq spacing between sigs in file (Hz)
|
||||||
|
|
||||||
|
! generate new random number seed for each run using /dev/urandom on linux and os x
|
||||||
|
nerr=sgran()
|
||||||
|
|
||||||
do ifile=1,nfiles !Loop over requested number of files
|
do ifile=1,nfiles !Loop over requested number of files
|
||||||
write(fname,1002) ifile !Output filename
|
write(fname,1002) ifile !Output filename
|
||||||
1002 format('000000_',i4.4)
|
1002 format('000000_',i4.4)
|
||||||
|
15
lib/sgran.c
Normal file
15
lib/sgran.c
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
/* seed rand using urandom */
|
||||||
|
float sgran_()
|
||||||
|
{
|
||||||
|
unsigned int seed;
|
||||||
|
FILE *urandom;
|
||||||
|
urandom = fopen ("/dev/urandom","r");
|
||||||
|
fread (&seed, sizeof (seed), 1, urandom);
|
||||||
|
srand (seed);
|
||||||
|
|
||||||
|
return(0);
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user