Still testing various parts of the Q65 decoding chain.

This commit is contained in:
Joe Taylor 2020-11-29 10:00:33 -05:00
parent f0a1694816
commit 64516e6abb
3 changed files with 26 additions and 37 deletions

View File

@ -102,18 +102,6 @@ contains
if(jpk0.lt.0) jpk0=0
fac=1.0/32767.0
dd=fac*iwave(1:npts)
!###
! Optionslly write noise level to LU 56
! sq=dot_product(dd,dd)/npts
! m=nutc
! if(ntrperiod.ge.60) m=100*m
! ihr=m/10000
! imin=mod(m/100,100)
! isec=mod(m,100)
! hours=ihr + imin/60.0 + isec/3600.0
! write(56,3056) m,hours,db(sq)+90.3
!3056 format(i6.6,f10.6,f10.3)
!###
nmode=65
call ana64(dd,npts,c00)
@ -146,10 +134,6 @@ contains
endif
endif
call timer('q65loops',0)
! call q65_loops(c00,nutc,npts/2,nsps/2,nmode,mode65,nsubmode, &
! nFadingModel,ndepth,jpk0,xdt,f0,width,iaptype,apmask,apsymbols, &
! snr1,xdt1,f1,snr2,irc,dat4)
! baud rate required to compute B90TS later
call q65_loops(c00,nutc,npts/2,nsps/2,nmode,mode65,nsubmode, &
nFadingModel,ndepth,jpk0,xdt,f0,width,iaptype,apmask,apsymbols, &
codewords,snr1,xdt1,f1,snr2,irc,dat4)

View File

@ -4,7 +4,8 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
use packjt77
use timer_module, only: timer
parameter (LN=2176*63) !LN=LL*NN; LL=64*(mode_q65+2), NN=63
parameter (NN=63)
parameter (LN=1152*63) !LN=LL*NN; LL=64*(mode_q65+2), NN=63
character*37 decoded
character*77 c77
complex c00(0:npts2-1) !Analytic representation of dd(), 6000 Hz
@ -12,19 +13,19 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
real a(3) !twkfreq params f,f1,f2
real s3(LN) !Symbol spectra
real s3avg(LN) !Averaged symbol spectra
real s3prob(LN) !Symbol-value probabilities
real s3prob(64*NN) !Symbol-value probabilities
logical unpk77_success
integer APmask(13)
integer APsymbols(13)
integer codewords(63,64)
! integer cw4(63)
integer cw4(63)
integer dat4(13) !Decoded message (as 13 six-bit integers)
integer nap(0:11) !AP return codes
data nap/0,2,3,2,3,4,2,3,6,4,6,6/,nsave/0/
! data cw4/0, 0, 0, 0, 8, 4,60,35,17,48,33,25,34,43,43,43,35,15,46,30, &
! 54,24,26,26,57,57,42, 3,23,11,49,49,16, 2, 6, 6,55,21,39,51, &
! 51,51,42,42,50,25,31,35,57,30, 1,54,54,10,10,22,44,58,57,40, &
! 21,21,19/
data cw4/0, 0, 0, 0, 8, 4,60,35,17,48,33,25,34,43,43,43,35,15,46,30, &
54,24,26,26,57,57,42, 3,23,11,49,49,16, 2, 6, 6,55,21,39,51, &
51,51,42,42,50,25,31,35,57,30, 1,54,54,10,10,22,44,58,57,40, &
21,21,19/
save nsave,s3avg
@ -47,12 +48,11 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
ibwmax=5
endif
LL=64*(mode_q65+2)
NN=63
napmin=99
baud=6000.0/nsps
xdt1=xdt0
f1=f0
maxavg=0
if(iand(ndepth,16).ne.0) maxavg=1
do iavg=0,maxavg
@ -79,8 +79,10 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
s3=s3/base
where(s3(1:LL*NN)>s3lim) s3(1:LL*NN)=s3lim
endif
if(iavg.eq.1) then
kavg=0
if(iavg.eq.1 .and. nsave.ge.2) then
s3(1:LL*NN)=s3avg(1:LL*NN)
kavg=nsave
endif
do ibw=ibwmin,ibwmax
nbw=ibw
@ -91,19 +93,22 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
if(b90.gt.230.0) cycle
! if(b90.lt.0.15*width) exit
call timer('q65_intr',0)
b90ts = b90/baud
b90ts = b90/baud
call q65_intrinsics_ff(s3,nsubmode,b90ts,nFadingModel,s3prob)
call timer('q65_intr',1)
if(iaptype.eq.4) then
! codewords(1:63,4)=cw4
codewords(1:63,4)=cw4
call timer('q65_apli',0)
call q65_dec_fullaplist(s3,s3prob,codewords,3,esnodb,dat4,irc)
call q65_dec_fullaplist(s3,s3prob,codewords,4,esnodb,dat4,irc)
call timer('q65_apli',1)
else
call timer('q65_dec ',0)
call q65_dec(s3,s3prob,APmask,APsymbols,esnodb,dat4,irc)
call timer('q65_dec ',1)
endif
! write(71,3071) 100*nutc,0.0,ndf,ndt,nbw,ndist,irc,iaptype, &
! kavg,nsave
!3071 format(i6.6,f8.4,8i5)
if(irc.ge.0) go to 100
! irc > 0 ==> number of iterations required to decode
! -1 = invalid params
@ -122,16 +127,16 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
call pctile(s3,LL*NN,40,base)
s3=s3/base
where(s3(1:LL*NN)>s3lim) s3(1:LL*NN)=s3lim
s3avg(1:LL*NN)=s3avg(1:LL*NN)+s3(1:LL*NN)
s3avg(1:LL*NN)=s3avg(1:LL*NN) + s3(1:LL*NN)
nsave=nsave+1
endif
if(iavg.eq.0 .and. nsave.lt.2) exit
enddo ! iavg
100 if(irc.ge.0) then
100 if(irc.ge.0) then
navg=nsave
snr2=esnodb - db(2500.0/baud)
if(iavg.eq.0) navg=0
if(kavg.eq.0) navg=0
xdt1=xdt0 + nsps*ndt/(16.0*6000.0)
f1=f0 + 0.5*baud*ndf
!### For tests only:
@ -145,7 +150,7 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
imin=mod(m/100,100)
isec=mod(m,100)
hours=ihr + imin/60.0 + isec/3600.0
write(53,3053) m,hours,ndf,ndt,nbw,ndist,irc,iaptype,navg,snr1, &
write(53,3053) m,hours,ndf,ndt,nbw,ndist,irc,iaptype,kavg,snr1, &
xdt1,f1,snr2,trim(decoded)
3053 format(i6.6,f8.4,4i3,i4,2i3,f6.1,f6.2,f7.1,f6.1,1x,a)
close(53)

