Working multidecoder using relative positioning in the frame buffer

This commit is contained in:
Jordan Sherer
2019-11-04 14:38:00 -05:00
parent 862e827ddf
commit bd357ed4c4
8 changed files with 161 additions and 45 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
integer, parameter :: NTMAX=30
integer, parameter :: NTMAX=60
integer, parameter :: NMAX=NTMAX*12000 !Total sample intervals (one minute)
integer, parameter :: NDMAX=NTMAX*1500 !Sample intervals at 1500 Hz rate
integer, parameter :: NSMAX=6827 !Max length of saved spectra
+53 -20
View File
@@ -1,4 +1,4 @@
subroutine multimode_decoder(ss,id1,params,nfsample)
subroutine multimode_decoder(ss,id2,params,nfsample)
!$ use omp_lib
use prog_args
@@ -28,8 +28,9 @@ subroutine multimode_decoder(ss,id1,params,nfsample)
end type counting_js8d_decoder
real ss(184,NSMAX)
logical baddata,newdat65,newdat9,single_decode,bVHF,bad0,newdat
integer*2 id1(NTMAX*12000)
logical baddata,newdat65,newdat9,single_decode,bVHF,bad0,newdat,trydecode
integer*2 id0(NTMAX*12000)
integer*2 id2(NTMAX*12000)
type(params_block) :: params
character(len=20) :: datetime
character(len=12) :: mycall, hiscall
@@ -78,60 +79,92 @@ subroutine multimode_decoder(ss,id1,params,nfsample)
endif
endif
if(params%nmode.eq.8 .and. params%nsubmode.eq.4) then
trydecode=.false.
if(params%nmode.eq.8 .and. (params%nsubmode.eq.4 .or. iand(params%nsubmodes, 8).eq.8)) then
! We're in JS8 mode D
call timer('decjs8d ',0)
newdat=params%newdat
call my_js8d%decode(js8d_decoded,id1,params%nQSOProgress,params%nfqso, &
trydecode=.true.
! copy the relevant frames for decoding
pos = params%kposD
sz = params%kszD
id0=0
id0(1:sz+1)=id2(pos+1:pos+sz+1)
call my_js8d%decode(js8d_decoded,id0,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, &
mycall,mygrid,hiscall,hisgrid)
call timer('decjs8d ',1)
go to 800
endif
if(params%nmode.eq.8 .and. params%nsubmode.eq.2) then
if(params%nmode.eq.8 .and. (params%nsubmode.eq.2 .or. iand(params%nsubmodes, 4).eq.4)) then
! We're in JS8 mode C
call timer('decjs8c ',0)
newdat=params%newdat
call my_js8c%decode(js8c_decoded,id1,params%nQSOProgress,params%nfqso, &
trydecode=.true.
! copy the relevant frames for decoding
pos = params%kposC
sz = params%kszC
id0=0
id0(1:sz+1)=id2(pos+1:pos+sz+1)
call my_js8c%decode(js8c_decoded,id0,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, &
mycall,mygrid,hiscall,hisgrid)
call timer('decjs8c ',1)
go to 800
endif
if(params%nmode.eq.8 .and. params%nsubmode.eq.1) then
if(params%nmode.eq.8 .and. (params%nsubmode.eq.1 .or. iand(params%nsubmodes, 2).eq.2)) then
! We're in JS8 mode B
call timer('decjs8b ',0)
newdat=params%newdat
call my_js8b%decode(js8b_decoded,id1,params%nQSOProgress,params%nfqso, &
trydecode=.true.
! copy the relevant frames for decoding
pos = params%kposB
sz = params%kszB
id0=0
id0(1:sz+1)=id2(pos+1:pos+sz+1)
call my_js8b%decode(js8b_decoded,id0,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, &
mycall,mygrid,hiscall,hisgrid)
call timer('decjs8b ',1)
go to 800
endif
if(params%nmode.eq.8 .and. params%nsubmode.eq.0) then
if(params%nmode.eq.8 .and. (params%nsubmode.eq.0 .or. iand(params%nsubmodes, 1).eq.1)) then
! We're in JS8 mode A
call timer('decjs8a ',0)
newdat=params%newdat
call my_js8a%decode(js8a_decoded,id1,params%nQSOProgress,params%nfqso, &
trydecode=.true.
! copy the relevant frames for decoding
pos = params%kposA
sz = params%kszA
id0=0
id0(1:sz+1)=id2(pos+1:pos+sz+1)
call my_js8a%decode(js8a_decoded,id0,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, &
mycall,mygrid,hiscall,hisgrid)
call timer('decjs8a ',1)
go to 800
endif
rms=sqrt(dot_product(float(id1(300000:310000)), &
float(id1(300000:310000)))/10000.0)
if(trydecode) go to 800
rms=sqrt(dot_product(float(id2(300000:310000)), &
float(id2(300000:310000)))/10000.0)
if(rms.lt.2.0) go to 800
! Zap data at start that might come from T/R switching transient?
@@ -142,7 +175,7 @@ subroutine multimode_decoder(ss,id1,params,nfsample)
sq=0.
do n=1,nadd
k=k+1
sq=sq + float(id1(k))**2
sq=sq + float(id2(k))**2
enddo
rms=sqrt(sq/nadd)
if(rms.gt.10000.0) then
@@ -153,11 +186,11 @@ subroutine multimode_decoder(ss,id1,params,nfsample)
enddo
if(bad0) then
nz=min(NTMAX*12000,kbad+100)
! id1(1:nz)=0 ! temporarily disabled as it can breaak the JT9 decoder, maybe others
! id2(1:nz)=0 ! temporarily disabled as it can breaak the JT9 decoder, maybe others
endif
npts65=52*12000
if(baddata(id1,npts65)) then
if(baddata(id2,npts65)) then
nsynced=0
ndecoded=0
go to 800
+4
View File
@@ -297,6 +297,10 @@ program jt9
datetime="2013-Apr-16 15:13" !### Temp
shared_data%params%datetime=transfer(datetime,shared_data%params%datetime)
if(mode.eq.9 .and. fsplit.ne.2700) shared_data%params%nfa=fsplit
shared_data%params%kszA=NMAX-1
shared_data%params%kszB=NMAX-1
shared_data%params%kszC=NMAX-1
shared_data%params%kszD=NMAX-1
call multimode_decoder(shared_data%ss,shared_data%id2,shared_data%params,nfsample)
enddo
+1 -1
View File
@@ -61,7 +61,7 @@ subroutine jt9a()
local_params=shared_data%params !save a copy because wsjtx carries on accessing
call flush(6)
call timer('decoder ',0)
call multimode_decoder(shared_data%ss,shared_data%id1,local_params,12000)
call multimode_decoder(shared_data%ss,shared_data%id2,local_params,12000)
call timer('decoder ',1)
100 inquire(file=trim(temp_dir)//'/.lock',exist=fileExists)
+9 -3
View File
@@ -19,10 +19,17 @@
integer(c_int) :: nfb
integer(c_int) :: ntol
integer(c_int) :: kin
integer(c_int) :: kpos
integer(c_int) :: kout
integer(c_int) :: kposA
integer(c_int) :: kposB
integer(c_int) :: kposC
integer(c_int) :: kposD
integer(c_int) :: kszA
integer(c_int) :: kszB
integer(c_int) :: kszC
integer(c_int) :: kszD
integer(c_int) :: nzhsym
integer(c_int) :: nsubmode
integer(c_int) :: nsubmodes
logical(c_bool) :: nagain
integer(c_int) :: ndepth
logical(c_bool) :: lft8apon
@@ -54,7 +61,6 @@
real(c_float) :: ss(184,NSMAX)
real(c_float) :: savg(NSMAX)
real(c_float) :: sred(5760)
integer(c_short) :: id1(NMAX)
integer(c_short) :: id2(NMAX)
type(params_block) :: params
end type dec_data