diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 7555ed3..ce66f02 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -31,6 +31,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample) logical baddata,newdat65,newdat9,single_decode,bVHF,bad0,newdat,trydecode integer*2 id0(NTMAX*12000) integer*2 id2(NTMAX*12000) + integer pos,sz type(params_block) :: params character(len=20) :: datetime character(len=12) :: mycall, hiscall @@ -85,7 +86,7 @@ subroutine multimode_decoder(ss,id2,params,nfsample) sz = max(0,params%kszE) id0=0 id0(1:sz+1)=id2(pos+1:pos+sz+1) - + call my_js8e%decode(js8e_decoded,id0,params%nQSOProgress,params%nfqso, & params%nftx,newdat,params%nutc,params%nfa,params%nfb, & params%nexp_decode,params%ndepth,logical(params%nagain), & diff --git a/lib/js8/syncjs8.f90 b/lib/js8/syncjs8.f90 index daea1c8..ce5a7d1 100644 --- a/lib/js8/syncjs8.f90 +++ b/lib/js8/syncjs8.f90 @@ -1,13 +1,10 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) - - !include 'js8_params.f90' - complex cx(0:NH1) real s(NH1,NHSYM) real savg(NH1) real sbase(NH1) real x(NFFT1) - real sync2d(NH1,-JZ:JZ) + real sync1d(-JZ:JZ) real red(NH1) real candidate0(3,200) real candidate(3,200) @@ -29,7 +26,7 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) icos7c = (/2,5,0,6,4,1,3/) !End Costas 7x7 tone pattern endif -! Compute symbol spectra, stepping by NSTEP steps. + ! Compute symbol spectra, stepping by NSTEP steps. savg=0. tstep=NSTEP/12000.0 df=12000.0/NFFT1 @@ -45,6 +42,7 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) enddo savg=savg + s(1:NH1,j) !Average spectrum enddo + call baselinejs8(savg,nfa,nfb,sbase) ia=max(1,nint(nfa/df)) ! min freq @@ -106,17 +104,13 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) t0=(t0-t)/6.0 sync_bc=t/t0 - !sync2d(i,j)=max(max(max(sync_abc, sync_ab), sync_ac), sync_bc) - sync2d(i,j)=max(sync_abc, sync_ab, sync_bc) + sync1d(j)=max(sync_abc, sync_ab, sync_bc) enddo - enddo - red=0. - do i=ia,ib - ii=maxloc(sync2d(i,-JZ:JZ)) - 1 - JZ + ii=maxloc(sync1d(-JZ:JZ)) - 1 - JZ j0=ii(1) jpeak(i)=j0 - red(i)=sync2d(i,j0) + red(i)=sync1d(j0) enddo iz=ib-ia+1 @@ -145,8 +139,7 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) enddo ncand=k - -! Save only the best of near-dupe freqs. + ! Save only the best of near-dupe freqs. do i=1,ncand if(i.ge.2) then do j=1,i-1 @@ -159,7 +152,7 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) endif enddo -! Put nfqso at top of list + ! Put nfqso at top of list do i=1,ncand if(abs(candidate0(1,i)-nfqso).lt.10.0) candidate0(1,i)=-candidate0(1,i) enddo @@ -167,15 +160,13 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) fac=20.0/maxval(s) s=fac*s -! Sort by sync -! call indexx(candidate0(3,1:ncand),ncand,indx) -! Sort by frequency + ! Sort by sync + ! call indexx(candidate0(3,1:ncand),ncand,indx) + ! Sort by frequency call indexx(candidate0(1,1:ncand),ncand,indx) k=1 -! do i=ncand,1,-1 do i=1,ncand j=indx(i) -! if( candidate0(3,j) .ge. syncmin .and. candidate0(2,j).ge.-1.5 ) then if( candidate0(3,j) .ge. syncmin ) then candidate(1,k)=abs(candidate0(1,j)) candidate(2,k)=candidate0(2,j) @@ -184,5 +175,6 @@ subroutine syncjs8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) endif enddo ncand=k-1 + return end subroutine syncjs8 diff --git a/lib/js8e_decode.f90 b/lib/js8e_decode.f90 index 926b40b..b50a032 100644 --- a/lib/js8e_decode.f90 +++ b/lib/js8e_decode.f90 @@ -43,11 +43,13 @@ contains character*6 mygrid6,hisgrid6 integer*2 iwave(NMAX) integer apsym(KK) + integer ncand character datetime*13,message*22,msg37*37 character*22 allmessages(100) integer allsnrs(100) save s,dd + ncand=0 bcontest=iand(nexp_decode,128).ne.0 this%callback => callback write(datetime,1001) nutc !### TEMPORARY ### @@ -115,6 +117,7 @@ contains lapcqonly,napwid,lsubtract,nagain,iaptype,mycall12,mygrid6, & hiscall12,bcontest,sync,f1,xdt,xbase,apsym,nharderrors,dmin, & nbadcrc,iappass,iera,msg37,xsnr) + message=msg37(1:22) !### nsnr=nint(xsnr) xdt=xdt-ASTART