More cleanup and optimization of the QRA64 decoding procedure.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6932 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-07-20 15:38:29 +00:00
parent 76ed1007c4
commit ab1e2eaa3c
2 changed files with 37 additions and 28 deletions

View File

@ -15,7 +15,7 @@ void qra64_enc_(int x[], int y[])
} }
void qra64_dec_(float r[], int* nc1, int* nc2, int* ng2, int* APtype, void qra64_dec_(float r[], int* nc1, int* nc2, int* ng2, int* APtype,
int xdec[], float* snr, int* rc) int* iset, int xdec[], float* snr, int* rc)
{ {
/* /*
APtype: APtype:
@ -52,6 +52,7 @@ void qra64_dec_(float r[], int* nc1, int* nc2, int* ng2, int* APtype,
err=qra64_apset(pqra64codec,*nc1,*nc2,*ng2,*APtype); err=qra64_apset(pqra64codec,*nc1,*nc2,*ng2,*APtype);
if(err<0) printf("ERROR: qra64_apset returned %d\n",err); if(err<0) printf("ERROR: qra64_apset returned %d\n",err);
if(*iset==0) {
*rc = qra64_decode(pqra64codec,&EbNodBEstimated,xdec,r); *rc = qra64_decode(pqra64codec,&EbNodBEstimated,xdec,r);
*snr = EbNodBEstimated - 31.0; *snr = EbNodBEstimated - 31.0;
@ -61,3 +62,4 @@ void qra64_dec_(float r[], int* nc1, int* nc2, int* ng2, int* APtype,
fclose(fout); fclose(fout);
#endif #endif
} }
}

View File

@ -17,8 +17,10 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mycall_12,hiscall_12,hisgrid_6, &
real red(NZ) real red(NZ)
real x(NFFT) real x(NFFT)
complex cx(0:NH) complex cx(0:NH)
logical first
equivalence (x,cx) equivalence (x,cx)
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 pattern data icos7/2,5,6,0,4,1,3/ !Costas 7x7 pattern
data nc1z/-1/,nc2z/-1/,ng2z/-1/
common/qra64com/ss(NZ,194),s3(0:63,1:63),ccf(NZ,0:25) common/qra64com/ss(NZ,194),s3(0:63,1:63),ccf(NZ,0:25)
save save
@ -99,18 +101,24 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mycall_12,hiscall_12,hisgrid_6, &
mycall=mycall_12(1:6) !### May need fixing ### mycall=mycall_12(1:6) !### May need fixing ###
hiscall=hiscall_12(1:6) hiscall=hiscall_12(1:6)
hisgrid=hisgrid_6(1:4) hisgrid=hisgrid_6(1:4)
call packcall(mycall,nmycall,ltext) call packcall(mycall,nc1,ltext)
call packcall(hiscall,nhiscall,ltext) call packcall(hiscall,nc2,ltext)
call packgrid(hisgrid,nhisgrid,ltext) call packgrid(hisgrid,ng2,ltext)
call packcall("CQ ",ncq,ltext) call packcall("CQ ",ncq,ltext)
nmycall=ncq
if(nc1.ne.nc1z .or. nc2.ne.nc2z .or. ng2.ne.ng2z) then
do naptype=0,4
call qra64_dec(s3,nc1,nc2,ng2,naptype,1,dat4,snr2,irc)
enddo
nc1z=nc1
nc2z=nc2
ng2z=ng2
endif
snr2=-99. snr2=-99.
naptype=4 naptype=4
do iter=1,2
call system_clock(count0,clkfreq) call system_clock(count0,clkfreq)
if(iter.eq.2) nmycall=ncq call qra64_dec(s3,nc1,nc2,ng2,naptype,0,dat4,snr2,irc)
call qra64_dec(s3,nmycall,nhiscall,nhisgrid,naptype,dat4,snr2,irc)
if(irc.ge.0) then if(irc.ge.0) then
call unpackmsg(dat4,decoded) !Unpack the user message call unpackmsg(dat4,decoded) !Unpack the user message
call fmtmsg(decoded,iz) call fmtmsg(decoded,iz)
@ -121,10 +129,9 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mycall_12,hiscall_12,hisgrid_6, &
endif endif
call system_clock(count1,clkfreq) call system_clock(count1,clkfreq)
tsec=float(count1-count0)/float(clkfreq) tsec=float(count1-count0)/float(clkfreq)
write(78,3900) nutc,sync,snr1,snr2,dtx,nfreq,iter,irc,tsec,decoded write(78,3900) nutc,sync,snr1,snr2,dtx,nfreq,1,irc,tsec,decoded
3900 format(i4.4,3f6.1,f6.2,i5,i2,i3,f6.3,1x,a22) 3900 format(i4.4,3f6.1,f6.2,i5,i2,i3,f6.3,1x,a22)
if(irc.ge.0) exit flush(78)
enddo
return return
end subroutine qra64a end subroutine qra64a