From 89c81cb5f1200a40da5f189a226daa4b76532748 Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Sat, 27 Jun 2020 15:43:14 -0500 Subject: [PATCH] XOR the message with rvec before calculating CRC --- lib/fst240/genfst240.f90 | 2 +- lib/fst240_decode.f90 | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/fst240/genfst240.f90 b/lib/fst240/genfst240.f90 index 4cf688308..b442b3efa 100644 --- a/lib/fst240/genfst240.f90 +++ b/lib/fst240/genfst240.f90 @@ -54,6 +54,7 @@ subroutine genfst240(msg0,ichk,msgsent,msgbits,i4tone,iwspr) read(c24,'(24i1)') msgbits(51:74) else read(c77,'(77i1)') msgbits(1:77) + msgbits(1:77)=mod(msgbits(1:77)+rvec,2) call get_crc24(msgbits,101,ncrc24) write(c24,'(b24.24)') ncrc24 read(c24,'(24i1)') msgbits(78:101) @@ -69,7 +70,6 @@ subroutine genfst240(msg0,ichk,msgsent,msgbits,i4tone,iwspr) entry get_fst240_tones_from_bits(msgbits,i4tone,iwspr) 2 continue - call encode240_101(msgbits,codeword) ! Grayscale mapping: diff --git a/lib/fst240_decode.f90 b/lib/fst240_decode.f90 index b857e3dc1..c68997bde 100644 --- a/lib/fst240_decode.f90 +++ b/lib/fst240_decode.f90 @@ -51,8 +51,12 @@ contains integer*1 apmask(240),cw(240) integer*1 hbits(320) integer*1 message101(101),message74(74) + integer*1 rvec(77) logical badsync,unpk77_success,single_decode integer*2 iwave(300*12000) + data rvec/0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,1,1,0, & + 1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,1,1,1,0,0,1,0,1, & + 0,1,0,1,0,1,1,0,1,1,1,1,1,0,0,0,1,0,1/ this%callback => callback hmod=2**nsubmode @@ -313,7 +317,7 @@ contains endif if(nharderrors .ge.0) then if(iwspr.eq.0) then - write(c77,'(77i1)') message101(1:77) + write(c77,'(77i1)') mod(message101(1:77)+rvec,2) call unpack77(c77,0,msg,unpk77_success) else write(c77,'(50i1)') message74(1:50)