diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 9a0213aef..7451f229e 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -192,7 +192,6 @@ contains real, intent(in) :: dt integer, intent(in) :: freq logical, intent(in) :: flip - character(len=1) :: cused, csync cused = '.' @@ -203,8 +202,8 @@ contains 1000 format(a1,i5.4,f6.1,f6.2,i6,1x,a1) end subroutine jt4_average - subroutine jt65_decoded(this,utc,sync,snr,dt,freq,drift,width,decoded0,ft, & - qual,nsmo,nsum,minsync,nsubmode,naggressive) + subroutine jt65_decoded(this,utc,sync,snr,dt,freq,drift,nflip,width, & + decoded0,ft,qual,nsmo,nsum,minsync,nsubmode,naggressive) use jt65_decode implicit none @@ -216,6 +215,7 @@ contains real, intent(in) :: dt integer, intent(in) :: freq integer, intent(in) :: drift + integer, intent(in) :: nflip real, intent(in) :: width character(len=22), intent(in) :: decoded0 integer, intent(in) :: ft @@ -226,9 +226,10 @@ contains integer, intent(in) :: nsubmode integer, intent(in) :: naggressive - integer n + integer i,n character*5 ctail character*22 decoded + character*1 csync character*36 c data c/'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'/ @@ -255,7 +256,20 @@ contains if(qual.lt.3) decoded(21:21)='?' endif endif - write(*,1010) utc,snr,dt,freq,'#',decoded,ctail + csync=' ' + if(sync.ge.float(minsync)) then + csync='*' + if(nflip.eq.-1) then + csync='#' + if(decoded.ne.' ') then + do i=22,1,-1 + if(decoded(i:i).ne.' ') exit + enddo + decoded(i+2:i+4)='OOO' + endif + endif + endif + write(*,1010) utc,snr,dt,freq,csync,decoded,ctail 1010 format(i4.4,i4,f5.1,i5,1x,a1,1x,a22,a5) endif diff --git a/lib/fqso_first.f90 b/lib/fqso_first.f90 index d75dac9b8..e553e3e44 100644 --- a/lib/fqso_first.f90 +++ b/lib/fqso_first.f90 @@ -6,6 +6,7 @@ subroutine fqso_first(nfqso,ntol,ca,ncand) real freq real dt real sync + real flip end type candidate type(candidate) ca(300),cb diff --git a/lib/jt65_decode.f90 b/lib/jt65_decode.f90 index 91666968a..3be36fff7 100644 --- a/lib/jt65_decode.f90 +++ b/lib/jt65_decode.f90 @@ -13,7 +13,7 @@ module jt65_decode ! abstract interface subroutine jt65_decode_callback(this,utc,sync,snr,dt,freq,drift, & - width,decoded,ft,qual,nsmo,nsum,minsync,nsubmode,naggressive) + nflip,width,decoded,ft,qual,nsmo,nsum,minsync,nsubmode,naggressive) import jt65_decoder implicit none @@ -24,6 +24,7 @@ module jt65_decode real, intent(in) :: dt integer, intent(in) :: freq integer, intent(in) :: drift + integer, intent(in) :: nflip real, intent(in) :: width character(len=22), intent(in) :: decoded integer, intent(in) :: ft @@ -69,6 +70,7 @@ contains real freq real dt real sync + real flip end type candidate type(candidate) ca(300) type accepted_decode @@ -170,7 +172,7 @@ contains endif mode65=2**nsubmode - nflip=1 !### temporary ### + nflip=1 nqd=0 decoded0="" freq0=0. @@ -185,6 +187,11 @@ contains sync1=ca(icand)%sync dtx=ca(icand)%dt freq=ca(icand)%freq + if(single_decode) then + flip=ca(icand)%flip + nflip=flip + if(sync1.lt.float(minsync)) cycle + endif if(ipass.eq.1) ntry65a=ntry65a + 1 if(ipass.eq.2) ntry65b=ntry65b + 1 call timer('decod65a',0) @@ -233,8 +240,8 @@ contains if (associated(this%callback) .and. nsum.ge.2) then call this%callback(nutc,sync1,nsnr,dtx-1.0,nfreq,ndrift, & - width,avemsg,nftt,nqave,nsmo,nsum,minsync,nsubmode, & - naggressive) + nflip,width,avemsg,nftt,nqave,nsmo,nsum,minsync, & + nsubmode,naggressive) prtavg=.true. cycle end if @@ -285,8 +292,8 @@ contains nqual=min(qual,9999.0) if (associated(this%callback)) then call this%callback(nutc,sync1,nsnr,dtx-1.0,nfreq,ndrift, & - width,decoded,nft,nqual,nsmo,nsum,minsync,nsubmode, & - naggressive) + nflip,width,decoded,nft,nqual,nsmo,nsum,minsync, & + nsubmode,naggressive) end if endif decoded0=decoded diff --git a/lib/jt65_test.f90 b/lib/jt65_test.f90 index a570e75f6..d14110f35 100644 --- a/lib/jt65_test.f90 +++ b/lib/jt65_test.f90 @@ -37,8 +37,8 @@ contains call timer('jt65a ',1) end subroutine test - subroutine my_callback (this,utc,sync,snr,dt,freq,drift,width,decoded & - , ft, qual, smo, sum, minsync, submode, aggression) + subroutine my_callback (this,utc,sync,snr,dt,freq,drift,nflip,width, & + decoded,ft,qual,smo,sum,minsync,submode,aggression) use jt65_decode implicit none @@ -49,6 +49,7 @@ contains real, intent(in) :: dt integer, intent(in) :: freq integer, intent(in) :: drift + integer, intent(in) :: nflip real, intent(in) :: width character(len=22), intent(in) :: decoded integer, intent(in) :: ft @@ -63,6 +64,7 @@ contains t=max(0.0,width*width-7.2) nwidth=max(nint(sqrt(t)),2) +!### deal with nflip here! ### write(*,1010) utc,snr,dt,freq,decoded 1010 format(i4.4,i4,f5.1,i5,1x,'#',1x,a22) write(13,1012) utc,nint(sync),snr,dt,freq,drift,nwidth, & diff --git a/lib/sync65.f90 b/lib/sync65.f90 index 7e60d5fc4..e623654c1 100644 --- a/lib/sync65.f90 +++ b/lib/sync65.f90 @@ -11,6 +11,7 @@ subroutine sync65(ss,nfa,nfb,naggressive,ntol,nhsym,ca,ncand,nrobust, & real freq real dt real sync + real flip end type candidate type(candidate) ca(MAXCAND) @@ -76,13 +77,14 @@ subroutine sync65(ss,nfa,nfb,naggressive,ntol,nhsym,ca,ncand,nrobust, & ccfblue(lag2)=0. ca(ncand)%freq=freq ca(ncand)%dt=dtx + ca(ncand)%flip=flip if(single_decode) then ca(ncand)%sync=db(ccfred(i)) - 16.0 else ca(ncand)%sync=ccfred(i) endif endif - if(ncand.eq.MAXCAND) return + if(ncand.eq.MAXCAND) exit enddo return