ft8d/genft8.f90

47 lines
1.1 KiB
Fortran
Raw Normal View History

2018-12-15 07:25:41 -05:00
subroutine genft8(msg,i3,n3,msgsent,msgbits,itone)
2018-10-15 17:43:39 -04:00
! Encode an FT8 message, producing array itone().
2018-12-15 07:25:41 -05:00
use packjt77
2018-10-15 17:43:39 -04:00
include 'ft8_params.f90'
2018-12-15 07:25:41 -05:00
character msg*37,msgsent*37,msgcall*13,msggrid*4
character*77 c77
integer*1 msgbits(77),codeword(174)
integer itone(79)
2018-10-15 17:43:39 -04:00
integer icos7(0:6)
2018-12-15 07:25:41 -05:00
integer graymap(0:7)
logical unpk77_success
data icos7/3,1,4,0,6,5,2/ !Costas 7x7 tone pattern
data graymap/0,1,3,2,5,6,4,7/
i3=-1
n3=-1
call pack77(msg,i3,n3,c77)
2019-03-26 17:29:41 -04:00
call unpack77(c77,0,msgsent,msgcall,msggrid,unpk77_success)
2018-12-15 07:25:41 -05:00
read(c77,'(77i1)',err=1) msgbits
if(unpk77_success) go to 2
1 msgbits=0
itone=0
msgsent='*** bad message *** '
go to 900
entry get_tones_from_77bits(msgbits,itone)
2 call encode174_91(msgbits,codeword) !Encode the test message
2018-10-15 17:43:39 -04:00
! 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
2018-12-15 07:25:41 -05:00
indx=codeword(i)*4 + codeword(i+1)*2 + codeword(i+2)
itone(k)=graymap(indx)
2018-10-15 17:43:39 -04:00
enddo
2018-12-15 07:25:41 -05:00
900 return
2018-10-15 17:43:39 -04:00
end subroutine genft8