mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-24 10:22:26 -04:00
Input ts (approx tsync) from command line.
This commit is contained in:
parent
8948daabb0
commit
fada229d83
@ -5,7 +5,7 @@ module sfox_mod
|
|||||||
integer isync(50)
|
integer isync(50)
|
||||||
|
|
||||||
contains
|
contains
|
||||||
subroutine sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample)
|
subroutine sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample,ts)
|
||||||
|
|
||||||
character*2 itu
|
character*2 itu
|
||||||
integer isps(54)
|
integer isps(54)
|
||||||
@ -25,11 +25,10 @@ contains
|
|||||||
ND2=NN-ND1 !Data symbols after sync
|
ND2=NN-ND1 !Data symbols after sync
|
||||||
NFZ=3 !First zero
|
NFZ=3 !First zero
|
||||||
|
|
||||||
tsync=3.0
|
jsps=nint((12.8-ts)*fsample/NN)
|
||||||
jsps=nint((12.8-tsync)*fsample/NN)
|
|
||||||
iloc=minloc(abs(isps-jsps))
|
iloc=minloc(abs(isps-jsps))
|
||||||
NSPS=isps(iloc(1)) !Samples per symbol
|
NSPS=isps(iloc(1)) !Samples per symbol
|
||||||
NS=nint(tsync*fsample/NSPS)
|
NS=nint(ts*fsample/NSPS)
|
||||||
if(mod(NS,2).eq.1) NS=NS+1
|
if(mod(NS,2).eq.1) NS=NS+1
|
||||||
NSYNC=NS*NSPS !Samples in sync waveform
|
NSYNC=NS*NSPS !Samples in sync waveform
|
||||||
NZ=NSPS*(NN+NS) !Samples in full Tx waveform
|
NZ=NSPS*(NN+NS) !Samples in full Tx waveform
|
||||||
|
@ -31,14 +31,15 @@ program sfoxtest
|
|||||||
character fname*17,arg*12,itu*2
|
character fname*17,arg*12,itu*2
|
||||||
|
|
||||||
nargs=iargc()
|
nargs=iargc()
|
||||||
if(nargs.ne.10) then
|
if(nargs.ne.11) then
|
||||||
print*,'Usage: sfoxtest f0 DT ITU M N K v hs nfiles snr'
|
print*,'Usage: sfoxtest f0 DT ITU M N K ts v hs nfiles snr'
|
||||||
print*,'Example: sfoxtest 1500 0.15 MM 8 74 44 0 F 10 -10'
|
print*,'Example: sfoxtest 1500 0.15 MM 7 127 48 3 0 F 10 -10'
|
||||||
print*,' f0=0 means f0, DT will assume suitable random values'
|
print*,' f0=0 means f0, DT will assume suitable random values'
|
||||||
print*,' LQ: Low Latitude Quiet'
|
print*,' LQ: Low Latitude Quiet'
|
||||||
print*,' MM: Mid Latitude Moderate'
|
print*,' MM: Mid Latitude Moderate'
|
||||||
print*,' HD: High Latitude Disturbed'
|
print*,' HD: High Latitude Disturbed'
|
||||||
print*,' ... and similarly for LM LD MQ MD HQ HM'
|
print*,' ... and similarly for LM LD MQ MD HQ HM'
|
||||||
|
print*,' ts: approximate sync duration (s)'
|
||||||
print*,' v=1 for .wav files, 2 for verbose output, 3 for both'
|
print*,' v=1 for .wav files, 2 for verbose output, 3 for both'
|
||||||
print*,' hs = T for hard-wired sync'
|
print*,' hs = T for hard-wired sync'
|
||||||
print*,' snr=0 means loop over SNRs'
|
print*,' snr=0 means loop over SNRs'
|
||||||
@ -56,19 +57,21 @@ program sfoxtest
|
|||||||
call getarg(6,arg)
|
call getarg(6,arg)
|
||||||
read(arg,*) kk0
|
read(arg,*) kk0
|
||||||
call getarg(7,arg)
|
call getarg(7,arg)
|
||||||
read(arg,*) nv
|
read(arg,*) ts
|
||||||
call getarg(8,arg)
|
call getarg(8,arg)
|
||||||
hard_sync=arg(1:1).eq.'T'
|
read(arg,*) nv
|
||||||
call getarg(9,arg)
|
call getarg(9,arg)
|
||||||
read(arg,*) nfiles
|
hard_sync=arg(1:1).eq.'T'
|
||||||
call getarg(10,arg)
|
call getarg(10,arg)
|
||||||
|
read(arg,*) nfiles
|
||||||
|
call getarg(11,arg)
|
||||||
read(arg,*) snrdb
|
read(arg,*) snrdb
|
||||||
|
|
||||||
call init_timer ('timer.out')
|
call init_timer ('timer.out')
|
||||||
call timer('sfoxtest',0)
|
call timer('sfoxtest',0)
|
||||||
|
|
||||||
fsample=12000.0 !Sample rate (Hz)
|
fsample=12000.0 !Sample rate (Hz)
|
||||||
call sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample)
|
call sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample,ts)
|
||||||
baud=fsample/NSPS
|
baud=fsample/NSPS
|
||||||
tsym=1.0/baud
|
tsym=1.0/baud
|
||||||
bw=NQ*baud
|
bw=NQ*baud
|
||||||
@ -244,7 +247,7 @@ program sfoxtest
|
|||||||
rmsf=sqrt(sqf/ngoodsync)
|
rmsf=sqrt(sqf/ngoodsync)
|
||||||
ebno=snr-10*log10(baud/2500*mm0*KK/NN)
|
ebno=snr-10*log10(baud/2500*mm0*KK/NN)
|
||||||
write(*,1310) snr,ebno,nfiles,fgoodsync,fgood,ave_harderr,nworst,rmsf,rmst
|
write(*,1310) snr,ebno,nfiles,fgoodsync,fgood,ave_harderr,nworst,rmsf,rmst
|
||||||
1310 format(f7.2,f7.2 i6,2f7.4,f7.1,i6,f7.2,f6.3)
|
1310 format(f7.2,f7.2 i6,2f7.4,f7.1,i6,f6.1,f7.3)
|
||||||
if(fgood.le.0.5 .and. fgood0.gt.0.5) then
|
if(fgood.le.0.5 .and. fgood0.gt.0.5) then
|
||||||
threshold=isnr + 1 - (fgood0-0.50)/(fgood0-fgood+0.000001)
|
threshold=isnr + 1 - (fgood0-0.50)/(fgood0-fgood+0.000001)
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user