First fully working version of 'a7' (q3-style) decoding for FT8.

This commit is contained in:
Joe Taylor 2021-10-28 15:01:00 -04:00
parent 5a0cb0f0a0
commit 2b25c51169
4 changed files with 62 additions and 10 deletions

View File

@ -336,6 +336,7 @@ set (wsjt_FSRCS
lib/timer_module.f90
lib/wavhdr.f90
lib/qra/q65/q65_encoding_modules.f90
lib/ft8_a7.f90
# remaining non-module sources
lib/addit.f90

View File

@ -104,13 +104,6 @@ subroutine ft8b(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,nzhsym,lapon, &
call timer('ft8_down',0)
call ft8_downsample(dd0,newdat,f1,cd0) !Mix f1 to baseband and downsample
call timer('ft8_down',1)
if(abs(nint(f1)-527).le.1) then
rewind(40)
do i=0,3199
write(40,3040) i,i/200.0,cd0(i)
3040 format(i5,f10.6,2x,2f10.3)
enddo
endif
i0=nint((xdt+0.5)*fs2) !Initial guess for start of signal
smax=0.0

View File

@ -69,6 +69,14 @@ subroutine ft8q3(cd,xdt,f0,call_1,call_2,grid4,msgbest,snr)
! Generate complex cwave
call gen_ft8wave(itone,NN,NSPS,bt,fs,f0,cwave,xjunk,1,NWAVE)
if(imsg.eq.79) then
print*,NN,NSPS,bt,fs,f0,NWAVE,itone(1:7)
do i=0,NWAVE-1
write(45,3045) i,cd(i),100*cwave(i)
3045 format(i5,4e12.3)
enddo
endif
lagmax=-1
ccfmax=0.
nsum=32*2

View File

@ -38,6 +38,7 @@ contains
use iso_c_binding, only: c_bool, c_int
use timer_module, only: timer
use shmem, only: shmem_lock, shmem_unlock
use ft8_a7
include 'ft8/ft8_params.f90'
@ -64,13 +65,31 @@ contains
integer itone_save(NN,MAX_EARLY)
real f1_save(MAX_EARLY)
real xdt_save(MAX_EARLY)
complex cd0(0:3199)
data nutc0/-1/
save s,dd,dd1,ndec_early,itone_save,f1_save,xdt_save,lsubtracted,allmessages
save s,dd,dd1,nutc0,ndec_early,itone_save,f1_save,xdt_save,lsubtracted,&
allmessages
this%callback => callback
write(datetime,1001) nutc !### TEMPORARY ###
1001 format("000000_",i6.6)
if(nutc0.eq.-1) then
msg0=' '
endif
if(nutc.ne.nutc0) then
! New UTC. Move previously saved 'a7' data from k=1 to k=0
iz=ndec(jseq,1)
dt0(1:iz,jseq,0) = dt0(1:iz,jseq,1)
f0(1:iz,jseq,0) = f0(1:iz,jseq,1)
msg0(1:iz,jseq,0) = msg0(1:iz,jseq,1)
ndec(jseq,0)=iz
ndec(jseq,1)=0
nutc0=nutc
! print*,'BBB',jseq,ndec(0,0),ndec(0,1)
endif
if(ndepth.eq.1 .and. nzhsym.lt.50) then
ndec_early=0
return
@ -198,6 +217,7 @@ contains
qual=1.0-(nharderrors+dmin)/60.0 ! scale qual to [0.0,1.0]
if(emedelay.ne.0) xdt=xdt+2.0
call this%callback(sync,nsnr,xdt,f1,msg37,iaptype,qual)
call ft8_a7_save(nutc,xdt,f1,msg37)
endif
endif
call timestamp(tsec,tseq,ctime)
@ -209,7 +229,37 @@ contains
800 ndec_early=0
if(nzhsym.lt.50) ndec_early=ndecodes
900 return
900 continue
! if(nzhsym.eq.50) print*,'AA0',jseq,ndec(0,0),ndec(0,1)
if(nzhsym.eq.50 .and. ndec(jseq,0).ge.1) then
call timer('ft8_dec7',0)
newdat=.true.
do i=1,ndec(jseq,0)
if(f0(i,jseq,0).eq.-99.0) exit
if(f0(i,jseq,0).eq.-98.0) cycle
! f0(i,jseq,0)=527
! msg0(i,jseq,0)='LX1KL OE6MDF'
! print*,'aa',i,jseq,newdat,f0(i,jseq,0),trim(msg0(i,jseq,0))
call ft8_downsample(dd,newdat,f0(i,jseq,0),cd0)
call ft8_dec7(cd0,dt0(i,jseq,0),f0(i,jseq,0),msg0(i,jseq,0),msg37,snr7)
if(snr7.gt.4.0) then
! print*,i,msg0(i,jseq,0)(1:22),msg37(1:22),snr7
if(associated(this%callback)) then
nsnr=nint(db(snr7)-24.0)
xdt=0.
f1=f0(i,jseq,0)
iaptype=7
qual=1.0
call this%callback(sync,nsnr,xdt,f1,msg37,iaptype,qual)
endif
endif
newdat=.false.
enddo
call timer('ft8_dec7',1)
endif
return
end subroutine decode
subroutine timestamp(tsec,tseq,ctime)