Work in progress, on Q65 message averaging.

This commit is contained in:
Joe Taylor 2020-12-26 10:04:17 -05:00
parent d5957f51f9
commit 3d042ee56f
4 changed files with 24 additions and 17 deletions

View File

@ -325,6 +325,7 @@ set (wsjt_FSRCS
lib/options.f90 lib/options.f90
lib/packjt.f90 lib/packjt.f90
lib/77bit/packjt77.f90 lib/77bit/packjt77.f90
lib/q65.f90
lib/q65_decode.f90 lib/q65_decode.f90
lib/readwav.f90 lib/readwav.f90
lib/timer_C_wrapper.f90 lib/timer_C_wrapper.f90
@ -495,6 +496,7 @@ set (wsjt_FSRCS
lib/polyfit.f90 lib/polyfit.f90
lib/prog_args.f90 lib/prog_args.f90
lib/ps4.f90 lib/ps4.f90
lib/q65_avg.f90
lib/q65_sync.f90 lib/q65_sync.f90
lib/qra/q65/q65_ap.f90 lib/qra/q65/q65_ap.f90
lib/qra/q65/q65_loops.f90 lib/qra/q65/q65_loops.f90

View File

@ -201,6 +201,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
if(params%nmode.eq.66) then !NB: JT65 = 65, Q65 = 66. if(params%nmode.eq.66) then !NB: JT65 = 65, Q65 = 66.
! We're in Q65 mode ! We're in Q65 mode
open(17,file=trim(temp_dir)//'/red.dat',status='unknown') open(17,file=trim(temp_dir)//'/red.dat',status='unknown')
open(14,file=trim(temp_dir)//'/avemsg.txt',status='unknown')
call timer('dec_q65 ',0) call timer('dec_q65 ',0)
call my_q65%decode(q65_decoded,id2,params%nutc,params%ntr, & call my_q65%decode(q65_decoded,id2,params%nutc,params%ntr, &
params%nsubmode,params%nfqso,params%ntol,params%ndepth, & params%nsubmode,params%nfqso,params%ntol,params%ndepth, &
@ -368,7 +369,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
endif endif
close(13) close(13)
if(ncontest.eq.6) close(19) if(ncontest.eq.6) close(19)
if(params%nmode.eq.4 .or. params%nmode.eq.65) close(14) if(params%nmode.eq.4 .or. params%nmode.eq.65 .or. params%nmode.eq.66) close(14)
return return

View File

@ -94,7 +94,7 @@ contains
dgen=0 dgen=0
call q65_enc(dgen,codewords) !Initialize Q65 call q65_enc(dgen,codewords) !Initialize Q65
call timer('sync_q65',0) call timer('sync_q65',0)
call q65_sync(nutc,iwave,ntrperiod*12000,mode65,codewords,ncw,nsps, & call q65_sync(nutc,iwave,ntrperiod,mode65,codewords,ncw,nsps, &
nfqso,ntol,ndepth,lclearave,emedelay,xdt,f0,snr1,width,dat4,snr2,id1) nfqso,ntol,ndepth,lclearave,emedelay,xdt,f0,snr1,width,dat4,snr2,id1)
call timer('sync_q65',1) call timer('sync_q65',1)
if(id1.eq.1 .or. id1.ge.12) then if(id1.eq.1 .or. id1.ge.12) then

View File

@ -1,4 +1,4 @@
subroutine q65_sync(nutc,iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, & subroutine q65_sync(nutc,iwave,ntrperiod,mode_q65,codewords,ncw,nsps,nfqso,ntol, &
ndepth,lclearave,emedelay,xdt,f0,snr1,width,dat4,snr2,id1) ndepth,lclearave,emedelay,xdt,f0,snr1,width,dat4,snr2,id1)
! Detect and align with the Q65 sync vector, returning time and frequency ! Detect and align with the Q65 sync vector, returning time and frequency
@ -17,7 +17,7 @@ subroutine q65_sync(nutc,iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, &
parameter (NSTEP=8) !Step size nsps/NSTEP parameter (NSTEP=8) !Step size nsps/NSTEP
parameter (LN=2176*63) !LN=LL*NN; LL=64*(mode_q65+2), NN=63 parameter (LN=2176*63) !LN=LL*NN; LL=64*(mode_q65+2), NN=63
parameter (PLOG_MIN=-240.0) !List decoding threshold parameter (PLOG_MIN=-240.0) !List decoding threshold
integer*2 iwave(0:nmax-1) !Raw data integer*2 iwave(0:12000*ntrperiod-1) !Raw data
integer isync(22) !Indices of sync symbols integer isync(22) !Indices of sync symbols
integer itone(85) integer itone(85)
integer codewords(63,206) integer codewords(63,206)
@ -142,13 +142,14 @@ subroutine q65_sync(nutc,iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, &
enddo enddo
! Compute 2D ccf using all 85 symbols in the list message ! Compute 2D ccf using all 85 symbols in the list message
ccf=0. ccf=0.
iia=200.0/df
do lag=lag1,lag2 do lag=lag1,lag2
do k=1,85 do k=1,85
j=j0 + NSTEP*(k-1) + 1 + lag j=j0 + NSTEP*(k-1) + 1 + lag
if(j.ge.1 .and. j.le.jz) then if(j.ge.1 .and. j.le.jz) then
do i=-ia2,ia2 do i=-ia2,ia2
ii=i0+mode_q65*(itone(k)+1)+i ii=i0+mode_q65*(itone(k)+1)+i
if(ii.ge.1 .and. ii.le.iz) ccf(i,lag)=ccf(i,lag) + s1(ii,j) if(ii.ge.iia .and. ii.le.iz) ccf(i,lag)=ccf(i,lag) + s1(ii,j)
enddo enddo
endif endif
enddo enddo
@ -259,6 +260,7 @@ subroutine q65_sync(nutc,iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, &
! Compute s3() here, then call q65_avg(). ! Compute s3() here, then call q65_avg().
i1=i0+ipk-64 i1=i0+ipk-64
i2=i1+LL-1 i2=i1+LL-1
if(i1.ge.1 .and. i2.le.iz) then
j=j0+jpk-7 j=j0+jpk-7
n=0 n=0
do k=1,85 do k=1,85
@ -269,10 +271,12 @@ subroutine q65_sync(nutc,iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, &
n=n+1 n=n+1
if(j.ge.1 .and. j.le.jz) s3(-64:LL-65,n)=s1(i1:i2,j) if(j.ge.1 .and. j.le.jz) s3(-64:LL-65,n)=s1(i1:i2,j)
enddo enddo
write(40) nutc,mode_q65,LL,xdt,f0,snr1,s3 call q65_avg(nutc,ntrperiod,mode_q65,LL,nfqso,ntol,lclearave,xdt, &
f0,snr1,s3)
endif
200 smax=maxval(ccf1) 200 smax=maxval(ccf1)
if(lavg) id1=10+navg !This is an average decode if(lavg) id1=10+navg !If this is an average decode
i1=-9999 i1=-9999
i2=-9999 i2=-9999
do i=-ia,ia do i=-ia,ia