From 4b8ea3ef45c645271cf4026d3ae243487b08c352 Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Thu, 5 Jul 2018 07:51:10 -0500 Subject: [PATCH] Wire up the 'Decode only 77-bit messages' checkbox. --- commons.h | 1 + lib/decoder.f90 | 3 ++- lib/ft8/sync8.f90 | 64 ++++++++++++++++++++++++---------------------- lib/ft8_decode.f90 | 6 ++--- lib/jt9.f90 | 1 + lib/jt9com.f90 | 1 + mainwindow.cpp | 1 + 7 files changed, 43 insertions(+), 34 deletions(-) diff --git a/commons.h b/commons.h index 7c202d26e..926cbc848 100644 --- a/commons.h +++ b/commons.h @@ -44,6 +44,7 @@ extern struct dec_data { bool lft8apon; bool lapcqonly; bool ljt65apon; + bool ldecode77; int napwid; int ntxmode; int nmode; diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 03627d845..5bf223ed3 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -96,7 +96,8 @@ subroutine multimode_decoder(ss,id2,params,nfsample) call my_ft8%decode(ft8_decoded,id2,params%nQSOProgress,params%nfqso, & params%nftx,newdat,params%nutc,params%nfa,params%nfb, & params%nexp_decode,params%ndepth,logical(params%nagain), & - logical(params%lft8apon),logical(params%lapcqonly),params%napwid, & + logical(params%lft8apon),logical(params%lapcqonly), & + logical(params%ldecode77),params%napwid, & mycall,mygrid,hiscall,hisgrid) call timer('decft8 ',1) if(nfox.gt.0) then diff --git a/lib/ft8/sync8.f90 b/lib/ft8/sync8.f90 index b6e11ed1f..e2913e253 100644 --- a/lib/ft8/sync8.f90 +++ b/lib/ft8/sync8.f90 @@ -1,9 +1,10 @@ -subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) +subroutine sync8(dd,nfa,nfb,syncmin,nfqso,ldecode77,s,candidate,ncand,sbase) include 'ft8_params.f90' ! Search over +/- 2.5s relative to 0.5s TX start time. parameter (JZ=62) complex cx(0:NH1) + logical ldecode77 real s(NH1,NHSYM) real savg(NH1) real sbase(NH1) @@ -52,11 +53,14 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase) candidate0=0. k=0 -do itype=1,2 - if(itype.eq.1) icos7=icos7_1 - if(itype.eq.2) icos7=icos7_2 - do i=ia,ib - do j=-JZ,+JZ + + is1=1 + if(ldecode77) is1=2 + do isync=is1,2 + if(isync.eq.1) icos7=icos7_1 + if(isync.eq.2) icos7=icos7_2 + do i=ia,ib + do j=-JZ,+JZ ta=0. tb=0. tc=0. @@ -86,34 +90,34 @@ do itype=1,2 t0=(t0-t)/6.0 sync_bc=t/t0 sync2d(i,j)=max(sync_abc,sync_bc) - enddo - enddo + enddo + enddo - red=0. - do i=ia,ib - ii=maxloc(sync2d(i,-JZ:JZ)) - 1 - JZ - j0=ii(1) - jpeak(i)=j0 - red(i)=sync2d(i,j0) + red=0. + do i=ia,ib + ii=maxloc(sync2d(i,-JZ:JZ)) - 1 - JZ + j0=ii(1) + jpeak(i)=j0 + red(i)=sync2d(i,j0) ! write(52,3052) i*df,red(i),db(red(i)) !3052 format(3f12.3) - enddo - iz=ib-ia+1 - call indexx(red(ia:ib),iz,indx) - ibase=indx(nint(0.40*iz)) - 1 + ia - base=red(ibase) - red=red/base + enddo + iz=ib-ia+1 + call indexx(red(ia:ib),iz,indx) + ibase=indx(nint(0.40*iz)) - 1 + ia + base=red(ibase) + red=red/base - do i=1,200 - n=ia + indx(iz+1-i) - 1 - if(red(n).lt.syncmin) exit - if(k.lt.200) k=k+1 - candidate0(1,k)=n*df - candidate0(2,k)=(jpeak(n)-1)*tstep - candidate0(3,k)=red(n) - candidate0(4,k)=itype - enddo -enddo + do i=1,200 + n=ia + indx(iz+1-i) - 1 + if(red(n).lt.syncmin) exit + if(k.lt.200) k=k+1 + candidate0(1,k)=n*df + candidate0(2,k)=(jpeak(n)-1)*tstep + candidate0(3,k)=red(n) + candidate0(4,k)=isync + enddo + enddo ! isync loop ncand=k ! Put nfqso at top of list, and save only the best of near-dupe freqs. diff --git a/lib/ft8_decode.f90 b/lib/ft8_decode.f90 index 0dc7a0834..81d1ef15b 100644 --- a/lib/ft8_decode.f90 +++ b/lib/ft8_decode.f90 @@ -33,7 +33,7 @@ module ft8_decode contains subroutine decode(this,callback,iwave,nQSOProgress,nfqso,nftx,newdat, & - nutc,nfa,nfb,nexp_decode,ndepth,nagain,lft8apon,lapcqonly,napwid, & + nutc,nfa,nfb,nexp_decode,ndepth,nagain,lft8apon,lapcqonly,ldecode77,napwid, & mycall12,mygrid6,hiscall12,hisgrid6) ! use wavhdr use timer_module, only: timer @@ -46,7 +46,7 @@ contains real sbase(NH1) real candidate(4,200) real dd(15*12000) - logical, intent(in) :: lft8apon,lapcqonly,nagain + logical, intent(in) :: lft8apon,lapcqonly,ldecode77,nagain logical newdat,lsubtract,ldupe,bcontest character*12 mycall12, hiscall12 character*6 mygrid6,hisgrid6 @@ -99,7 +99,7 @@ contains lsubtract=.false. endif call timer('sync8 ',0) - call sync8(dd,ifa,ifb,syncmin,nfqso,s,candidate,ncand,sbase) + call sync8(dd,ifa,ifb,syncmin,nfqso,ldecode77,s,candidate,ncand,sbase) call timer('sync8 ',1) do icand=1,ncand sync=candidate(3,icand) diff --git a/lib/jt9.f90 b/lib/jt9.f90 index ff548b46e..bc445fd38 100644 --- a/lib/jt9.f90 +++ b/lib/jt9.f90 @@ -263,6 +263,7 @@ program jt9 shared_data%params%ndepth=ndepth shared_data%params%lft8apon=.true. shared_data%params%ljt65apon=.true. + shared_data%params%ldecode77=.false. shared_data%params%napwid=75 shared_data%params%dttol=3. diff --git a/lib/jt9com.f90 b/lib/jt9com.f90 index c595582d6..4ce7b6ea6 100644 --- a/lib/jt9com.f90 +++ b/lib/jt9com.f90 @@ -26,6 +26,7 @@ logical(c_bool) :: lft8apon logical(c_bool) :: lapcqonly logical(c_bool) :: ljt65apon + logical(c_bool) :: ldecode77 integer(c_int) :: napwid integer(c_int) :: ntxmode integer(c_int) :: nmode diff --git a/mainwindow.cpp b/mainwindow.cpp index ecc1fd7bb..726f747a2 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2683,6 +2683,7 @@ void MainWindow::decode() //decode() if(m_config.single_decode()) dec_data.params.nexp_decode += 32; if(m_config.enable_VHF_features()) dec_data.params.nexp_decode += 64; if(ui->cbVHFcontest->isChecked()) dec_data.params.nexp_decode += 128; + dec_data.params.ldecode77 = m_config.bDecode77(); strncpy(dec_data.params.datetime, m_dateTime.toLatin1(), 20); strncpy(dec_data.params.mycall, (m_config.my_callsign()+" ").toLatin1(),12);