More tweaks to QRA65 decoder.

This commit is contained in:
Joe Taylor 2020-10-19 15:24:32 -04:00
parent 3187be3848
commit df69562a9f
3 changed files with 37 additions and 21 deletions

View File

@ -118,21 +118,20 @@ contains
call sync_qra65(iwave,ntrperiod*12000,mode65,nsps,nfqso,ntol,xdt,f0,snr1) call sync_qra65(iwave,ntrperiod*12000,mode65,nsps,nfqso,ntol,xdt,f0,snr1)
call timer('sync_q65',1) call timer('sync_q65',1)
jpk0=(xdt+1.0)*6000 !### irc=-1
if(jpk0.lt.0) jpk0=0 if(snr1.ge.2.7) then
jpk0=(xdt+1.0)*6000 !###
fac=1.0/32767.0 if(jpk0.lt.0) jpk0=0
dd=fac*iwave fac=1.0/32767.0
nmode=65 dd=fac*iwave
nmode=65
call ana64(dd,npts,c00) call ana64(dd,npts,c00)
call timer('qraloops',0)
call timer('qraloops',0) call qra_loops(c00,npts/2,nmode,mode65,nsubmode,nFadingModel, &
call qra_loops(c00,npts/2,nmode,mode65,nsubmode,nFadingModel, & ndepth,nc1,nc2,ng2,naptype,jpk0,xdt,f0,width,snr2,irc,dat4)
ndepth,nc1,nc2,ng2,naptype,jpk0,xdt,f0,width,snr2,irc,dat4) call timer('qraloops',1)
call timer('qraloops',1) snr2=snr2 + db(6912.0/nsps)
xdt=xdt+0.4 !### Empirical -- WHY ??? ### endif
snr2=snr2 + db(6912.0/nsps)
decoded=' ' decoded=' '
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
@ -146,8 +145,7 @@ contains
call this%callback(nutc,sync,nsnr,xdt,f0,decoded, & call this%callback(nutc,sync,nsnr,xdt,f0,decoded, &
irc,qual,ntrperiod,fmid,w50) irc,qual,ntrperiod,fmid,w50)
else else
snr2=0. nsnr=db(snr1) - 32.0
nsnr=-30
!### TEMPORARY? ### !### TEMPORARY? ###
call this%callback(nutc,sync,nsnr,xdt,f0,decoded, & call this%callback(nutc,sync,nsnr,xdt,f0,decoded, &
irc,qual,ntrperiod,fmid,w50) irc,qual,ntrperiod,fmid,w50)

View File

@ -31,17 +31,19 @@ subroutine qra_loops(c00,npts2,mode,mode64,nsubmode,nFadingModel, &
if(ndepth.eq.3) maxdist=30 if(ndepth.eq.3) maxdist=30
do idf=1,idfmax do idf=1,idfmax
ndf=idfn/2 ndf=idf/2
if(mod(idf,2).eq.0) ndf=-ndf if(mod(idf,2).eq.0) ndf=-ndf
a=0. a=0.
a(1)=-(f0+0.868*ndf) a(1)=-(f0+0.4*ndf)
call twkfreq(c00,c0,npts2,6000.0,a) call twkfreq(c00,c0,npts2,6000.0,a)
do idt=1,idtmax do idt=1,idtmax
ndt=idt/2 ndt=idt/2
if(mod(idt,2).eq.0) ndt=-ndt if(mod(idt,2).eq.0) ndt=-ndt
jpk=jpk0 + 240*ndt !240/6000 = 0.04 s = tsym/32 jpk=jpk0 + 240*ndt !240/6000 = 0.04 s = tsym/32
if(jpk.lt.0) jpk=0 if(jpk.lt.0) jpk=0
call timer('spec64 ',0)
call spec64(c0,nsps,mode,jpk,s3,LL,NN) call spec64(c0,nsps,mode,jpk,s3,LL,NN)
call timer('spec64 ',1)
call pctile(s3,LL*NN,40,base) call pctile(s3,LL*NN,40,base)
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
@ -91,7 +93,8 @@ subroutine qra_loops(c00,npts2,mode,mode64,nsubmode,nFadingModel, &
ndist=ndistx ndist=ndistx
endif endif
200 continue 200 if(mode.eq.65) xdt=xdt+0.4 !### Empirical -- WHY ??? ###
!### For tests only: !### For tests only:
if(irc.ge.0) then if(irc.ge.0) then
open(53,file='fort.53',status='unknown',position='append') open(53,file='fort.53',status='unknown',position='append')

View File

@ -97,7 +97,22 @@ subroutine sync_qra65(iwave,nmax,mode65,nsps,nfqso,ntol,xdt,f0,snr1)
jpk=ijpk(2)-27 jpk=ijpk(2)-27
f0=nfqso + ipk*df f0=nfqso + ipk*df
xdt=jpk*dtstep xdt=jpk*dtstep
snr1=maxval(ccf)/22.0
sq=0.
nsq=0
do j=lag1,lag2
if(abs(j-jpk).gt.6) then
sq=sq + ccf(ipk,j)**2
nsq=nsq+1
endif
enddo
rms=sqrt(sq/nsq)
snr1=ccf(ipk,jpk)/rms
! do j=lag1,lag2
! write(55,3055) j,j*dtstep,ccf(ipk,j)/rms
!3055 format(i5,f8.3,f10.3)
! enddo
return return
end subroutine sync_qra65 end subroutine sync_qra65