From fde606a912aed27fcfb8a1f2575b0ecb6f6bb402 Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Wed, 19 Oct 2016 20:31:18 +0000 Subject: [PATCH] Fix typo in hspec. Minor tweaks to comments in msk40decodeframe. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7204 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/hspec.f90 | 2 +- lib/msk40decodeframe.f90 | 24 +++++++++--------------- 2 files changed, 10 insertions(+), 16 deletions(-) diff --git a/lib/hspec.f90 b/lib/hspec.f90 index 6327690f8..c5757e2ba 100644 --- a/lib/hspec.f90 +++ b/lib/hspec.f90 @@ -80,7 +80,7 @@ subroutine hspec(id2,k,nutc0,ntrpdepth,nrxfreq,ntol,bmsk144,ingain, & tt1=sum(float(abs(id2(k0:k0+3583)))) k0=k-3584 tt2=sum(float(abs(id2(k0:k0+3583)))) - if(tt.ne.0.0 .and. tt2.ne.0) then + if(tt1.ne.0.0 .and. tt2.ne.0) then call mskrtd(id2(k-7168+1:k),nutc0,tsec,ntol,nrxfreq,ndepth, & mycall,hiscall,bshmsg,line1) endif diff --git a/lib/msk40decodeframe.f90 b/lib/msk40decodeframe.f90 index df8cf9013..79bd2a036 100644 --- a/lib/msk40decodeframe.f90 +++ b/lib/msk40decodeframe.f90 @@ -11,7 +11,6 @@ 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) real*8 dt, fs, pi, twopi real cbi(42),cbq(42) real pp(12) @@ -53,14 +52,10 @@ 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) - hashmsg=trim(mycall)//' '//trim(hiscall) - call fmtmsg(hashmsg,iz) - call hash(hashmsg,22,ihash) - ihash=iand(ihash,4095) -! nhashes(i)=iand(ihash,4095) -! enddo + hashmsg=trim(mycall)//' '//trim(hiscall) + call fmtmsg(hashmsg,iz) + call hash(hashmsg,22,ihash) + ihash=iand(ihash,4095) mycall0=mycall hiscall0=hiscall endif @@ -76,7 +71,7 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,msgreceived,nsuccess) cfac=cmplx(cos(phase0),sin(phase0)) c=c*conjg(cfac) -! matched filter - +! Matched filter. softbits(1)=sum(imag(c(1:6))*pp(7:12))+sum(imag(c(NSPM-5:NSPM))*pp(1:6)) softbits(2)=sum(real(c(1:12))*pp) do i=2,20 @@ -84,8 +79,8 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,msgreceived,nsuccess) softbits(2*i)=sum(real(c(7+(i-1)*12-6:7+(i-1)*12+5))*pp) enddo -! sync word hard error weight is used as a discriminator for -! frames that have reasonable probability of decoding +! Sync word hard error weight is used to reject frames that +! are unlikely to decode. hardbits=0 do i=1,40 if( softbits(i) .ge. 0.0 ) then @@ -98,7 +93,7 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,msgreceived,nsuccess) return endif -! normalize the softsymbols before submitting to decoder +! Normalize the softsymbols before submitting to decoder. sav=sum(softbits)/40 s2av=sum(softbits*softbits)/40 ssig=sqrt(s2av-sav*sav) @@ -129,8 +124,7 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,msgreceived,nsuccess) enddo nrxrpt=iand(imsg,15) nrxhash=(imsg-nrxrpt)/16 -!write(*,*) 'decodeframe ',nhammd,cord,nrxhash,nrxrpt,ihash -! if(nhammd.le.5 .and. cord .lt. 1.7 .and. nrxhash.eq.nhashes(nrxrpt)) then +!write(*,*) 'decodeframe ',nhammd,cord,nrxhash,nrxrpt,ihash,xsnr,sigma 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), &