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,12 +52,14 @@ 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);
*rc = qra64_decode(pqra64codec,&EbNodBEstimated,xdec,r); if(*iset==0) {
*snr = EbNodBEstimated - 31.0; *rc = qra64_decode(pqra64codec,&EbNodBEstimated,xdec,r);
*snr = EbNodBEstimated - 31.0;
#ifdef NICO_WANTS_SNR_DUMP #ifdef NICO_WANTS_SNR_DUMP
fout = fopen("C:\\JTSDK\\snrdump.txt","a+"); fout = fopen("C:\\JTSDK\\snrdump.txt","a+");
if ((*rc)>=0) fprintf(fout,"rc=%d snr=%.2f dB\n",*rc,EbNodBEstimated-31.0f); if ((*rc)>=0) fprintf(fout,"rc=%d snr=%.2f dB\n",*rc,EbNodBEstimated-31.0f);
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,32 +101,37 @@ 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) call qra64_dec(s3,nc1,nc2,ng2,naptype,0,dat4,snr2,irc)
if(iter.eq.2) nmycall=ncq if(irc.ge.0) then
call qra64_dec(s3,nmycall,nhiscall,nhisgrid,naptype,dat4,snr2,irc) call unpackmsg(dat4,decoded) !Unpack the user message
if(irc.ge.0) then call fmtmsg(decoded,iz)
call unpackmsg(dat4,decoded) !Unpack the user message nft=100 + irc
call fmtmsg(decoded,iz) nsnr=nint(snr2)
nft=100 + irc else
nsnr=nint(snr2) snr2=0.
else endif
snr2=0. call system_clock(count1,clkfreq)
endif tsec=float(count1-count0)/float(clkfreq)
call system_clock(count1,clkfreq) write(78,3900) nutc,sync,snr1,snr2,dtx,nfreq,1,irc,tsec,decoded
tsec=float(count1-count0)/float(clkfreq)
write(78,3900) nutc,sync,snr1,snr2,dtx,nfreq,iter,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