diff --git a/q65w/libq65/q65b.f90 b/q65w/libq65/q65b.f90 index 7e0447e28..4f75ab2d9 100644 --- a/q65w/libq65/q65b.f90 +++ b/q65w/libq65/q65b.f90 @@ -1,6 +1,6 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & mycall0,hiscall0,hisgrid,mode_q65,f0,fqso,newdat,nagain, & - max_drift,ndepth,datetime,ndop00) + max_drift,ndepth,datetime,ndop00,idec) ! This routine provides an interface between MAP65 and the Q65 decoder ! in WSJT-X. All arguments are input data obtained from the MAP65 GUI. @@ -43,7 +43,10 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & ib=nint(ifreq+ntol/df3) ipk1=maxloc(sync(ia:ib)%ccfmax) ipk=ia+ipk1(1)-1 +! f_ipk=ipk*df3 + ipk2=(1000.0*f0-1.0)/df3 snr1=sync(ipk)%ccfmax + ipk=ipk2 !Substitute new ipk value nfft1=MAXFFT1 nfft2=MAXFFT2 @@ -55,7 +58,6 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & endif nh=nfft2/2 f_mouse=1000.0*(fqso+48.0) + mousedf - f_ipk=ipk*df3 k0=nint((ipk*df3-1000.0)/df) if(nagain.eq.1) k0=nint((f_mouse-1000.0)/df) @@ -132,6 +134,8 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & write(12,1130) datetime,trim(result(ndecodes)(5:)) 1130 format(a11,1x,a) result(ndecodes)=trim(result(ndecodes))//char(0) +! print*,'AAA',f_ipk,k0*df,f0,ipk,ipk2,trim(msg0) + idec=0 endif 900 flush(12) diff --git a/q65w/libq65/q65wa.f90 b/q65w/libq65/q65wa.f90 index 31258c107..f34a47071 100644 --- a/q65w/libq65/q65wa.f90 +++ b/q65w/libq65/q65wa.f90 @@ -38,10 +38,10 @@ subroutine q65wa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & call getcand2(savg,nts_q65,cand,ncand) call timer('get_cand',1) - do i=1,ncand - write(71,3071) i,cand(i)%f,cand(i)%xdt,cand(i)%snr -3071 format(i2,3f10.3) - enddo +! do i=1,ncand +! write(71,3071) i,cand(i)%f,cand(i)%xdt,cand(i)%snr +!3071 format(i2,3f10.3) +! enddo candec=.false. nwrite_q65=0 @@ -65,6 +65,7 @@ subroutine q65wa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & if(candec(icand)) cycle !Skip if already decoded freq=cand(icand)%f+nkhz_center-48.0-1.27046 ikhz=nint(freq) + idec=-1 ! print*,'AAA',icand,nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & ! mycall,hiscall,hisgrid,mode_q65,f0,fqso,newdat, & @@ -72,9 +73,14 @@ subroutine q65wa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & call timer('q65b ',0) call q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, & mycall,hiscall,hisgrid,mode_q65,f0,fqso,newdat, & - nagain,max_drift,ndepth,datetime,ndop00) + nagain,max_drift,ndepth,datetime,ndop00,idec) call timer('q65b ',1) if(idec.ge.0) candec(icand)=.true. + + write(71,3071) icand,cand(icand)%f,32.0+cand(icand)%f, & + cand(icand)%xdt,cand(icand)%snr,idec,ndecodes +3071 format(i2,4f10.3,2i5) + enddo ! icand ndecdone=2 @@ -93,8 +99,10 @@ subroutine getcand2(savg0,nts_q65,cand,ncand) df=96000.0/NFFT bw=65*nts_q65*1.666666667 nbw=bw/df + 1 - smin=140.0 + smin=70.0 nguard=5 + +! print*,'aaa',nts_q65,bw j=0 sync(1:NFFT)%ccfmax=0. @@ -108,7 +116,7 @@ subroutine getcand2(savg0,nts_q65,cand,ncand) ! write(*,3020) j,fpk,spk !3020 format(i3,f12.6,f8.1) cand(j)%f=fpk - cand(j)%xdt=2.5 + cand(j)%xdt=2.8 cand(j)%snr=spk cand(j)%iflip=0 @@ -123,7 +131,7 @@ subroutine getcand2(savg0,nts_q65,cand,ncand) ncand=j do i=1,NFFT - write(72,3072) i,0.001*i*df,savg0(i),savg(i),sync(i)%ccfmax + write(72,3072) i,0.001*i*df+32.0,savg0(i),savg(i),sync(i)%ccfmax 3072 format(i6,f15.6,3f15.3) enddo diff --git a/q65w/libq65/wideband_sync.f90 b/q65w/libq65/wideband_sync.f90 index 080258c8d..57ee103fc 100644 --- a/q65w/libq65/wideband_sync.f90 +++ b/q65w/libq65/wideband_sync.f90 @@ -41,7 +41,7 @@ subroutine get_candidates(ss,savg,jz,nfa,nfb,nts_jt65,nts_q65,cand,ncand) type(candidate) :: cand(MAX_CANDIDATES) type(candidate) :: cand0(MAX_CANDIDATES) - call wb_sync(ss,savg,jz,nfa,nfb) !Output to sync() array + call wb_sync(ss,savg,jz,nfa,nfb,nts_q65) !Output to sync() array tstep=2048.0/11025.0 !0.185760 s: 0.5*tsym_jt65, 0.3096*tsym_q65 df3=96000.0/NFFT @@ -113,7 +113,7 @@ subroutine get_candidates(ss,savg,jz,nfa,nfb,nts_jt65,nts_q65,cand,ncand) return end subroutine get_candidates -subroutine wb_sync(ss,savg,jz,nfa,nfb) +subroutine wb_sync(ss,savg,jz,nfa,nfb,nts_q65) ! Compute "orange sync curve" using the Q65 sync pattern @@ -239,7 +239,7 @@ subroutine wb_sync(ss,savg,jz,nfa,nfb) call pctile(sync(ia:ib)%ccfmax,ib-ia+1,50,base) sync(ia:ib)%ccfmax=sync(ia:ib)%ccfmax/base - bw=65*4*1.66666667 !Q65-60C bandwidth + bw=65*nts_q65*1.66666667 !Q65-60x bandwidth nbw=bw/df3 + 1 !Number of bins to blank syncmin=2.0 nguard=10