Separate accumulations of odd/even sequences in s1a. Still need to fix navg ==> navg(0:1).

This commit is contained in:
Joe Taylor 2021-01-19 15:30:17 -05:00
parent 39024253d2
commit 0cc67bbc59
2 changed files with 21 additions and 10 deletions

View File

@ -8,7 +8,7 @@ module q65_decode
abstract interface
subroutine q65_decode_callback (this,nutc,snr1,nsnr,dt,freq, &
decoded,idec,navg,ntrperiod)
decoded,idec,nused,ntrperiod)
import q65_decoder
implicit none
class(q65_decoder), intent(inout) :: this
@ -19,7 +19,7 @@ module q65_decode
real, intent(in) :: freq
character(len=37), intent(in) :: decoded
integer, intent(in) :: idec
integer, intent(in) :: navg
integer, intent(in) :: nused
integer, intent(in) :: ntrperiod
end subroutine q65_decode_callback
end interface
@ -58,6 +58,7 @@ contains
character*37 decoded !Decoded message
character*77 c77
character*78 c78
character*6 cutc
integer*2 iwave(NMAX) !Raw data
real, allocatable :: dd(:) !Raw data
integer dat4(13) !Decoded message as 12 6-bit integers
@ -74,6 +75,15 @@ contains
npts=ntrperiod*12000
nfft1=ntrperiod*12000
nfft2=ntrperiod*6000
! Determine the T/R sequence: iseq=0 (even), or iseq=1 (odd)
n=nutc
if(ntrperiod.ge.60) n=100*n
write(cutc,'(i6.6)') n
read(cutc,'(3i2)') ih,im,is
nsec=3600*ih + 60*im + is
iseq=mod(nsec/ntrperiod,2)
if(lclearave) call q65_clravg
allocate(dd(npts))
allocate (c00(0:nfft1-1))
@ -216,7 +226,8 @@ contains
1000 format(12b6.6,b5.5)
call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent
nsnr=nint(snr2)
call this%callback(nutc,snr1,nsnr,dtdec,f0dec,decoded,idec,nused,ntrperiod)
call this%callback(nutc,snr1,nsnr,dtdec,f0dec,decoded, &
idec,nused,ntrperiod)
if(iand(ndepth,128).ne.0) call q65_clravg !AutoClrAvg after decode
else
! Report snr1, even if no decode.

View File

@ -1,6 +1,6 @@
module q65
parameter (NSTEP=8) !Time bins per symbol, in s1() and s1a()
parameter (NSTEP=8) !Number of time bins per symbol in s1, s1a, s1b
parameter (PLOG_MIN=-242.0) !List decoding threshold
integer nsave,nlist,LL0,iz0,jz0
integer listutc(10)
@ -11,10 +11,10 @@ module q65
38,46,50,55,60,62,66,69,74,76,85/)
integer codewords(63,206)
integer navg,ibwa,ibwb,ncw,nsps,mode_q65,nfa,nfb
integer istep,nsmo,lag1,lag2,npasses,nused
integer istep,nsmo,lag1,lag2,npasses,nused,iseq
integer i0,j0
real,allocatable,save :: s1a(:,:) !Cumulative symbol spectra
real sync(85) !sync vector
real,allocatable,save :: s1a(:,:,:) !Cumulative symbol spectra
real sync(85) !sync vector
real df,dtstep,dtdec,f0dec
contains
@ -97,7 +97,7 @@ subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, &
allocate(ccf2(-ia2:ia2))
if(LL.ne.LL0 .or. iz.ne.iz0 .or. jz.ne.jz0 .or. lclearave) then
if(allocated(s1a)) deallocate(s1a)
allocate(s1a(iz,jz))
allocate(s1a(iz,jz,0:1))
s1a=0.
navg=0
LL0=LL
@ -119,7 +119,7 @@ subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, &
call q65_symspec(iwave,ntrperiod*12000,iz,jz,s1)
call timer('q65_syms',1)
else
s1=s1a
s1=s1a(:,:,iseq)
endif
i0=nint(nfqso/df) !Target QSO frequency
@ -259,7 +259,7 @@ subroutine q65_symspec(iwave,nmax,iz,jz,s1)
call smo121(s1(1:iz,j),iz)
enddo
enddo
s1a=s1a+s1
s1a(:,:,iseq)=s1a(:,:,iseq) + s1
navg=navg+1
return