Merge branch 'feat-fst280' of bitbucket.org:k1jt/wsjtx into feat-fst280

This commit is contained in:
Joe Taylor 2020-06-17 13:33:26 -04:00
commit 70441a9b4a
4 changed files with 35 additions and 27 deletions

View File

@ -19,21 +19,21 @@ program fst280d
real llr(280),llra(280),llrb(280),llrc(280),llrd(280) real llr(280),llra(280),llrb(280),llrc(280),llrd(280)
real candidates(100,3) real candidates(100,3)
real bitmetrics(328,4) real bitmetrics(328,4)
integer ihdr(11) integer hmod,ihdr(11)
integer*2, allocatable :: iwave(:) integer*2, allocatable :: iwave(:)
integer*1 apmask(280),cw(280) integer*1 apmask(280),cw(280)
integer*1 hbits(328) integer*1 hbits(328)
integer*1 message101(101),message74(74) integer*1 message101(101),message74(74)
logical badsync,unpk77_success logical badsync,unpk77_success
hmod=1.0 hmod=1
Keff=91 Keff=91
ndeep=3 ndeep=3
iwspr=0 iwspr=0
nargs=iargc() nargs=iargc()
if(nargs.lt.1) then if(nargs.lt.1) then
print*,'Usage: fst280d [-a <data_dir>] [-f fMHz] [-h hmod] [-k Keff] file1 [file2 ...]' print*,'Usage: fst280d [-a <data_dir>] [-f fMHz] [-h hmod] [-k Keff] [-d depth] [-t t/r type] file1 [file2 ...]'
go to 999 go to 999
endif endif
iarg=1 iarg=1
@ -53,8 +53,8 @@ program fst280d
if(arg(1:2).eq.'-h') then if(arg(1:2).eq.'-h') then
call getarg(iarg+1,arg) call getarg(iarg+1,arg)
read(arg,*) hmod read(arg,*) hmod
if(hmod.ne.1.and.hmod.ne.2.and.hmod.ne.4) then if(hmod.ne.1.and.hmod.ne.2.and.hmod.ne.4.and.hmod.ne.8) then
print*,'invalid modulation index. h must be 1, 2, or 4' print*,'invalid modulation index. h must be 1, 2, 4, or 8'
goto 999 goto 999
endif endif
iarg=iarg+2 iarg=iarg+2
@ -84,25 +84,27 @@ program fst280d
case('A') case('A')
nsps=800 nsps=800
nmax=15*12000 nmax=15*12000
ndown=32/hmod ndown=20/hmod
if(hmod.eq.8) ndown=2
case('B') case('B')
nsps=1680 nsps=1680
nmax=30*12000 nmax=30*12000
ndown=70/hmod ndown=42/hmod
if(hmod.eq.4) ndown=15 if(hmod.eq.4) ndown=10
if(hmod.eq.8) ndown=5
case('C') case('C')
nsps=4000 nsps=4000
nmax=60*12000 nmax=60*12000
ndown=160/hmod ndown=100/hmod
if(hmod.eq.8) ndown=16
case('D') case('D')
nsps=8400 nsps=8400
nmax=120*12000 nmax=120*12000
ndown=350/hmod ndown=200/hmod
if(hmod.eq.4) ndown=84
case('E') case('E')
nsps=21504 nsps=21504
nmax=300*12000 nmax=300*12000
ndown=896/hmod ndown=512/hmod
end select end select
nss=nsps/ndown nss=nsps/ndown
fs=12000.0 !Sample rate fs=12000.0 !Sample rate
@ -122,12 +124,12 @@ program fst280d
allocate( cframe(0:164*nss-1) ) allocate( cframe(0:164*nss-1) )
allocate( iwave(nmax) ) allocate( iwave(nmax) )
!write(*,*) 'nsps: ',nsps write(*,*) 'nsps: ',nsps
!write(*,*) 'nmax: ',nmax write(*,*) 'nmax: ',nmax
!write(*,*) 'nss : ',nss write(*,*) 'nss : ',nss
!write(*,*) 'nspsec: ',fs2 write(*,*) 'nspsec: ',fs2
!write(*,*) 'nfft1 : ',nfft1 write(*,*) 'nfft1 : ',nfft1
!write(*,*) 'nfft2 : ',nfft2 write(*,*) 'nfft2 : ',nfft2
ngood=0 ngood=0
ngoodsync=0 ngoodsync=0
@ -229,20 +231,19 @@ program fst280d
fc2=fc21 fc2=fc21
isbest=isbest1 isbest=isbest1
ntmax=4 ntmax=4
if(hmod .gt. 1.0) ntmax=1 if(hmod .gt. 1) ntmax=1
ntmin=1 ntmin=1
njitter=2 njitter=2
else else
fc2=fc28 fc2=fc28
isbest=isbest8 isbest=isbest8
ntmax=4 ntmax=4
if(hmod .gt. 1.0) ntmax=1 if(hmod .gt. 1) ntmax=1
ntmin=1 ntmin=1
njitter=2 njitter=2
endif endif
fc_synced = fc0 + fc2 fc_synced = fc0 + fc2
dt_synced = (isbest-fs2)*dt2 !nominal dt is 1 second so frame starts at sample fs2 dt_synced = (isbest-fs2)*dt2 !nominal dt is 1 second so frame starts at sample fs2
call fst280_downsample(c_bigfft,nfft1,ndown,fc_synced,c2) call fst280_downsample(c_bigfft,nfft1,ndown,fc_synced,c2)
if(abs((isbest-fs2)/nss) .lt. 0.2 .and. abs(fc_synced-1500.0).lt.0.4) then if(abs((isbest-fs2)/nss) .lt. 0.2 .and. abs(fc_synced-1500.0).lt.0.4) then
@ -251,8 +252,8 @@ program fst280d
do ijitter=0,2 do ijitter=0,2
if(ijitter.eq.0) ioffset=0 if(ijitter.eq.0) ioffset=0
if(ijitter.eq.1) ioffset=2 if(ijitter.eq.1) ioffset=1
if(ijitter.eq.2) ioffset=-2 if(ijitter.eq.2) ioffset=-1
is0=isbest+ioffset is0=isbest+ioffset
if(is0.lt.0) cycle if(is0.lt.0) cycle
cframe=c2(is0:is0+164*nss-1) cframe=c2(is0:is0+164*nss-1)
@ -344,6 +345,7 @@ subroutine sync_fst280(cd0,i0,f0,hmod,ncoh,np,nss,fs,sync)
complex z1,z2,z3 complex z1,z2,z3
logical first logical first
integer isyncword(0:7) integer isyncword(0:7)
integer hmod
real f0save real f0save
data isyncword/0,1,3,2,1,0,2,3/ data isyncword/0,1,3,2,1,0,2,3/
data first/.true./ data first/.true./
@ -429,6 +431,7 @@ end subroutine fst280_downsample
subroutine get_candidates_fst280(c_bigfft,nfft1,nsps,hmod,fs,fa,fb,ncand,candidates) subroutine get_candidates_fst280(c_bigfft,nfft1,nsps,hmod,fs,fa,fb,ncand,candidates)
complex c_bigfft(0:nfft1/2) complex c_bigfft(0:nfft1/2)
integer hmod
real candidates(100,3) real candidates(100,3)
real s(18000) real s(18000)
real s2(18000) real s2(18000)
@ -458,9 +461,10 @@ subroutine get_candidates_fst280(c_bigfft,nfft1,nsps,hmod,fs,fa,fb,ncand,candida
s2(i)=db(s2(i)) - 48.5 s2(i)=db(s2(i)) - 48.5
enddo enddo
if(nh.eq.1) thresh=-29.5 if(hmod.eq.1) thresh=-29.5
if(nh.eq.2) thresh=-27.0 if(hmod.eq.2) thresh=-27.0
if(nh.eq.4) thresh=-25.0 if(hmod.eq.4) thresh=-27.0
if(hmod.eq.8) thresh=-27.0
ncand=0 ncand=0
do i=ia,ib do i=ia,ib

View File

@ -12,6 +12,7 @@ program fst280sim
complex, allocatable :: c0(:) complex, allocatable :: c0(:)
complex, allocatable :: c(:) complex, allocatable :: c(:)
real, allocatable :: wave(:) real, allocatable :: wave(:)
integer hmod
integer itone(NN) integer itone(NN)
integer*1 msgbits(101) integer*1 msgbits(101)
integer*2, allocatable :: iwave(:) !Generated full-length waveform integer*2, allocatable :: iwave(:) !Generated full-length waveform
@ -19,6 +20,7 @@ program fst280sim
! Get command-line argument(s) ! Get command-line argument(s)
nargs=iargc() nargs=iargc()
if(nargs.ne.9) then if(nargs.ne.9) then
print*,'Need 9 arguments, got ',nargs
print*,'Usage: fst280sim "message" type f0 DT h fdop del nfiles snr' print*,'Usage: fst280sim "message" type f0 DT h fdop del nfiles snr'
print*,'Examples: fst280sim "K1JT K9AN EN50" C 1500 0.0 1.0 0.1 1.0 10 -15' print*,'Examples: fst280sim "K1JT K9AN EN50" C 1500 0.0 1.0 0.1 1.0 10 -15'
print*,'A: 15 sec' print*,'A: 15 sec'
@ -89,7 +91,7 @@ program fst280sim
write(*,*) write(*,*)
write(*,'(a9,a37)') 'Message: ',msgsent37 write(*,'(a9,a37)') 'Message: ',msgsent37
write(*,1000) f0,xdt,hmod,txt,snrdb write(*,1000) f0,xdt,hmod,txt,snrdb
1000 format('f0:',f9.3,' DT:',f6.2,' hmod:',f6.3,' TxT:',f6.1,' SNR:',f6.1) 1000 format('f0:',f9.3,' DT:',f6.2,' hmod:',i6,' TxT:',f6.1,' SNR:',f6.1)
write(*,*) write(*,*)
if(i3.eq.1) then if(i3.eq.1) then
write(*,*) ' mycall hiscall hisgrid' write(*,*) ' mycall hiscall hisgrid'

View File

@ -4,6 +4,7 @@ subroutine gen_fst280wave(itone,nsym,nsps,nwave,fsample,hmod,f0,icmplx,cwave,wav
complex cwave(nwave) complex cwave(nwave)
real, allocatable, save :: pulse(:) real, allocatable, save :: pulse(:)
real, allocatable :: dphi(:) real, allocatable :: dphi(:)
integer hmod
integer itone(nsym) integer itone(nsym)
logical first logical first
data first/.true./ data first/.true./

View File

@ -10,6 +10,7 @@ subroutine get_fst280_bitmetrics(cd,nss,hmod,bitmetrics,badsync)
integer icos8(0:7) integer icos8(0:7)
integer graymap(0:3) integer graymap(0:3)
integer ip(1) integer ip(1)
integer hmod
logical one(0:65535,0:15) ! 65536 8-symbol sequences, 16 bits logical one(0:65535,0:15) ! 65536 8-symbol sequences, 16 bits
logical first logical first
logical badsync logical badsync