ft8sim can now generate old (174,87) or new (174,91) frames. Frame type is selected using the itype command line parameter.

This commit is contained in:
Steve Franke 2018-06-05 08:40:00 -05:00
parent 86a5ae6596
commit 772b1bd5fa
3 changed files with 85 additions and 11 deletions

View File

@ -462,6 +462,7 @@ set (wsjt_FSRCS
lib/geniscat.f90
lib/fsk4hf/genfsk4hf.f90
lib/ft8/genft8.f90
lib/ft8/genft8_174_91.f90
lib/genmsk144.f90
lib/genmsk40.f90
lib/fsk4hf/genmskhf.f90

View File

@ -15,18 +15,18 @@ program ft8sim
complex c(0:NMAX-1)
real wave(NMAX)
integer itone(NN)
integer*1 msgbits(KK)
integer*1 msgbits(91)
integer*2 iwave(NMAX) !Generated full-length waveform
data mygrid6/'EM48 '/
! Get command-line argument(s)
nargs=iargc()
if(nargs.ne.8) then
print*,'Usage: ft8sim "message" nsig|f0 DT fdop del width nfiles snr'
print*,'Examples: ft8sim "K1ABC W9XYZ EN37" 1500.0 0.0 0.1 1.0 0 10 -18'
print*,' ft8sim "K1ABC W9XYZ EN37" 10 0.0 0.1 1.0 25 10 -18'
print*,' ft8sim "K1ABC W9XYZ EN37" 25 0.0 0.1 1.0 25 10 -18'
print*,' ft8sim "K1ABC RR73; W9XYZ <KH1/KH7Z> -11" 300 0 0 0 25 1 -10'
if(nargs.ne.9) then
print*,'Usage: ft8sim "message" nsig|f0 DT fdop del width nfiles snr type'
print*,'Examples: ft8sim "K1ABC W9XYZ EN37" 1500.0 0.0 0.1 1.0 0 10 -18 1'
print*,' ft8sim "K1ABC W9XYZ EN37" 10 0.0 0.1 1.0 25 10 -18 1'
print*,' ft8sim "K1ABC W9XYZ EN37" 25 0.0 0.1 1.0 25 10 -18 1'
print*,' ft8sim "K1ABC RR73; W9XYZ <KH1/KH7Z> -11" 300 0 0 0 25 1 -10 1'
print*,'Make nfiles negative to invoke 72-bit contest mode.'
go to 999
endif
@ -45,6 +45,9 @@ program ft8sim
read(arg,*) nfiles !Number of files
call getarg(8,arg)
read(arg,*) snrdb !SNR_2500
call getarg(9,arg)
read(arg,*) itype !itype=1 for (174,87), itype=2 for (174,91)
nsig=1
if(f0.lt.100.0) then
nsig=f0
@ -69,7 +72,11 @@ program ft8sim
if(index(msg40,';').le.0) then
i3bit=0
msg=msg40(1:22)
call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
if(itype.eq.1) then
call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
elseif(itype.eq.2) then
call genft8_174_91(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
endif
write(*,1000) f0,xdt,txt,snrdb,bw,msgsent
1000 format('f0:',f9.3,' DT:',f6.2,' TxT:',f6.1,' SNR:',f6.1, &
' BW:',f4.1,2x,a22)
@ -82,8 +89,13 @@ program ft8sim
write(*,1030) msgbits(1:56)
1030 format(/'Call1: ',28i1,' Call2: ',28i1)
write(*,1032) msgbits(57:72),msgbits(73:75),msgbits(76:87)
if(itype.eq.1) then
write(*,1032) msgbits(57:72),msgbits(73:75),msgbits(76:87)
1032 format('Grid: ',16i1,' 3Bit: ',3i1,' CRC12: ',12i1)
elseif(itype.eq.2) then
write(*,1033) msgbits(57:72),msgbits(73:77),msgbits(78:91)
1033 format('Grid: ',16i1,' 5Bit: ',5i1,' CRC14: ',14i1)
endif
write(*,1034) itone
1034 format(/'Channel symbols:'/79i1/)
@ -99,7 +111,11 @@ program ft8sim
if(isig.eq.2) then
f0=f0+100
endif
call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
if(itype.eq.1) then
call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
elseif(itype.eq.2) then
call genft8_174_91(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
endif
endif
if(nsig.eq.25) then
f0=(isig+2)*100.0
@ -118,7 +134,11 @@ program ft8sim
1002 format('R',i3.2)
f0=600.0 + mod(isig-1,5)*60.0
endif
call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
if(itype.eq.1) then
call genft8(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
elseif(itype.eq.2) then
call genft8_174_91(msg,mygrid6,bcontest,i3bit,msgsent,msgbits,itone)
endif
endif
k=-1 + nint((xdt+0.5+0.01*gran())/dt)
! k=-1 + nint((xdt+0.5)/dt)

53
lib/ft8/genft8_174_91.f90 Normal file
View File

@ -0,0 +1,53 @@
subroutine genft8_174_91(msg,mygrid,bcontest,i5bit,msgsent,msgbits,itone)
! Encode an FT8 message, producing array itone().
use crc
use packjt
include 'ft8_params.f90'
character*22 msg,msgsent
character*6 mygrid
character*91 cbits
logical bcontest,checksumok
integer*4 i4Msg6BitWords(12) !72-bit message as 6-bit words
integer*1 msgbits(91),codeword(174)
integer*1, target:: i1Msg8BitBytes(12)
integer itone(79)
integer icos7(0:6)
# data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
data icos7/3,1,4,0,6,5,2/ !Costas 7x7 tone pattern
call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes
call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent
write(cbits,1000) i4Msg6BitWords,8*i5bit
1000 format(12b6.6,b8.8)
read(cbits,1001) i1Msg8BitBytes(1:10)
1001 format(10b8)
i1Msg8BitBytes(10)=iand(i1Msg8BitBytes(10),128+64+32+16+8)
i1Msg8BitBytes(11:12)=0
icrc14=crc14(c_loc(i1Msg8BitBytes),12)
i1Msg8BitBytes(11)=icrc14/256
i1Msg8BitBytes(12)=iand (icrc14,255)
write(cbits,1003) i4Msg6BitWords,i5bit,icrc14
1003 format(12b6.6,b5.5,b14.14)
read(cbits,1004) msgbits
1004 format(91i1)
call encode174_91(msgbits,codeword) !Encode the test message
! Message structure: S7 D29 S7 D29 S7
itone(1:7)=icos7
itone(36+1:36+7)=icos7
itone(NN-6:NN)=icos7
k=7
do j=1,ND
i=3*j -2
k=k+1
if(j.eq.30) k=k+7
itone(k)=codeword(i)*4 + codeword(i+1)*2 + codeword(i+2)
enddo
return
end subroutine genft8_174_91