Add robust sync checkbox to Advanced setup.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6151 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke
2015-11-22 15:27:14 +00:00
parent 0d080615e0
commit 3d76648418
7 changed files with 75 additions and 25 deletions
+4 -2
View File
@@ -21,6 +21,8 @@ subroutine decoder(ss,id2,nfsample)
n2pass=ndepth/100000
ndepth=ndepth-n2pass*100000
nrobust=ndepth/10000
ndepth=ndepth-nrobust*10000
n=ndepth/1000
if(mod(n,2).eq.0) ntrials=10**(n/2)
if(mod(n,2).eq.1) ntrials=3*10**(n/2)
@@ -78,7 +80,7 @@ subroutine decoder(ss,id2,nfsample)
nf2=nfb
call timer('jt65a ',0)
call jt65a(dd,npts65,newdat65,nutc,nf1,nf2,nfqso,ntol65,nsubmode, &
minsync,nagain,n2pass,ntrials,naggressive,ndepth,ndecoded)
minsync,nagain,n2pass,nrobust,ntrials,naggressive,ndepth,ndecoded)
call timer('jt65a ',1)
else if(nmode.eq.9 .or. (nmode.eq.(65+9) .and. ntxmode.eq.9)) then
@@ -97,7 +99,7 @@ subroutine decoder(ss,id2,nfsample)
nf2=nfb
call timer('jt65a ',0)
call jt65a(dd,npts65,newdat65,nutc,nf1,nf2,nfqso,ntol65,nsubmode, &
minsync,nagain,n2pass,ntrials,naggressive,ndepth,ndecoded)
minsync,nagain,n2pass,nrobust,ntrials,naggressive,ndepth,ndecoded)
call timer('jt65a ',1)
else
call timer('decjt9 ',0)
+9 -4
View File
@@ -13,10 +13,11 @@ logical :: display_help=.false.,err
character(len=500) optarg
common/tracer/limtrace,lu
equivalence (lenfile,ihdr(2))
type (option) :: long_options(3) = [ &
type (option) :: long_options(4) = [ &
option ('help',.false.,'h','Display this help message',''), &
option ('ntrials',.true.,'n','default=1000',''), &
option ('single-signal mode',.false.,'s','default=1000','') ]
option ('robust sync',.false.,'n','default: disabled',''), &
option ('single-signal mode',.false.,'s','default: disabled','') ]
limtrace=0
lu=12
@@ -28,9 +29,10 @@ ntrials=10000
nlow=200
nhigh=4000
n2pass=2
nrobust=0
do
call getopt('hn:s',long_options,c,optarg,narglen,nstat,noffset,nremain,err)
call getopt('hn:rs',long_options,c,optarg,narglen,nstat,noffset,nremain,err)
if( nstat .ne. 0 ) then
exit
end if
@@ -39,6 +41,8 @@ n2pass=2
display_help = .true.
case ('n')
read (optarg(:narglen), *) ntrials
case ('r')
nrobust=1
case ('s')
nlow=1250
nhigh=1290
@@ -49,6 +53,7 @@ n2pass=2
nargs=iargc()
if(display_help .or. (nargs.lt.1)) then
print*,'Usage: jt65 [-n ntrials] [-s] file1 [file2 ...]'
print*,' -r robust sync'
print*,' -s single-signal mode'
go to 999
endif
@@ -80,7 +85,7 @@ n2pass=2
! write(56) ihdr(1:11)
call jt65a(dd,npts,newdat,nutc,nfa,nfb,nfqso,ntol,nsubmode, &
minsync,nagain,n2pass,ntrials, naggressive,ndepth,ndecoded)
minsync,nagain,n2pass,nrobust,ntrials, naggressive,ndepth,ndecoded)
call timer('jt65a ',1)
enddo
+44 -19
View File
@@ -1,5 +1,5 @@
subroutine jt65a(dd0,npts,newdat,nutc,nf1,nf2,nfqso,ntol,nsubmode, &
minsync,nagain,n2pass,ntrials,naggressive,ndepth,ndecoded)
minsync,nagain,n2pass,nrobust,ntrials,naggressive,ndepth,ndecoded)
! Process dd0() data to find and decode JT65 signals.
@@ -7,7 +7,6 @@ subroutine jt65a(dd0,npts,newdat,nutc,nf1,nf2,nfqso,ntol,nsubmode, &
parameter (NFFT=1000)
real dd0(NZMAX)
real dd(NZMAX)
! integer*2 id2(NZMAX)
real ss(322,NSZ)
real savg(NSZ)
real a(5)
@@ -17,7 +16,7 @@ subroutine jt65a(dd0,npts,newdat,nutc,nf1,nf2,nfqso,ntol,nsubmode, &
real dt
real sync
end type candidate
type(candidate) ca(300)
type(candidate) ca(300), car(300)
type decode
real freq
real dt
@@ -31,11 +30,10 @@ subroutine jt65a(dd0,npts,newdat,nutc,nf1,nf2,nfqso,ntol,nsubmode, &
dd=dd0
ndecoded=0
do ipass=1,n2pass ! 2-pass decoding loop
newdat=1
if(ipass.eq.1) then !first-pass parameters
thresh0=2.5 ! use thresh0=2.0 for -24dB files when using 1-bit sync ccf
thresh0=2.5
nsubtract=1
elseif( ipass.eq.2 ) then !second-pass parameters
thresh0=2.5
@@ -54,24 +52,51 @@ subroutine jt65a(dd0,npts,newdat,nutc,nf1,nf2,nfqso,ntol,nsubmode, &
! nfa=max(200,nfqso-ntol)
! nfb=min(4000,nfqso+ntol)
ncand=0
nrobust=0 ! controls use of robust correlation estimator in sync65
call timer('sync65 ',0)
call sync65(ss,nfa,nfb,nhsym,ca,ncand,nrobust) !Get a list of JT65 candidates
call timer('sync65 ',1)
! When AGC threshold is set too low, noise will suddenly quiet when a strong
! signal starts up. This causes a lot of false syncs, and bogs down the decoder.
! If 1-bit correlation doesn't tame the resulting false syncs then, as a last
! resort, drop down to nrials=100.
if(ncand.ge.50) then
! OPTION 2 is not used at present. Checkbox in Advanced setup selects nrobust=1
! nrobust = 0: use only float ccf
! nrobust = 1: use only robust (1-bit) ccf
! nrobust = 2: use algorithm below
! find ncand using float ccf and ncandr using 1-bit ccf
! if ncand>50, use robust ccf
! if ncand<25 and ncandr<25, form union of both sets
! else, use float ccf
if( (nrobust.eq.0) .or. (nrobust.eq.2) ) then
ncand=0
nrobust=1
call timer('sync65 ',0)
call sync65(ss,nfa,nfb,nhsym,ca,ncand,nrobust) !Get a list of JT65 candidates
call sync65(ss,nfa,nfb,nhsym,ca,ncand,0)
call timer('sync65 ',1)
endif
!write(*,*) 'ncand',ncand
if( (nrobust.eq.1) .or. (nrobust.eq.2) ) then
ncandr=0
call timer('sync65 ',0)
call sync65(ss,nfa,nfb,nhsym,car,ncandr,1)
call timer('sync65 ',1)
endif
if( (nrobust.eq.1) .or. ((nrobust.eq.2) .and. (ncand.gt.50)) ) then
ncand=ncandr
do i=1,ncand
ca(i)=car(i)
enddo
elseif(nrobust.eq.2.and.ncand.le.25.and.ncandr.le.25) then
do icand=1,ncand ! combine ca and car, without dupes
ndupe=0
do j=1,ncandr
if( abs(ca(icand)%freq-car(j)%freq) .lt. 1.0 ) then
ndupe=1
endif
enddo
if( ndupe.eq.0 ) then
ncandr=ncandr+1
car(ncandr)=ca(icand)
endif
enddo
ncand=ncandr
do i=1,ncand
ca(i)=car(i)
enddo
endif
nvec=ntrials
if(ncand.gt.75) then
! write(*,*) 'Pass ',ipass,' ncandidates too large ',ncand