mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 13:30:52 -05: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
							
								
									4b8c1bff92
								
							
						
					
					
						commit
						d5493ec172
					
				@ -34,7 +34,7 @@ OBJS1 = astrosub.o astro0.o astro.o sun.o coord.o tmoonsub.o \
 | 
			
		||||
	four2a.o grid2deg.o wisdom.o \
 | 
			
		||||
	symspec.o analytic.o db.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\
 | 
			
		||||
	twkfreq.o symspec2.o shell.o sync65.o peakup.o slope.o xcor.o\
 | 
			
		||||
	fillcom.o chkss2.o zplot9.o flat1.o flat2.o \
 | 
			
		||||
 | 
			
		||||
@ -71,6 +71,7 @@ subroutine extract(s3,nadd,nqd,ntrials,naggressive,ndepth,nexp_decode,   &
 | 
			
		||||
  ncandidates=param(0)
 | 
			
		||||
  nhard=param(1)
 | 
			
		||||
  nsoft=param(2)
 | 
			
		||||
  nerased=param(3)
 | 
			
		||||
 | 
			
		||||
  if(nhard.lt.0 .and. ndepth.ge.5) then
 | 
			
		||||
     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 graycode65(correct,63,1)
 | 
			
		||||
     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
 | 
			
		||||
     if(iand(dat4(10),8).ne.0) ltext=.true.
 | 
			
		||||
     nsf=1
 | 
			
		||||
 | 
			
		||||
@ -62,6 +62,9 @@ program jt65sim
 | 
			
		||||
  h=default_header(12000,npts)
 | 
			
		||||
  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
 | 
			
		||||
     write(fname,1002) ifile         !Output filename
 | 
			
		||||
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