From feb267e7cf78eeb53786247474876064841bbb79 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 7 Jul 2021 14:11:34 -0400 Subject: [PATCH] Compute nhsym only once, in decode0(). --- map65/libm65/decode0.f90 | 10 ++++++++-- map65/libm65/map65a.f90 | 2 +- map65/libm65/wideband_sync.f90 | 6 +----- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/map65/libm65/decode0.f90 b/map65/libm65/decode0.f90 index 23a46d9eb..c13c665d7 100644 --- a/map65/libm65/decode0.f90 +++ b/map65/libm65/decode0.f90 @@ -16,8 +16,15 @@ subroutine decode0(dd,ss,savg,nstandalone) save call timer('decode0 ',0) + nhsym=302 if(newdat.ne.0) then - nz=52*96000 + istep=10000 + do i=NSMAX,1,-istep + n=maxval(abs(dd(1,i-istep+1:i))) + if(n.gt.10) exit + enddo + nz=i + nhsym=5.3833*nz/96000.0 hist=0 do i=1,nz j1=min(abs(dd(1,i)),32768.0) @@ -36,7 +43,6 @@ subroutine decode0(dd,ss,savg,nstandalone) enddo 10 rmsdd=1.5*i endif - nhsym=279 ndphi=0 if(iand(nrxlog,8).ne.0) ndphi=1 diff --git a/map65/libm65/map65a.f90 b/map65/libm65/map65a.f90 index 9c5c44599..f4a81b838 100644 --- a/map65/libm65/map65a.f90 +++ b/map65/libm65/map65a.f90 @@ -51,7 +51,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & nts_q65=2**(mode_q65-1) !Q65 tone separation factor if(nagain.eq.0) then call timer('get_cand',0) - call get_candidates(ss,savg,xpol,mfa,mfb,nts_jt65,nts_q65,cand,ncand) + call get_candidates(ss,savg,xpol,nhsym,mfa,mfb,nts_jt65,nts_q65,cand,ncand) call timer('get_cand',1) candec=.false. endif diff --git a/map65/libm65/wideband_sync.f90 b/map65/libm65/wideband_sync.f90 index 101df3085..af4258644 100644 --- a/map65/libm65/wideband_sync.f90 +++ b/map65/libm65/wideband_sync.f90 @@ -26,7 +26,7 @@ module wideband_sync contains -subroutine get_candidates(ss,savg,xpol,nfa,nfb,nts_jt65,nts_q65,cand,ncand) +subroutine get_candidates(ss,savg,xpol,jz,nfa,nfb,nts_jt65,nts_q65,cand,ncand) ! Search symbol spectra ss() over frequency range nfa to nfb (in kHz) for ! JT65 and Q65 sync patterns. The nts_* variables are the submode tone @@ -40,10 +40,6 @@ subroutine get_candidates(ss,savg,xpol,nfa,nfb,nts_jt65,nts_q65,cand,ncand) logical xpol,skip type(candidate) :: cand(MAX_CANDIDATES) - do j=322,1,-1 !Find end of data in ss() - if(sum(ss(1,j,1:NFFT)).gt.0.0) exit - enddo - jz=j call wb_sync(ss,savg,xpol,jz,nfa,nfb) tstep=2048.0/11025.0 !0.185760 s: 0.5*tsym_jt65, 0.3096*tsym_q65