Fix an error in defining dat4(13) in Q65 mode. Not backward compatible! Also fix AP and message averaging for Q65.

This commit is contained in:
Joe Taylor 2020-11-11 15:06:24 -05:00
parent 3068f0c61f
commit 5fe6a539b6
5 changed files with 40 additions and 22 deletions

View File

@ -88,8 +88,7 @@ contains
this%callback => callback
if(nutc.eq.-999) print*,lapdx,nfa,nfb,nfqso !Silence warning
nFadingModel=1
call qra_params(ndepth,maxaptype,idfmax,idtmax,ibwmin,ibwmax,maxdist)
! call qra_params(ndepth,maxaptype,idfmax,idtmax,ibwmin,ibwmax,maxdist)
call timer('sync_q65',0)
call sync_q65(iwave,ntrperiod*12000,mode65,nsps,nfqso,ntol,xdt,f0, &
snr1,width)
@ -112,35 +111,47 @@ contains
if(nQSOprogress.eq.3 .or.nQSOprogress.eq.4) npasses=4
if(nQSOprogress.eq.5) npasses=3
if(lapcqonly) npasses=1
iaptype=0
do ipass=0,npasses
! write(54,3000) nQSOprogress,ipass
!3000 format(i1,i2)
apmask=0
apsymbols=0
if(ipass.ge.1) then
call q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,apsym0,apmask1, &
apsymbols1)
call q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,iaptype, &
apsym0,apmask1,apsymbols1)
write(c78,1050) apmask1
1050 format(78i1)
read(c78,1060) apmask
1060 format(13b6.6)
write(c78,1050) apsymbols1
read(c78,1060) apsymbols
apsymbols(13)=apsymbols(13)/2 !Fixup for c77-->c78
! write(54,3001) iaptype,c78
!3001 format('a',i2,1x,a78)
endif
! write(54,3002) apmask,apsymbols
!3002 format('b ',13b6.6/4x,13b6.6)
call timer('q65loops',0)
call q65_loops(c00,npts/2,nsps/2,nmode,mode65,nsubmode,nFadingModel, &
ndepth,jpk0,xdt,f0,width,ipass,apmask,apsymbols,snr1,snr2,irc,dat4)
ndepth,jpk0,xdt,f0,width,iaptype,apmask,apsymbols,snr1,snr2, &
irc,dat4)
call timer('q65loops',1)
snr2=snr2 + db(6912.0/nsps)
if(irc.ge.0) exit
if(irc.ge.0) then
! write(54,3003) dat4,dat4
!3003 format('c ',13b6.6,13i3)
exit
endif
enddo
100 decoded=' '
if(irc.ge.0) then
!###
navg=irc/100
irc=100*navg + ipass
! irc=100*navg + ipass
irc=100*navg + iaptype
!###
write(c77,1000) dat4
write(c77,1000) dat4(1:12),dat4(13)/2
1000 format(12b6.6,b5.5)
call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent
nsnr=nint(snr2)

View File

@ -29,6 +29,7 @@ subroutine genq65(msg0,ichk,msgsent,itone,i3,n3)
call unpack77(c77,0,msgsent,unpk77_success) !Unpack to get msgsent
read(c77,1001) dgen
1001 format(12b6.6,b5.5)
dgen(13)=2*dgen(13) !Convert 77-bit to 78-bit payload
if(ichk.eq.1) go to 999 !Return if checking only
call q65_enc(dgen,sent) !Encode message, dgen(1:13) ==> sent(1:63)

View File

@ -1,4 +1,5 @@
subroutine q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,apsym0,apmask,apsymbols)
subroutine q65_ap(nQSOprogress,ipass,ncontest,lapcqonly,iaptype, &
apsym0,apmask,apsymbols)
integer apsym0(58),aph10(10)
integer apmask(78),apsymbols(78)

View File

@ -1,5 +1,5 @@
subroutine q65_loops(c00,npts2,nsps,mode,mode64,nsubmode,nFadingModel, &
ndepth,jpk0,xdt,f0,width,ipass,APmask,APsymbols,snr1,snr2,irc,dat4)
ndepth,jpk0,xdt,f0,width,iaptype,APmask,APsymbols,snr1,snr2,irc,dat4)
use packjt77
use timer_module, only: timer
@ -24,11 +24,16 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode64,nsubmode,nFadingModel, &
allocate(c0(0:npts2-1))
irc=-99
s3lim=20.
ibwmax=11
if(mode64.le.4) ibwmax=9
ibwmin=ibwmax
idtmax=3
call qra_params(ndepth,maxaptype,idfmax,idtmax,ibwmin,ibwmax,maxdist)
! ibwmax=11
! if(mode64.le.4) ibwmax=9
! ibwmin=ibwmax
! idtmax=3
! call qra_params(ndepth,maxaptype,idfmax,idtmax,ibwmin,ibwmax,maxdist)
idfmax=5
idtmax=5
ibwmin=1
ibwmax=2
maxdist=15
LL=64*(mode64+2)
NN=63
napmin=99
@ -49,7 +54,7 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode64,nsubmode,nFadingModel, &
call twkfreq(c00,c0,npts2,6000.0,a)
do idt=1,idtmax
ndt=idt/2
if(ipass.eq.0 .and. iavg.eq.0) then
if(iaptype.eq.0 .and. iavg.eq.0) then
if(mod(idt,2).eq.0) ndt=-ndt
jpk=jpk0 + nsps*ndt/16 !tsym/16
if(jpk.lt.0) jpk=0
@ -86,7 +91,7 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode64,nsubmode,nFadingModel, &
enddo ! ibw (b90 loop)
enddo ! idt (DT loop)
enddo ! idf (f0 loop)
if(ipass.eq.0 .and. iavg.eq.0) then
if(iaptype.eq.0 .and. iavg.eq.0) then
a=0.
a(1)=-f0
call twkfreq(c00,c0,npts2,6000.0,a)
@ -108,10 +113,10 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode64,nsubmode,nFadingModel, &
if(iavg.eq.0) navg=0
!### For tests only:
open(53,file='fort.53',status='unknown',position='append')
write(c77,1100) dat4
write(c77,1100) dat4(1:12),dat4(13)/2
1100 format(12b6.6,b5.5)
call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent
write(53,3053) ndf,ndt,nbw,b90,xdt,f0,snr2,ndist,irc,ipass,navg, &
write(53,3053) ndf,ndt,nbw,b90,xdt,f0,snr2,ndist,irc,iaptype,navg, &
snr1,trim(decoded)
3053 format(3i4,f6.1,f6.2,f7.1,f6.1,4i4,f7.2,1x,a)
close(53)

View File

@ -85,8 +85,8 @@ program q65sim
y(j)=itone(i)-1
endif
enddo
write(*,1001) y(1:13)
1001 format('Generated message:'/13i3)
write(*,1001) y(1:13),y(1:13)
1001 format('Generated message'/'6-bit: ',13i3/'binary: ',13b6.6)
write(*,1002) y
1002 format(/'Codeword:'/(20i3))
write(*,1003) itone