diff --git a/lib/q65_sync.f90 b/lib/q65_sync.f90 index 89588852c..b8112f250 100644 --- a/lib/q65_sync.f90 +++ b/lib/q65_sync.f90 @@ -197,14 +197,16 @@ subroutine q65_sync(nutc,iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, & if(irc.ge.0 .and. plog.ge.PLOG_MIN) then snr2=esnodb - db(2500.0/baud) + 3.0 !Empirical adjustment id1=1 - write(c77,1000) dat4(1:12),dat4(13)/2 -1000 format(12b6.6,b5.5) - call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent + +! write(c77,1000) dat4(1:12),dat4(13)/2 +!1000 format(12b6.6,b5.5) +! call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent ! open(55,file='fort.55',status='unknown',position='append') ! write(55,3055) nutc,ibw,xdt,f0,85.0*base,ccfmax,snr2,plog, & ! irc,trim(decoded) !3055 format(i6,i3,6f8.2,i5,2x,a) ! close(55) + ic=ia2/4; base=(sum(ccf1(-ia2:-ia2+ic)) + sum(ccf1(ia2-ic:ia2)))/(2.0+2.0*ic); ccf1=ccf1-base @@ -254,6 +256,21 @@ subroutine q65_sync(nutc,iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, & ccf1=ccf(:,jpk)/rms if(snr1.gt.10.0) ccf1=(10.0/snr1)*ccf1 +! Compute s3() here, then call q65_avg(). + i1=i0+ipk-64 + i2=i1+LL-1 + j=j0+jpk-7 + n=0 + do k=1,85 + j=j+8 + if(sync(k).gt.0.0) then + cycle + endif + n=n+1 + if(j.ge.1 .and. j.le.jz) s3(-64:LL-65,n)=s1(i1:i2,j) + enddo + write(40) nutc,mode_q65,LL,xdt,f0,snr1,s3 + 200 smax=maxval(ccf1) if(lavg) id1=10+navg !This is an average decode i1=-9999 diff --git a/lib/qra/q65/q65_loops.f90 b/lib/qra/q65/q65_loops.f90 index 74f2a06f4..bdcfeccc6 100644 --- a/lib/qra/q65/q65_loops.f90 +++ b/lib/qra/q65/q65_loops.f90 @@ -7,6 +7,8 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, & parameter (LN=1152*63) !LN=LL*NN; LL=64*(mode_q65+2), NN=63 complex c00(0:npts2-1) !Analytic representation of dd(), 6000 Hz complex ,allocatable :: c0(:) !Ditto, with freq shift +! character c77*77,decoded*37 +! logical unpk77_success real a(3) !twkfreq params f,f1,f2 real s3(LN) !Symbol spectra real s3prob(64*NN) !Symbol-value probabilities @@ -81,6 +83,22 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode_q65,nsubmode,nFadingModel, & call q65_dec(s3,s3prob,APmask,APsymbols,esnodb,dat4,irc) call timer('q65_dec ',1) if(irc.ge.0) id2=iaptype+2 + +!### Temporary ### +! if(irc.ge.0) then +! write(c77,1000) dat4(1:12),dat4(13)/2 +!1000 format(12b6.6,b5.5) +! call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent +! snr2=esnodb - db(2500.0/baud) +! xdt1=xdt0 + nsps*ndt/(16.0*6000.0) +! f1=f0 + 0.5*baud*ndf +! open(56,file='fort.56',status='unknown',position='append') +! write(56,3055) idf,idt,ibw,id2,irc,xdt1,f1,snr2,trim(decoded) +!3055 format(5i3,3f8.2,2x,a) +! close(56) +! endif +!### + if(irc.ge.0) go to 100 ! irc > 0 ==> number of iterations required to decode ! -1 = invalid params