From 68beed88a79411a82ca3316853c6ba7cbaf8308b Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Fri, 8 Jun 2018 16:21:21 -0500 Subject: [PATCH] Change to Gray bit to symbol mapping for (174,91) messages. --- lib/ft8/ft8b_2.f90 | 24 +++++++++++++----------- lib/ft8/genft8_174_91.f90 | 6 +++++- lib/ft8/sync8d.f90 | 2 +- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/lib/ft8/ft8b_2.f90 b/lib/ft8/ft8b_2.f90 index 241cd7c51..f20c1ee62 100644 --- a/lib/ft8/ft8b_2.f90 +++ b/lib/ft8/ft8b_2.f90 @@ -172,8 +172,9 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & i1=3*j ! Max amplitude ps=s1(0:7,j) - r1=max(ps(1),ps(3),ps(5),ps(7))-max(ps(0),ps(2),ps(4),ps(6)) - r2=max(ps(2),ps(3),ps(6),ps(7))-max(ps(0),ps(1),ps(4),ps(5)) +! For Gray bit-to-symbol mapping + r1=max(ps(1),ps(2),ps(5),ps(6))-max(ps(0),ps(3),ps(4),ps(7)) + r2=max(ps(2),ps(3),ps(4),ps(5))-max(ps(0),ps(1),ps(6),ps(7)) r4=max(ps(4),ps(5),ps(6),ps(7))-max(ps(0),ps(1),ps(2),ps(3)) bmeta(i4)=r4 bmeta(i2)=r2 @@ -183,18 +184,19 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & bmetap(i1)=r1 ! Max log metric psl=log(ps+1e-32) - r1=max(psl(1),psl(3),psl(5),psl(7))-max(psl(0),psl(2),psl(4),psl(6)) - r2=max(psl(2),psl(3),psl(6),psl(7))-max(psl(0),psl(1),psl(4),psl(5)) - r4=max(psl(4),psl(5),psl(6),psl(7))-max(psl(0),psl(1),psl(2),psl(3)) +! Gray bit-to-symbol mapping + r1=max(psl(1),psl(2),psl(5),psl(6))-max(psl(0),psl(3),psl(4),ps(7)) + r2=max(psl(2),psl(3),psl(4),psl(5))-max(psl(0),psl(1),psl(6),ps(7)) + r4=max(psl(4),psl(5),psl(6),psl(7))-max(psl(0),psl(1),psl(2),ps(3)) bmetb(i4)=r4 bmetb(i2)=r2 bmetb(i1)=r1 ! Metric for Cauchy noise -! r1=log(ps(1)**3+ps(3)**3+ps(5)**3+ps(7)**3)- & -! log(ps(0)**3+ps(2)**3+ps(4)**3+ps(6)**3) -! r2=log(ps(2)**3+ps(3)**3+ps(6)**3+ps(7)**3)- & -! log(ps(0)**3+ps(1)**3+ps(4)**3+ps(5)**3) +! r1=log(ps(1)**3+ps(2)**3+ps(5)**3+ps(6)**3)- & +! log(ps(0)**3+ps(3)**3+ps(4)**3+ps(7)**3) +! r2=log(ps(2)**3+ps(3)**3+ps(4)**3+ps(5)**3)- & +! log(ps(0)**3+ps(1)**3+ps(6)**3+ps(7)**3) ! r4=log(ps(4)**3+ps(5)**3+ps(6)**3+ps(7)**3)- & ! log(ps(0)**3+ps(1)**3+ps(2)**3+ps(3)**3) ! Metric for AWGN, no fading @@ -207,8 +209,8 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, & ! b5=bessi0(bscale*ps(5)) ! b6=bessi0(bscale*ps(6)) ! b7=bessi0(bscale*ps(7)) -! r1=log(b1+b3+b5+b7)-log(b0+b2+b4+b6) -! r2=log(b2+b3+b6+b7)-log(b0+b1+b4+b5) +! r1=log(b1+b2+b5+b6)-log(b0+b3+b4+b7) +! r2=log(b2+b3+b4+b5)-log(b0+b1+b6+b7) ! r4=log(b4+b5+b6+b7)-log(b0+b1+b2+b3) if(nQSOProgress .eq. 0 .or. nQSOProgress .eq. 5) then diff --git a/lib/ft8/genft8_174_91.f90 b/lib/ft8/genft8_174_91.f90 index d6f98f284..6561a36b6 100644 --- a/lib/ft8/genft8_174_91.f90 +++ b/lib/ft8/genft8_174_91.f90 @@ -14,8 +14,10 @@ subroutine genft8_174_91(msg,mygrid,bcontest,i5bit,msgsent,msgbits,itone) integer*1, target:: i1Msg8BitBytes(12) integer itone(79) integer icos7(0:6) + integer graymap(0:7) # data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern data icos7/3,1,4,0,6,5,2/ !Costas 7x7 tone pattern + data graymap/0,1,3,2,7,6,4,5/ call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent @@ -46,7 +48,9 @@ subroutine genft8_174_91(msg,mygrid,bcontest,i5bit,msgsent,msgbits,itone) i=3*j -2 k=k+1 if(j.eq.30) k=k+7 - itone(k)=codeword(i)*4 + codeword(i+1)*2 + codeword(i+2) + indx=codeword(i)*4 + codeword(i+1)*2 + codeword(i+2) +! itone(k)=graymap(indx) + itone(k)=indx enddo return diff --git a/lib/ft8/sync8d.f90 b/lib/ft8/sync8d.f90 index 708a8e8a5..4c0c30b23 100644 --- a/lib/ft8/sync8d.f90 +++ b/lib/ft8/sync8d.f90 @@ -5,7 +5,7 @@ subroutine sync8d(cd0,i0,ctwk,itwk,itype,sync) parameter(NP2=2812,NDOWN=60) complex cd0(3125) - complex csync(0:6,32),csync_1(0:6,32),csync_2(0:6,32) + complex csync_1(0:6,32),csync_2(0:6,32) complex csync2(32) complex ctwk(32) complex z1,z2,z3