From a516184a3cfbc3bfbfcdd6d9135811c0a90bcf13 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 13 Feb 2024 14:56:20 -0500 Subject: [PATCH] Work in progress, starting toward implementing soft-decision ftrsd decoder. --- CMakeLists.txt | 1 + lib/superfox/sfox_demod.f90 | 2 ++ lib/superfox/sfoxtest.f90 | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b54d67ac2..a7bae6402 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -591,6 +591,7 @@ set (wsjt_FSRCS lib/superfox/sfox_sync.f90 lib/superfox/sfox_demod.f90 lib/superfox/sfox_clo.f90 + lib/superfox/sym_prob.f90 lib/superfox/ran1.f90 ) diff --git a/lib/superfox/sfox_demod.f90 b/lib/superfox/sfox_demod.f90 index 6186aac22..d7b993bf1 100644 --- a/lib/superfox/sfox_demod.f90 +++ b/lib/superfox/sfox_demod.f90 @@ -11,10 +11,12 @@ subroutine sfox_demod(crcvd,f,t,s3,chansym) i0=nint(12000.0*t) df=12000.0/NSPS j0=nint(f/df)-NQ/2 + chansym=0 do n=1,ND !Loop over all symbols ib=n*NSPS + i0 if(n.gt.ND1) ib=(NS+n)*NSPS + i0 ia=ib-NSPS+1 + chansym(n)=0 if(ia.lt.1 .or. ib.gt.NMAX) cycle c=crcvd(ia:ib) call four2a(c,NSPS,1,-1,1) !Compute symbol spectrum diff --git a/lib/superfox/sfoxtest.f90 b/lib/superfox/sfoxtest.f90 index bed48477d..0d9e33247 100644 --- a/lib/superfox/sfoxtest.f90 +++ b/lib/superfox/sfoxtest.f90 @@ -13,13 +13,16 @@ program sfoxtest complex cnoise(NMAX) !Complex noise complex crcvd(NMAX) !Signal as received real a(3) - real, allocatable :: s3(:,:) !Symbol spectra: will be s3(NQ,ND) integer, allocatable :: msg0(:) !Information symbols integer, allocatable :: parsym(:) !Parity symbols integer, allocatable :: chansym0(:) !Encoded data, 7-bit integers integer, allocatable :: chansym(:) !Recovered hard-decision symbols integer, allocatable :: iera(:) !Positions of erasures + integer, allocatable :: rxdat(:) + integer, allocatable :: rxprob(:) + integer, allocatable :: rxdat2(:) + integer, allocatable :: rxprob2(:) character fname*17,arg*12,itu*2 nargs=iargc() @@ -78,6 +81,10 @@ program sfoxtest allocate(chansym0(1:NN)) allocate(chansym(1:NN)) allocate(iera(1:NN)) + allocate(rxdat(0:ND-1)) + allocate(rxprob(0:ND-1)) + allocate(rxdat2(0:ND-1)) + allocate(rxprob2(0:ND-1)) rms=100. fsample=12000.0 !Sample rate (Hz) @@ -165,10 +172,19 @@ program sfoxtest call twkfreq(crcvd,crcvd,NMAX,12000.0,a) f=1500.0 call sfox_demod(crcvd,f,t,s3,chansym) !Get s3 and hard symbol values + call sym_prob(s3,rxdat,rxprob,rxdat2,rxprob2) + chansym(1:ND)=rxdat !### TEMPORARY ? ### +! do j=0,ND-1 +! do j=0,5 +! write(*,3001) j,chansym(1+j),rxdat(j),rxprob(j),rxdat2(j),rxprob2(j) +!3001 format('prob'i5,5i8) +! enddo nera=0 chansym=mod(chansym,nq) !Enforce 0 to nq-1 nharderr=count(chansym.ne.chansym0) !Count hard errors +! nhard2=count(rxdat.ne.chansym0(1:ND)) !Count hard errors +! print*,'A',nharderr,nhard2 ntot=ntot+nharderr nworst=max(nworst,nharderr) call rs_decode_sf(chansym,iera,nera,nfixed) !Call the decoder