From 5984d5ea4276d1aac4456e4e198be5d293a1e9c0 Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Tue, 18 Oct 2016 01:31:53 +0000 Subject: [PATCH] Experimental change to Sh message hashing scheme. Not yet tested. Not for use on the air and not compatible with current Sh messages. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7195 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/detectmsk40.f90 | 17 ++++++++++------- lib/genmsk40.f90 | 3 ++- lib/msk40decodeframe.f90 | 17 ++++++++++------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/lib/detectmsk40.f90 b/lib/detectmsk40.f90 index 46daff68b..ba894f9ba 100644 --- a/lib/detectmsk40.f90 +++ b/lib/detectmsk40.f90 @@ -21,7 +21,7 @@ subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages, & complex bb(6) integer s8(8),s8r(8),hardbits(40) integer, dimension(1) :: iloc - integer nhashes(0:15) +! integer nhashes(0:15) integer indices(MAXSTEPS) integer ipeaks(10) integer*1 cw(32) @@ -53,7 +53,7 @@ subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages, & data s8r/1,0,1,1,0,0,0,1/ ! codeword for the message RRR data testcw/0,1,0,0,0,1,0,1,0,0,1,1,1,1,0,1,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0/ - save df,first,cb,cbr,fs,nhashes,pi,twopi,dt,s8,s8r,rcw,pp,nmatchedfilter,rpt,mycall0,hiscall0 + save df,first,cb,cbr,fs,pi,twopi,dt,s8,s8r,rcw,pp,nmatchedfilter,rpt,mycall0,hiscall0 if(first) then nmatchedfilter=1 @@ -96,12 +96,14 @@ subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages, & endif if(mycall.ne.mycall0 .or. hiscall.ne.hiscall0) then - do i=0,15 - hashmsg=trim(mycall)//' '//trim(hiscall)//' '//rpt(i) +! do i=0,15 +! hashmsg=trim(mycall)//' '//trim(hiscall)//' '//rpt(i) + hashmsg=trim(mycall)//' '//trim(hiscall) call fmtmsg(hashmsg,iz) call hash(hashmsg,22,ihash) - nhashes(i)=iand(ihash,4095) - enddo +! nhashes(i)=iand(ihash,4095) + ihash=iand(ihash,4095) +! enddo mycall0=mycall hiscall0=hiscall endif @@ -397,7 +399,8 @@ subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages, & enddo nrxrpt=iand(imsg,15) nrxhash=(imsg-nrxrpt)/16 - if( nhammd .le. 5 .and. cord .lt. 1.7 .and. nrxhash .eq. nhashes(nrxrpt) ) then +! if( nhammd .le. 5 .and. cord .lt. 1.7 .and. nrxhash .eq. nhashes(nrxrpt) ) then + if( nhammd .le. 5 .and. cord .lt. 1.7 .and. nrxhash .eq. ihash ) then fest=1500+ferr+ferr2+deltaf !write(14,'(i6.6,11i6,f7.1,f7.1)') nutc,ip,ipk,id,idf,iav,ipha,niterations,nbadsync,nrxrpt,ncalls,nhammd,cord,xsnr nhashflag=1 diff --git a/lib/genmsk40.f90 b/lib/genmsk40.f90 index 805b5caf8..e15188dcb 100644 --- a/lib/genmsk40.f90 +++ b/lib/genmsk40.f90 @@ -28,7 +28,8 @@ subroutine genmsk40(msg,msgsent,ichk,itone,itype) 10 irpt=i !Report index, 0-15 if(ichk.lt.10000) then - hashmsg=msg(2:i1-1)//' '//crpt +! hashmsg=msg(2:i1-1)//' '//crpt + hashmsg=msg(2:i1-1) call hash(hashmsg,22,ihash) ihash=iand(ihash,4095) !12-bit hash ig=16*ihash + irpt !4-bit report diff --git a/lib/msk40decodeframe.f90 b/lib/msk40decodeframe.f90 index ebd515942..f6fa85a51 100644 --- a/lib/msk40decodeframe.f90 +++ b/lib/msk40decodeframe.f90 @@ -11,7 +11,7 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,msgreceived,nsuccess) integer*1 cw(32) integer*1 decoded(16) integer s8r(8),hardbits(40) - integer nhashes(0:15) +! integer nhashes(0:15) real*8 dt, fs, pi, twopi real cbi(42),cbq(42) real pp(12) @@ -24,7 +24,7 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,msgreceived,nsuccess) data rpt/"-03 ","+00 ","+03 ","+06 ","+10 ","+13 ","+16 ", & "R-03","R+00","R+03","R+06","R+10","R+13","R+16", & "RRR ","73 "/ - save first,cb,fs,nhashes,pi,twopi,dt,s8r,pp,rpt,mycall0,hiscall0 + save first,cb,fs,pi,twopi,dt,s8r,pp,rpt,mycall0,hiscall0 if(first) then ! define half-sine pulse and raised-cosine edge window @@ -53,12 +53,14 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,msgreceived,nsuccess) endif if(mycall.ne.mycall0 .or. hiscall.ne.hiscall0) then - do i=0,15 - hashmsg=trim(mycall)//' '//trim(hiscall)//' '//rpt(i) +! do i=0,15 +! hashmsg=trim(mycall)//' '//trim(hiscall)//' '//rpt(i) + hashmsg=trim(mycall)//' '//trim(hiscall) call fmtmsg(hashmsg,iz) call hash(hashmsg,22,ihash) - nhashes(i)=iand(ihash,4095) - enddo + ihash=iand(ihash,4095) +! nhashes(i)=iand(ihash,4095) +! enddo mycall0=mycall hiscall0=hiscall endif @@ -128,7 +130,8 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,msgreceived,nsuccess) nrxrpt=iand(imsg,15) nrxhash=(imsg-nrxrpt)/16 !write(*,*) 'decodeframe ',nhammd,cord,nrxhash,nrxrpt,nhashes(nrxrpt) - if(nhammd.le.5 .and. cord .lt. 1.7 .and. nrxhash.eq.nhashes(nrxrpt)) then +! if(nhammd.le.5 .and. cord .lt. 1.7 .and. nrxhash.eq.nhashes(nrxrpt)) then + if(nhammd.le.5 .and. cord .lt. 1.7 .and. nrxhash.eq.ihash) then nsuccess=1 write(msgreceived,'(a1,a,1x,a,a1,1x,a4)') "<",trim(mycall), & trim(hiscall),">",rpt(nrxrpt)