From 7e9cc9cbc7c0283591ef6ee688f6b06e4c7fd191 Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Fri, 14 Jun 2019 16:28:59 -0500 Subject: [PATCH] FT4: Improve sync performance on disturbed channels. Make jt9 command-line option -d work --- lib/ft4/sync4d.f90 | 10 ++++++---- lib/ft4_decode.f90 | 7 +++---- lib/jt9.f90 | 1 - 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/ft4/sync4d.f90 b/lib/ft4/sync4d.f90 index 28cb10b99..810412253 100644 --- a/lib/ft4/sync4d.f90 +++ b/lib/ft4/sync4d.f90 @@ -9,7 +9,6 @@ subroutine sync4d(cd0,i0,ctwk,itwk,sync) complex csync2(2*NSS) complex ctwk(2*NSS) complex z1,z2,z3,z4 - complex zz1,zz2,zz3,zz4 logical first integer icos4a(0:3),icos4b(0:3),icos4c(0:3),icos4d(0:3) data icos4a/0,1,3,2/ @@ -19,7 +18,7 @@ subroutine sync4d(cd0,i0,ctwk,itwk,sync) data first/.true./ save first,twopi,csynca,csyncb,csyncc,csyncd,fac - p(z1)=real(z1*fac)**2 + aimag(z1*fac)**2 !Statement function for power + p(z1)=sqrt(real(z1*fac)**2 + aimag(z1*fac)**2) !Statement function for power if( first ) then twopi=8.0*atan(1.0) @@ -60,11 +59,12 @@ subroutine sync4d(cd0,i0,ctwk,itwk,sync) z4=0. if(itwk.eq.1) csync2=ctwk*csynca !Tweak the frequency + z1=0. if(i1.ge.0 .and. i1+4*NSS-1.le.NP-1) then z1=sum(cd0(i1:i1+4*NSS-1:2)*conjg(csync2)) elseif( i1.lt.0 ) then npts=(i1+4*NSS-1)/2 - if(npts.le.8) then + if(npts.le.16) then z1=0. else z1=sum(cd0(0:i1+4*NSS-1:2)*conjg(csync2(2*NSS-npts:))) @@ -78,16 +78,18 @@ subroutine sync4d(cd0,i0,ctwk,itwk,sync) if(i3.ge.0 .and. i3+4*NSS-1.le.NP-1) z3=sum(cd0(i3:i3+4*NSS-1:2)*conjg(csync2)) if(itwk.eq.1) csync2=ctwk*csyncd !Tweak the frequency + z4=0. if(i4.ge.0 .and. i4+4*NSS-1.le.NP-1) then z4=sum(cd0(i4:i4+4*NSS-1:2)*conjg(csync2)) elseif( i4+4*NSS-1.gt.NP-1 ) then npts=(NP-1-i4+1)/2 - if(npts.le.8) then + if(npts.le.16) then z4=0. else z4=sum(cd0(i4:i4+2*npts-1:2)*conjg(csync2(1:npts))) endif endif + sync = p(z1) + p(z2) + p(z3) + p(z4) return diff --git a/lib/ft4_decode.f90 b/lib/ft4_decode.f90 index 28c044c77..0c1a4026f 100644 --- a/lib/ft4_decode.f90 +++ b/lib/ft4_decode.f90 @@ -285,12 +285,10 @@ contains else cd(-ibest:ibest+NN*NSS-1)=cb(0:NN*NSS+2*ibest-1) endif - call timer('bitmet ',0) call get_ft4_bitmetrics(cd,bitmetrics,badsync) call timer('bitmet ',1) if(badsync) cycle - hbits=0 where(bitmetrics(:,1).ge.0) hbits=1 ns1=count(hbits( 1: 8).eq.(/0,0,0,1,1,0,1,1/)) @@ -405,7 +403,7 @@ contains if(doosd .and. nharderror.lt.0) then ndeep=3 - if(abs(nfqso-f1).le.napwid) then + if(abs(nfqso-f0).le.napwid) then ndeep=4 endif call timer('osd174_91 ',0) @@ -439,7 +437,8 @@ contains endif nsnr=nint(max(-21.0,xsnr)) xdt=ibest/666.67 - 0.5 -!write(21,'(i6.6,i5,2x,f4.1,i6,2x,a37,2x,f4.1,3i3,f5.1)') nutc,nsnr,xdt,nint(f0),message,sync,iaptype,ipass,isp,dmin +!write(21,'(i6.6,i5,2x,f4.1,i6,2x,a37,2x,f4.1,3i3,f5.1,i4,i4)') & +! nutc,nsnr,xdt,nint(f0),message,sync,iaptype,ipass,isp,dmin,nsync_qual,nharderror call this%callback(sync,nsnr,xdt,f0,message,iaptype,qual) exit endif diff --git a/lib/jt9.f90 b/lib/jt9.f90 index 0e99a7592..2e8dbd0f0 100644 --- a/lib/jt9.f90 +++ b/lib/jt9.f90 @@ -179,7 +179,6 @@ program jt9 go to 999 endif - if(mode.eq.5) ndepth=3 allocate(shared_data) nflatten=0