mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-09-03 13:47:51 -04:00
unpack77 now returns logical variable unpk77_success, which will be .false. if there is something obviously wrong with the message. Still to do: set the flag if the unpacked message contains CQ in an implausible place.
This commit is contained in:
parent
629d061e30
commit
642540ff8f
@ -194,7 +194,7 @@ subroutine pack77(msg0,i3,n3,c77)
|
|||||||
900 return
|
900 return
|
||||||
end subroutine pack77
|
end subroutine pack77
|
||||||
|
|
||||||
subroutine unpack77(c77,msg)
|
subroutine unpack77(c77,msg,unpk77_success)
|
||||||
|
|
||||||
parameter (NSEC=84) !Number of ARRL Sections
|
parameter (NSEC=84) !Number of ARRL Sections
|
||||||
parameter (NUSCAN=65) !Number of US states and Canadian provinces
|
parameter (NUSCAN=65) !Number of US states and Canadian provinces
|
||||||
@ -211,6 +211,7 @@ subroutine unpack77(c77,msg)
|
|||||||
character*4 grid4,cserial
|
character*4 grid4,cserial
|
||||||
character*3 csec(NSEC)
|
character*3 csec(NSEC)
|
||||||
character*38 c
|
character*38 c
|
||||||
|
logical unpk77_success
|
||||||
|
|
||||||
data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/
|
data c/' 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ/'/
|
||||||
data csec/ &
|
data csec/ &
|
||||||
@ -232,10 +233,13 @@ subroutine unpack77(c77,msg)
|
|||||||
"NB ","NS ","QC ","ON ","MB ","SK ","AB ","BC ","NWT","NF ", &
|
"NB ","NS ","QC ","ON ","MB ","SK ","AB ","BC ","NWT","NF ", &
|
||||||
"LB ","NU ","VT ","PEI","DC "/
|
"LB ","NU ","VT ","PEI","DC "/
|
||||||
|
|
||||||
|
unpk77_success=.true.
|
||||||
|
|
||||||
! Check for bad data
|
! Check for bad data
|
||||||
do i=1,77
|
do i=1,77
|
||||||
if(c77(i:i).ne.'0' .and. c77(i:i).ne.'1') then
|
if(c77(i:i).ne.'0' .and. c77(i:i).ne.'1') then
|
||||||
msg='QUIRK 2'
|
msg='failed unpack'
|
||||||
|
unpk77_success=.false.
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
@ -297,9 +301,10 @@ subroutine unpack77(c77,msg)
|
|||||||
|
|
||||||
else if(i3.eq.0 .and. (n3.eq.3 .or. n3.eq.4)) then
|
else if(i3.eq.0 .and. (n3.eq.3 .or. n3.eq.4)) then
|
||||||
! 0.3 WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 ARRL Field Day
|
! 0.3 WA9XYZ KA1ABC R 16A EMA 28 28 1 4 3 7 71 ARRL Field Day
|
||||||
! 0.4 WA9XYZ KA1ABC R 32A EMA 28 28 1 4 3 7 71 ARRL Field Day
|
! 0.4 WA9XYZ KA1ABC R 32A EMA 28 28 1 4 3 7 71 ARRL Field Day
|
||||||
read(c77,1030) n28a,n28b,ir,intx,nclass,isec
|
read(c77,1030) n28a,n28b,ir,intx,nclass,isec
|
||||||
1030 format(2b28,b1,b4,b3,b7)
|
1030 format(2b28,b1,b4,b3,b7)
|
||||||
|
if(isec.gt.NSEC .or. isec.lt.1) unpk77_success=.false.
|
||||||
if(isec.gt.NSEC) isec=NSEC !### Check range for other params? ###
|
if(isec.gt.NSEC) isec=NSEC !### Check range for other params? ###
|
||||||
if(isec.lt.1) isec=1 !### Flag these so they aren't printed? ###
|
if(isec.lt.1) isec=1 !### Flag these so they aren't printed? ###
|
||||||
call unpack28(n28a,call_1)
|
call unpack28(n28a,call_1)
|
||||||
|
@ -14,6 +14,7 @@ integer*1 msgbits(77)
|
|||||||
integer*1 message77(77)
|
integer*1 message77(77)
|
||||||
integer*1 apmask(N), cw(N)
|
integer*1 apmask(N), cw(N)
|
||||||
integer nerrtot(0:N),nerrdec(0:N)
|
integer nerrtot(0:N),nerrdec(0:N)
|
||||||
|
logical unpk77_success
|
||||||
real*8, allocatable :: rxdata(:)
|
real*8, allocatable :: rxdata(:)
|
||||||
real, allocatable :: llr(:)
|
real, allocatable :: llr(:)
|
||||||
|
|
||||||
@ -51,7 +52,7 @@ allocate ( rxdata(N), llr(N) )
|
|||||||
i3=0
|
i3=0
|
||||||
n3=1
|
n3=1
|
||||||
call pack77(msg,i3,n3,c77) !Pack into 12 6-bit bytes
|
call pack77(msg,i3,n3,c77) !Pack into 12 6-bit bytes
|
||||||
call unpack77(c77,msgsent) !Unpack to get msgsent
|
call unpack77(c77,msgsent,unpk77_success) !Unpack to get msgsent
|
||||||
write(*,*) "message sent ",msgsent
|
write(*,*) "message sent ",msgsent
|
||||||
|
|
||||||
read(c77,'(77i1)') msgbits(1:77)
|
read(c77,'(77i1)') msgbits(1:77)
|
||||||
|
@ -36,7 +36,7 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
|||||||
complex ctwk(32)
|
complex ctwk(32)
|
||||||
complex csymb(32)
|
complex csymb(32)
|
||||||
complex cs(0:7,NN)
|
complex cs(0:7,NN)
|
||||||
logical first,newdat,lsubtract,lapon,lapcqonly,nagain
|
logical first,newdat,lsubtract,lapon,lapcqonly,nagain,unpk77_success
|
||||||
data icos7/3,1,4,0,6,5,2/ ! Flipped w.r.t. original FT8 sync array
|
data icos7/3,1,4,0,6,5,2/ ! Flipped w.r.t. original FT8 sync array
|
||||||
data mcq/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0/
|
data mcq/0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0/
|
||||||
data mrrr/0,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,1/
|
data mrrr/0,1,1,1,1,1,1,0,1,0,0,1,0,0,1,0,0,0,1/
|
||||||
@ -321,8 +321,8 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
|||||||
if(i3.gt.4 .or. (i3.eq.0.and.n3.gt.5)) then
|
if(i3.gt.4 .or. (i3.eq.0.and.n3.gt.5)) then
|
||||||
cycle
|
cycle
|
||||||
endif
|
endif
|
||||||
call unpack77(c77,msg37)
|
call unpack77(c77,msg37,unpk77_success)
|
||||||
if(index(msg37,'QU1RK').gt.0) then
|
if(.not.unpk77_success) then
|
||||||
cycle
|
cycle
|
||||||
endif
|
endif
|
||||||
nbadcrc=0 ! If we get this far: valid codeword, valid (i3,n3), nonquirky message.
|
nbadcrc=0 ! If we get this far: valid codeword, valid (i3,n3), nonquirky message.
|
||||||
|
@ -10,11 +10,12 @@ subroutine genft8_174_91(msg,i3,n3,msgsent,msgbits,itone)
|
|||||||
integer itone(79)
|
integer itone(79)
|
||||||
integer icos7(0:6)
|
integer icos7(0:6)
|
||||||
integer graymap(0:7)
|
integer graymap(0:7)
|
||||||
|
logical unpk77_success
|
||||||
data icos7/3,1,4,0,6,5,2/ !Costas 7x7 tone pattern
|
data icos7/3,1,4,0,6,5,2/ !Costas 7x7 tone pattern
|
||||||
data graymap/0,1,3,2,5,6,4,7/
|
data graymap/0,1,3,2,5,6,4,7/
|
||||||
|
|
||||||
call pack77(msg,i3,n3,c77)
|
call pack77(msg,i3,n3,c77)
|
||||||
call unpack77(c77,msgsent)
|
call unpack77(c77,msgsent,unpk77_success)
|
||||||
|
|
||||||
read(c77,'(77i1)',err=1) msgbits
|
read(c77,'(77i1)',err=1) msgbits
|
||||||
go to 2
|
go to 2
|
||||||
|
@ -32,7 +32,7 @@ subroutine genmsk_128_90(msg0,ichk,msgsent,i4tone,itype)
|
|||||||
real*8 xi(864),xq(864),pi,twopi
|
real*8 xi(864),xq(864),pi,twopi
|
||||||
data s8/0,1,1,1,0,0,1,0/
|
data s8/0,1,1,1,0,0,1,0/
|
||||||
equivalence (ihash,i1hash)
|
equivalence (ihash,i1hash)
|
||||||
logical first
|
logical first,unpk77_success
|
||||||
data first/.true./
|
data first/.true./
|
||||||
save
|
save
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ subroutine genmsk_128_90(msg0,ichk,msgsent,i4tone,itype)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
call pack77(message,i3,n3,c77)
|
call pack77(message,i3,n3,c77)
|
||||||
call unpack77(c77,msgsent) !Unpack to get msgsent
|
call unpack77(c77,msgsent,unpk77_success) !Unpack to get msgsent
|
||||||
if(ichk.eq.1) go to 999
|
if(ichk.eq.1) go to 999
|
||||||
read(c77,"(77i1)") msgbits
|
read(c77,"(77i1)") msgbits
|
||||||
call encode_128_90(msgbits,codeword)
|
call encode_128_90(msgbits,codeword)
|
||||||
|
@ -14,6 +14,7 @@ program ldpcsim128_90
|
|||||||
integer*1 msgbits(77)
|
integer*1 msgbits(77)
|
||||||
integer*4 i4Msg6BitWords(13)
|
integer*4 i4Msg6BitWords(13)
|
||||||
integer nerrtot(0:N),nerrdec(0:N)
|
integer nerrtot(0:N),nerrdec(0:N)
|
||||||
|
logical unpk77_success
|
||||||
real*8 rxdata(N), rxavgd(N)
|
real*8 rxdata(N), rxavgd(N)
|
||||||
real llr(N)
|
real llr(N)
|
||||||
|
|
||||||
@ -47,7 +48,7 @@ program ldpcsim128_90
|
|||||||
i3=0
|
i3=0
|
||||||
n3=1
|
n3=1
|
||||||
call pack77(msg,i3,n3,c77)
|
call pack77(msg,i3,n3,c77)
|
||||||
call unpack77(c77,msgsent)
|
call unpack77(c77,msgsent,unpk77_success)
|
||||||
read(c77,'(77i1)') msgbits
|
read(c77,'(77i1)') msgbits
|
||||||
|
|
||||||
write(*,*) "message sent ",msgsent
|
write(*,*) "message sent ",msgsent
|
||||||
@ -107,7 +108,7 @@ program ldpcsim128_90
|
|||||||
! If the decoder finds a valid codeword, nharderrors will be .ge. 0.
|
! If the decoder finds a valid codeword, nharderrors will be .ge. 0.
|
||||||
if( nharderrors .ge. 0 ) then
|
if( nharderrors .ge. 0 ) then
|
||||||
write(c77,'(77i1)') message77
|
write(c77,'(77i1)') message77
|
||||||
call unpack77(c77,msgreceived)
|
call unpack77(c77,msgreceived,unpk77_success)
|
||||||
nhw=count(cw.ne.codeword)
|
nhw=count(cw.ne.codeword)
|
||||||
if(nhw.eq.0) then ! this is a good decode
|
if(nhw.eq.0) then ! this is a good decode
|
||||||
ngood=ngood+1
|
ngood=ngood+1
|
||||||
|
@ -15,7 +15,7 @@ subroutine msk144decodeframe(c,softbits,msgreceived,nsuccess,recent_calls,nrecen
|
|||||||
real pp(12)
|
real pp(12)
|
||||||
real softbits(144)
|
real softbits(144)
|
||||||
real llr(128)
|
real llr(128)
|
||||||
logical first
|
logical first,unpk77_success
|
||||||
data first/.true./
|
data first/.true./
|
||||||
data s8/0,1,1,1,0,0,1,0/
|
data s8/0,1,1,1,0,0,1,0/
|
||||||
save first,cb,fs,pi,twopi,dt,s8,pp
|
save first,cb,fs,pi,twopi,dt,s8,pp
|
||||||
@ -101,7 +101,7 @@ subroutine msk144decodeframe(c,softbits,msgreceived,nsuccess,recent_calls,nrecen
|
|||||||
if( nharderror .ge. 0 .and. nharderror .lt. 18 ) then
|
if( nharderror .ge. 0 .and. nharderror .lt. 18 ) then
|
||||||
nsuccess=1
|
nsuccess=1
|
||||||
write(c77,'(77i1)') decoded77
|
write(c77,'(77i1)') decoded77
|
||||||
call unpack77(c77,msgreceived)
|
call unpack77(c77,msgreceived,unpk77_success)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user