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 if(jpk0.lt.0) jpk0=0
fac=1.0/32767.0 fac=1.0/32767.0
dd=fac*iwave(1:npts) 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 nmode=65
call ana64(dd,npts,c00) call ana64(dd,npts,c00)
@ -146,10 +134,6 @@ contains
endif endif
endif endif
call timer('q65loops',0) 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, & call q65_loops(c00,nutc,npts/2,nsps/2,nmode,mode65,nsubmode, &
nFadingModel,ndepth,jpk0,xdt,f0,width,iaptype,apmask,apsymbols, & nFadingModel,ndepth,jpk0,xdt,f0,width,iaptype,apmask,apsymbols, &
codewords,snr1,xdt1,f1,snr2,irc,dat4) 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 packjt77
use timer_module, only: timer 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*37 decoded
character*77 c77 character*77 c77
complex c00(0:npts2-1) !Analytic representation of dd(), 6000 Hz 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 a(3) !twkfreq params f,f1,f2
real s3(LN) !Symbol spectra real s3(LN) !Symbol spectra
real s3avg(LN) !Averaged symbol spectra real s3avg(LN) !Averaged symbol spectra
real s3prob(LN) !Symbol-value probabilities real s3prob(64*NN) !Symbol-value probabilities
logical unpk77_success logical unpk77_success
integer APmask(13) integer APmask(13)
integer APsymbols(13) integer APsymbols(13)
integer codewords(63,64) integer codewords(63,64)
! integer cw4(63) integer cw4(63)
integer dat4(13) !Decoded message (as 13 six-bit integers) integer dat4(13) !Decoded message (as 13 six-bit integers)
integer nap(0:11) !AP return codes integer nap(0:11) !AP return codes
data nap/0,2,3,2,3,4,2,3,6,4,6,6/,nsave/0/ 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, & 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, & 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, & 51,51,42,42,50,25,31,35,57,30, 1,54,54,10,10,22,44,58,57,40, &
! 21,21,19/ 21,21,19/
save nsave,s3avg save nsave,s3avg
@ -47,7 +48,6 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
ibwmax=5 ibwmax=5
endif endif
LL=64*(mode_q65+2) LL=64*(mode_q65+2)
NN=63
napmin=99 napmin=99
baud=6000.0/nsps baud=6000.0/nsps
xdt1=xdt0 xdt1=xdt0
@ -79,8 +79,10 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
s3=s3/base s3=s3/base
where(s3(1:LL*NN)>s3lim) s3(1:LL*NN)=s3lim where(s3(1:LL*NN)>s3lim) s3(1:LL*NN)=s3lim
endif 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) s3(1:LL*NN)=s3avg(1:LL*NN)
kavg=nsave
endif endif
do ibw=ibwmin,ibwmax do ibw=ibwmin,ibwmax
nbw=ibw nbw=ibw
@ -95,15 +97,18 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
call q65_intrinsics_ff(s3,nsubmode,b90ts,nFadingModel,s3prob) call q65_intrinsics_ff(s3,nsubmode,b90ts,nFadingModel,s3prob)
call timer('q65_intr',1) call timer('q65_intr',1)
if(iaptype.eq.4) then if(iaptype.eq.4) then
! codewords(1:63,4)=cw4 codewords(1:63,4)=cw4
call timer('q65_apli',0) 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) call timer('q65_apli',1)
else else
call timer('q65_dec ',0) call timer('q65_dec ',0)
call q65_dec(s3,s3prob,APmask,APsymbols,esnodb,dat4,irc) call q65_dec(s3,s3prob,APmask,APsymbols,esnodb,dat4,irc)
call timer('q65_dec ',1) call timer('q65_dec ',1)
endif 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 if(irc.ge.0) go to 100
! irc > 0 ==> number of iterations required to decode ! irc > 0 ==> number of iterations required to decode
! -1 = invalid params ! -1 = invalid params
@ -131,7 +136,7 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
100 if(irc.ge.0) then 100 if(irc.ge.0) then
navg=nsave navg=nsave
snr2=esnodb - db(2500.0/baud) 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) xdt1=xdt0 + nsps*ndt/(16.0*6000.0)
f1=f0 + 0.5*baud*ndf f1=f0 + 0.5*baud*ndf
!### For tests only: !### For tests only:
@ -145,7 +150,7 @@ subroutine q65_loops(c00,nutc,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, &
imin=mod(m/100,100) imin=mod(m/100,100)
isec=mod(m,100) isec=mod(m,100)
hours=ihr + imin/60.0 + isec/3600.0 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) xdt1,f1,snr2,trim(decoded)
3053 format(i6.6,f8.4,4i3,i4,2i3,f6.1,f6.2,f7.1,f6.1,1x,a) 3053 format(i6.6,f8.4,4i3,i4,2i3,f6.1,f6.2,f7.1,f6.1,1x,a)
close(53) close(53)

View File

@ -28,7 +28,7 @@ subroutine sync_q65(iwave,nmax,mode65,nQSOprogress,nsps,nfqso,ntol, &
data sync(1)/99.0/ data sync(1)/99.0/
save sync save sync
nfft=2*nsps nfft=nsps
df=12000.0/nfft !Freq resolution = 0.5*baud df=12000.0/nfft !Freq resolution = 0.5*baud
istep=nsps/NSTEP istep=nsps/NSTEP
iz=5000.0/df !Uppermost frequency bin, at 5000 Hz 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 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=-ia,ia do i=-ia,ia
ii=i0+2*itone(k)+i ii=i0+itone(k)+i
ccf(i,lag)=ccf(i,lag) + s1(ii,j) ccf(i,lag)=ccf(i,lag) + s1(ii,j)
enddo enddo
endif endif