summaryrefslogtreecommitdiff
path: root/lib/qra/q65/q65code.f90
blob: f4a94d00afda6e9a0fc894d7404674a3622c413e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
program q65code
   use q65_encoding

   implicit none
   character*37 msg37,msgsent
   integer nargs
   integer codeword(65),tones(85)
   integer iargc
   logical success

   nargs=iargc()
   if(nargs .ne. 1) then
      print*,'Usage: q65code "msg"'
      goto 999
   endif
   call getarg(1,msg37)

   call get_q65_tones(msg37,codeword,tones,msgsent,success)
   if(.not.success) then
      print*,'Cannot encode message: ',trim(msg37)
      stop 1
   endif

   write(*,*) 'Message sent: ',trim(msgsent)
   write(*,*) 'Generated message plus CRC (90 bits)'
   write(*,'(a8,15i4)') '6 bit : ',codeword(1:15)
   write(*,'(a8,15b6.6)') 'binary: ',codeword(1:15)
   write(*,*) ' '
   write(*,*) 'Codeword with CRC symbols (65 symbols)'
   write(*,'(20i3)') codeword

   write(*,*) ' '
   write(*,*) 'Channel symbols (85 total)'
   write(*,'(20i3)') tones

999 end program q65code