Wraparound buffer for BCDEI decoders

This commit is contained in:
Jordan Sherer 2020-05-07 22:24:48 -04:00
parent 25d644955f
commit 4dbb91047f
2 changed files with 50 additions and 6 deletions

View File

@ -88,7 +88,18 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
pos = max(0,params%kposI)
sz = max(0,params%kszI)
id0=0
id0(1:sz+1)=id2(pos+1:pos+sz+1)
imax=int(NTMAX*12000)
if((imax-pos).lt.sz) then
! this means that the first part of the id0 is at the end of the buffer
! and the second half is at the beginning of the buffer
firstsize=int(imax-pos)-1
secondsize=int(sz-firstsize)+1
id0(1:firstsize+1)=id2(pos+1:pos+firstsize+1)
id0(firstsize+1:firstsize+secondsize+1)=id2(1:secondsize+1)
else
id0(1:sz+1)=id2(pos+1:pos+sz+1)
endif
call my_js8i%decode(js8i_decoded,id0,params%nQSOProgress,params%nfqso, &
params%nftx,newdat,params%nutc,params%nfa,params%nfb, &
@ -111,7 +122,18 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
pos = max(0,params%kposE)
sz = max(0,params%kszE)
id0=0
id0(1:sz+1)=id2(pos+1:pos+sz+1)
imax=int(NTMAX*12000)
if((imax-pos).lt.sz) then
! this means that the first part of the id0 is at the end of the buffer
! and the second half is at the beginning of the buffer
firstsize=int(imax-pos)-1
secondsize=int(sz-firstsize)+1
id0(1:firstsize+1)=id2(pos+1:pos+firstsize+1)
id0(firstsize+1:firstsize+secondsize+1)=id2(1:secondsize+1)
else
id0(1:sz+1)=id2(pos+1:pos+sz+1)
endif
call my_js8e%decode(js8e_decoded,id0,params%nQSOProgress,params%nfqso, &
params%nftx,newdat,params%nutc,params%nfa,params%nfb, &
@ -134,7 +156,18 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
pos = max(0,params%kposC)
sz = max(0,params%kszC)
id0=0
id0(1:sz+1)=id2(pos+1:pos+sz+1)
imax=int(NTMAX*12000)
if((imax-pos).lt.sz) then
! this means that the first part of the id0 is at the end of the buffer
! and the second half is at the beginning of the buffer
firstsize=int(imax-pos)-1
secondsize=int(sz-firstsize)+1
id0(1:firstsize+1)=id2(pos+1:pos+firstsize+1)
id0(firstsize+1:firstsize+secondsize+1)=id2(1:secondsize+1)
else
id0(1:sz+1)=id2(pos+1:pos+sz+1)
endif
call my_js8c%decode(js8c_decoded,id0,params%nQSOProgress,params%nfqso, &
params%nftx,newdat,params%nutc,params%nfa,params%nfb, &
@ -157,7 +190,18 @@ subroutine multimode_decoder(ss,id2,params,nfsample)
pos = max(0,params%kposB)
sz = max(0,params%kszB)
id0=0
id0(1:sz+1)=id2(pos+1:pos+sz+1)
imax=int(NTMAX*12000)
if((imax-pos).lt.sz) then
! this means that the first part of the id0 is at the end of the buffer
! and the second half is at the beginning of the buffer
firstsize=int(imax-pos)-1
secondsize=int(sz-firstsize)+1
id0(1:firstsize+1)=id2(pos+1:pos+firstsize+1)
id0(firstsize+1:firstsize+secondsize+1)=id2(1:secondsize+1)
else
id0(1:sz+1)=id2(pos+1:pos+sz+1)
endif
call my_js8b%decode(js8b_decoded,id0,params%nQSOProgress,params%nfqso, &
params%nftx,newdat,params%nutc,params%nfa,params%nfb, &

View File

@ -3,11 +3,11 @@
parameter (NSUBMODE=0)
parameter (NCOSTAS=1) !Which JS8 Costas Arrays to use (1=original, 2=three symmetrical costas)
parameter (NSPS=1920, NTXDUR=15, NDOWNSPS=32, NDD=100, JZ=36) ! 50 Hz 6.250 baud 16 wpm -25.0dB (1.0Eb/N0) 12.64s
parameter (NSPS=1920, NTXDUR=15, NDOWNSPS=32, NDD=100, JZ=62) ! 50 Hz 6.250 baud 16 wpm -25.0dB (1.0Eb/N0) 12.64s
parameter (AZ=12000.0/(1.0*NSPS)*0.64d0) !Dedupe overlap in Hz
parameter (ASTART=0.5) !Start delay in seconds
parameter (ASYNCMIN=2) !Minimum Sync
parameter (ASYNCMIN=1.5) !Minimum Sync
parameter (KK=87) !Information bits (75 + CRC12)
parameter (ND=58) !Data symbols