diff options
| author | Christoph Berg <myon@debian.org> | 2020-05-11 22:17:58 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2020-05-11 22:17:58 +0200 |
| commit | 32a41b1abe1a4aab0892c9c2051be6ba5b379f1e (patch) | |
| tree | c6e107c1ee4d70610e43a7912e57c720334a08c7 /lib/ft8/ft8code.f90 | |
| parent | 08299e8b2bf50ba90daf570f57def529dd29d6e7 (diff) | |
New upstream version 2.2.0~rc1+repackupstream/2.2.0_rc1+repack
Diffstat (limited to 'lib/ft8/ft8code.f90')
| -rw-r--r-- | lib/ft8/ft8code.f90 | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/lib/ft8/ft8code.f90 b/lib/ft8/ft8code.f90 index cbafd34b..8d5b5279 100644 --- a/lib/ft8/ft8code.f90 +++ b/lib/ft8/ft8code.f90 @@ -12,7 +12,8 @@ program ft8code character*9 comment character bad*1,msgtype*18 integer itone(NN) - integer*1 msgbits(77) + integer*1 msgbits(77),codeword(174) + logical short ! Get command-line argument(s) nargs=iargc() @@ -23,19 +24,22 @@ program ft8code print*,'bit and symbol ordering, and other details of the FT8 protocol.' print* print*,'Usage: ft8code [-c grid] "message" # Results for specified message' - print*,' ft8code -t # Examples of all message types' + print*,' ft8code -T # Examples of all message types' + print*,' ft8code -t # Short format examples' go to 999 endif call getarg(1,msg) !Message to be transmitted - if(len(trim(msg)).eq.2 .and. msg(1:2).eq.'-t') then + short=.false. + if(len(trim(msg)).eq.2 .and. (msg(1:2).eq.'-T' .or. msg(1:2).eq.'-t')) then nmsg=NTEST + short=msg(1:2).eq.'-t' else call fmtmsg(msg,iz) !To upper case; collapse multiple blanks nmsg=1 endif - write(*,1010) + if(.not.short) write(*,1010) 1010 format(4x,'Message',31x,'Decoded',29x,'Err i3.n3'/100('-')) do imsg=1,nmsg @@ -45,6 +49,7 @@ program ft8code i3=-1 n3=-1 call genft8(msg,i3,n3,msgsent,msgbits,itone) + call encode174_91(msgbits,codeword) msgtype="" if(i3.eq.0) then if(n3.eq.0) msgtype="Free text" @@ -58,26 +63,42 @@ program ft8code if(i3.eq.1) msgtype="Standard msg" if(i3.eq.2) msgtype="EU VHF Contest" if(i3.eq.3) msgtype="ARRL RTTY Roundup" - if(i3.eq.4) msgtype="Nonstandard calls" - if(i3.ge.5) msgtype="Undefined msg type" + if(i3.eq.4) msgtype="Nonstandard call" + if(i3.ge.5) msgtype="Undefined type" if(i3.ge.1) n3=-1 bad=" " comment=' ' if(msg.ne.msgsent) bad="*" - if(n3.ge.0) then - write(*,1020) imsg,msg,msgsent,bad,i3,n3,msgtype,comment -1020 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',i1,1x,a18,1x,a9) + if(short) then + if(n3.ge.0) then + write(*,1020) i3,n3,msg,bad,msgtype +1020 format(i1,'.',i1,2x,a37,1x,a1,1x,a18) + else + write(*,1022) i3,msg,bad,msgtype +1022 format(i1,'.',3x,a37,1x,a1,1x,a18) + endif else - write(*,1022) imsg,msg,msgsent,bad,i3,msgtype,comment -1022 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',1x,1x,a18,1x,a9) + if(n3.ge.0) then + write(*,1024) imsg,msg,msgsent,bad,i3,n3,msgtype,comment +1024 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',i1,1x,a18,1x,a9) + else + write(*,1026) imsg,msg,msgsent,bad,i3,msgtype,comment +1026 format(i2,'.',1x,a37,1x,a37,1x,a1,2x,i1,'.',1x,1x,a18,1x,a9) + endif endif enddo if(nmsg.eq.1) then write(*,1030) msgbits -1030 format(/'Message bits: ',/77i1) +1030 format(/'Source-encoded message, 77 bits: ',/77i1) + write(*,1031) codeword(78:91) +1031 format(/'14-bit CRC: ',/14i1) + write(*,1032) codeword(92:174) +1032 format(/'83 Parity bits: ',/83i1) write(*,1034) itone -1034 format(/'Channel symbols (tones):'/79i1) +1034 format(/'Channel symbols (79 tones):'/ & + ' Sync ',14x,'Data',15x,'Sync',15x,'Data',15x,'Sync'/ & + 7i1,1x,29i1,1x,7i1,1x,29i1,1x,7i1) endif 999 end program ft8code |