View File

@ -28,7 +28,7 @@ subroutine sync_q65(iwave,nmax,mode65,nQSOprogress,nsps,nfqso,ntol, &
data sync(1)/99.0/
save sync
nfft=2*nsps
nfft=nsps
df=12000.0/nfft !Freq resolution = 0.5*baud
istep=nsps/NSTEP
iz=5000.0/df !Uppermost frequency bin, at 5000 Hz
@ -165,7 +165,7 @@ subroutine sync_q65(iwave,nmax,mode65,nQSOprogress,nsps,nfqso,ntol, &
j=j0 + NSTEP*(k-1) + 1 + lag
if(j.ge.1 .and. j.le.jz) then
do i=-ia,ia
ii=i0+2*itone(k)+i
ii=i0+itone(k)+i
ccf(i,lag)=ccf(i,lag) + s1(ii,j)
enddo
endif
@ -207,7 +207,7 @@ subroutine sync_q65(iwave,nmax,mode65,nQSOprogress,nsps,nfqso,ntol, &
endif
! write(57,3001) imsg,xdt,xdta,f0,f0a,snr1,snr1a
!3001 format(i1,6f8.2)
! do j=lag1,lag2
! write(55,3055) j,j*dtstep,ccf(ipk,j)/rms
!3055 format(i5,f8.3,f10.3)
@ -223,7 +223,7 @@ subroutine sync_q65(iwave,nmax,mode65,nQSOprogress,nsps,nfqso,ntol, &
f0=f0a_best
snr1=1.4*snr1a_best
endif
! write(58,3006) xdta_best,f0a_best,snr1a_best,imsg_best
!3006 format(3f8.2,i3)