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,
int xdec[], float* snr, int* rc)
int* iset, int xdec[], float* snr, int* rc)
{
/*
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);
if(err<0) printf("ERROR: qra64_apset returned %d\n",err);
if(*iset==0) {
*rc = qra64_decode(pqra64codec,&EbNodBEstimated,xdec,r);
*snr = EbNodBEstimated - 31.0;
@ -60,4 +61,5 @@ void qra64_dec_(float r[], int* nc1, int* nc2, int* ng2, int* APtype,
if ((*rc)>=0) fprintf(fout,"rc=%d snr=%.2f dB\n",*rc,EbNodBEstimated-31.0f);
fclose(fout);
#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 x(NFFT)
complex cx(0:NH)
logical first
equivalence (x,cx)
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)
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 ###
hiscall=hiscall_12(1:6)
hisgrid=hisgrid_6(1:4)
call packcall(mycall,nmycall,ltext)
call packcall(hiscall,nhiscall,ltext)
call packgrid(hisgrid,nhisgrid,ltext)
call packcall(mycall,nc1,ltext)
call packcall(hiscall,nc2,ltext)
call packgrid(hisgrid,ng2,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.
naptype=4
do iter=1,2
call system_clock(count0,clkfreq)
if(iter.eq.2) nmycall=ncq
call qra64_dec(s3,nmycall,nhiscall,nhisgrid,naptype,dat4,snr2,irc)
call qra64_dec(s3,nc1,nc2,ng2,naptype,0,dat4,snr2,irc)
if(irc.ge.0) then
call unpackmsg(dat4,decoded) !Unpack the user message
call fmtmsg(decoded,iz)
@ -121,10 +129,9 @@ subroutine qra64a(dd,nutc,nf1,nf2,nfqso,ntol,mycall_12,hiscall_12,hisgrid_6, &
endif
call system_clock(count1,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)
if(irc.ge.0) exit
enddo
flush(78)
return
end subroutine qra64a