From 71385aa20a3c5493478f041e7fcc9ab31a372fa2 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 13 Jan 2021 10:23:38 -0500 Subject: [PATCH] Move some variables into the q65 module. --- lib/q65_decode.f90 | 3 +-- lib/qra/q65/q65.f90 | 24 ++++++------------------ lib/qra/q65/q65_sync.f90 | 4 +--- 3 files changed, 8 insertions(+), 23 deletions(-) diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 9a8046b5d..e6a1baab3 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -57,7 +57,6 @@ contains integer dat4(13) !Decoded message as 12 6-bit integers integer apmask1(78),apsymbols1(78) integer dgen(13) - integer codewords(63,206) logical lclearave,lapcqonly,unpk77_success complex, allocatable :: c00(:) !Analytic signal, 6000 Sa/s complex, allocatable :: c0(:) !Analytic signal, 6000 Sa/s @@ -102,7 +101,7 @@ contains dgen=0 call q65_enc(dgen,codewords) !Initialize the Q65 codec call timer('sync_q65',0) - call q65_sync(nutc,iwave,ntrperiod,mode65,codewords,ncw,nsps, & + call q65_sync(nutc,iwave,ntrperiod,mode65,nsps, & nfqso,ntol,ndepth,lclearave,emedelay,xdt,f0,snr1,width,dat4, & snr2,idec) call timer('sync_q65',1) diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index 170c26f7d..c21eeb5da 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -1,34 +1,22 @@ module q65 - parameter (MAXAVE=64) - parameter (PLOG_MIN=-240.0) !List decoding threshold + parameter (NSTEP=8) !Time bins per symbol, in s1() and s1a() + parameter (PLOG_MIN=-240.0) !List decoding threshold integer nsave,nlist,LL0 - integer iutc(MAXAVE) - integer iseq(MAXAVE) integer listutc(10) integer apsym0(58),aph10(10) integer apmask(13),apsymbols(13) - integer navg,ibwa,ibwb,LL - real f0save(MAXAVE) - real xdtsave(MAXAVE) - real snr1save(MAXAVE) + integer codewords(63,206) + integer navg,ibwa,ibwb,ncw real,allocatable,save :: s1a(:,:) !Cumulative symbol spectra - real,allocatable :: s3save(:,:,:) - real,allocatable :: s3avg(:,:) contains subroutine q65_clravg - iutc=-1 - iseq=-1 - snr1save=0. - xdtsave=0. - f0save=0.0 - nsave=0 - if(allocated(s3save)) s3save=0. - if(allocated(s3avg)) s3avg=0. + s1a=0. + navg=0 return end subroutine q65_clravg diff --git a/lib/qra/q65/q65_sync.f90 b/lib/qra/q65/q65_sync.f90 index cea6862e4..83b0ee127 100644 --- a/lib/qra/q65/q65_sync.f90 +++ b/lib/qra/q65/q65_sync.f90 @@ -1,4 +1,4 @@ -subroutine q65_sync(nutc,iwave,ntrperiod,mode_q65,codewords,ncw,nsps, & +subroutine q65_sync(nutc,iwave,ntrperiod,mode_q65,nsps, & nfqso,ntol,ndepth,lclearave,emedelay,xdt,f0,snr1,width,dat4,snr2,idec) ! Detect and align with the Q65 sync vector, returning time and frequency @@ -17,11 +17,9 @@ subroutine q65_sync(nutc,iwave,ntrperiod,mode_q65,codewords,ncw,nsps, & use timer_module, only: timer use q65 - parameter (NSTEP=8) !Step size nsps/NSTEP parameter (LN=2176*63) !LN=LL*NN; LL=64*(mode_q65+2), NN=63 integer*2 iwave(0:12000*ntrperiod-1) !Raw data integer isync(22) !Indices of sync symbols - integer codewords(63,206) integer dat4(13) integer ijpk(2) character*37 decoded