mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-09-01 12:47:55 -04:00
Make changes to ft8b_2.f90 to accommodate the new 77-bit in/out encoding/decoding routines. With these changes, WSJT-X decodes (174,91) frames.
This commit is contained in:
parent
1a31e5b2d6
commit
3f8c218ebe
@ -4,7 +4,6 @@ subroutine extractmessage77(decoded77,msgreceived)
|
|||||||
character*22 msgreceived
|
character*22 msgreceived
|
||||||
character*77 cbits
|
character*77 cbits
|
||||||
integer*1 decoded77(77)
|
integer*1 decoded77(77)
|
||||||
integer*1, target:: i1Dec8BitBytes(12)
|
|
||||||
integer*4 i4Dec6BitWords(12)
|
integer*4 i4Dec6BitWords(12)
|
||||||
|
|
||||||
write(cbits,'(77i1)') decoded77
|
write(cbits,'(77i1)') decoded77
|
||||||
|
@ -16,11 +16,11 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
|||||||
real s1(0:7,ND),s2(0:7,NN),s1sort(8*ND)
|
real s1(0:7,ND),s2(0:7,NN),s1sort(8*ND)
|
||||||
real ps(0:7),psl(0:7)
|
real ps(0:7),psl(0:7)
|
||||||
real bmeta(3*ND),bmetb(3*ND),bmetap(3*ND)
|
real bmeta(3*ND),bmetb(3*ND),bmetap(3*ND)
|
||||||
real llr(3*ND),llra(3*ND),llrb(3*ND),llrd(3*ND) !Soft symbols
|
real llra(3*ND),llrb(3*ND),llrd(3*ND) !Soft symbols
|
||||||
real dd0(15*12000)
|
real dd0(15*12000)
|
||||||
integer*1 decoded(91),decoded0(91),apmask(3*ND),cw(3*ND)
|
integer*1 message77(77),apmask(3*ND),cw(3*ND)
|
||||||
integer*1 msgbits(91)
|
integer*1 msgbits(77)
|
||||||
integer apsym(91)
|
integer apsym(77)
|
||||||
integer mcq(28),mde(28),mrrr(16),m73(16),mrr73(16)
|
integer mcq(28),mde(28),mrrr(16),m73(16),mrr73(16)
|
||||||
integer itone(NN)
|
integer itone(NN)
|
||||||
integer indxs1(8*ND)
|
integer indxs1(8*ND)
|
||||||
@ -42,9 +42,6 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
|||||||
data first/.true./
|
data first/.true./
|
||||||
save nappasses,naptypes
|
save nappasses,naptypes
|
||||||
|
|
||||||
! All of the AP-related code in this routine needs to be re-written! AP decoding
|
|
||||||
! passes are disabled for now.
|
|
||||||
!
|
|
||||||
if(first) then
|
if(first) then
|
||||||
mcq=2*mcq-1
|
mcq=2*mcq-1
|
||||||
mde=2*mde-1
|
mde=2*mde-1
|
||||||
@ -79,6 +76,7 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
|||||||
|
|
||||||
max_iterations=30
|
max_iterations=30
|
||||||
nharderrors=-1
|
nharderrors=-1
|
||||||
|
nbadcrc=1 ! this is used upstream to flag good decodes.
|
||||||
fs2=12000.0/NDOWN
|
fs2=12000.0/NDOWN
|
||||||
dt2=1.0/fs2
|
dt2=1.0/fs2
|
||||||
twopi=8.0*atan(1.0)
|
twopi=8.0*atan(1.0)
|
||||||
@ -265,7 +263,7 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
|||||||
|
|
||||||
cw=0
|
cw=0
|
||||||
call timer('bpd174_91 ',0)
|
call timer('bpd174_91 ',0)
|
||||||
call bpdecode174_91(llrd,apmask,max_iterations,decoded,cw,nharderrors, &
|
call bpdecode174_91(llrd,apmask,max_iterations,message77,cw,nharderrors, &
|
||||||
niterations)
|
niterations)
|
||||||
call timer('bpd174_91 ',1)
|
call timer('bpd174_91 ',1)
|
||||||
dmin=0.0
|
dmin=0.0
|
||||||
@ -280,31 +278,19 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
|||||||
endif
|
endif
|
||||||
if(nagain) ndeep=5
|
if(nagain) ndeep=5
|
||||||
call timer('osd174_91 ',0)
|
call timer('osd174_91 ',0)
|
||||||
call osd174_91(llrd,apmask,ndeep,decoded,cw,nharderrors,dmin)
|
call osd174_91(llrd,apmask,ndeep,message77,cw,nharderrors,dmin)
|
||||||
call timer('osd174_91 ',1)
|
call timer('osd174_91 ',1)
|
||||||
endif
|
endif
|
||||||
nbadcrc=1
|
|
||||||
message=' '
|
message=' '
|
||||||
xsnr=-99.0
|
xsnr=-99.0
|
||||||
|
if(nharderrors.lt.0) cycle
|
||||||
if(count(cw.eq.0).eq.174) cycle !Reject the all-zero codeword
|
if(count(cw.eq.0).eq.174) cycle !Reject the all-zero codeword
|
||||||
if(nharderrors.ge.0 .and. nharderrors+dmin.lt.60.0 .and. &
|
nbadcrc=0 ! If we get this far, must be a valid codeword.
|
||||||
.not.(sync.lt.2.0 .and. nharderrors.gt.35) .and. &
|
i5bit=16*message77(73) + 8*message77(74) + 4*message77(75) + 2*message77(76) + message77(77)
|
||||||
.not.(ipass.gt.2 .and. nharderrors.gt.39) .and. &
|
iFreeText=message77(57)
|
||||||
.not.(ipass.eq.4 .and. nharderrors.gt.30) &
|
if(i5bit.eq.1) message77(57:)=0
|
||||||
) then
|
call extractmessage77(message77,message)
|
||||||
call chkcrc14a(decoded,nbadcrc)
|
! This needs fixing for messages with i5bit=1
|
||||||
else
|
|
||||||
nharderrors=-1
|
|
||||||
cycle
|
|
||||||
endif
|
|
||||||
i5bit=16*decoded(73) + 8*decoded(74) + 4*decoded(75) + 2*decoded(76) + decoded(77)
|
|
||||||
iFreeText=decoded(57)
|
|
||||||
if(nbadcrc.eq.0) then
|
|
||||||
decoded0=decoded
|
|
||||||
if(i5bit.eq.1) decoded(57:)=0
|
|
||||||
call extractmessage174_91(decoded,message,ncrcflag)
|
|
||||||
decoded=decoded0
|
|
||||||
! This needs fixing for messages with i5bit=1:
|
|
||||||
call genft8_174_91(message,mygrid6,bcontest,i5bit,msgsent,msgbits,itone)
|
call genft8_174_91(message,mygrid6,bcontest,i5bit,msgsent,msgbits,itone)
|
||||||
if(lsubtract) call subtractft8(dd0,itone,f1,xdt2)
|
if(lsubtract) call subtractft8(dd0,itone,f1,xdt2)
|
||||||
xsig=0.0
|
xsig=0.0
|
||||||
@ -340,7 +326,7 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
|||||||
trim(hiscall12)//'> '
|
trim(hiscall12)//'> '
|
||||||
if(ncrc10.ne.icrc10) msg37=c1//' RR73; '//c2//' <...> '
|
if(ncrc10.ne.icrc10) msg37=c1//' RR73; '//c2//' <...> '
|
||||||
|
|
||||||
! msg37=c1//' RR73; '//c2//' <...> '
|
msg37=c1//' RR73; '//c2//' <...> '
|
||||||
write(msg37(35:37),1010) irpt
|
write(msg37(35:37),1010) irpt
|
||||||
1010 format(i3.2)
|
1010 format(i3.2)
|
||||||
if(msg37(35:35).ne.'-') msg37(35:35)='+'
|
if(msg37(35:35).ne.'-') msg37(35:35)='+'
|
||||||
@ -356,7 +342,6 @@ subroutine ft8b_2(dd0,newdat,nQSOProgress,nfqso,nftx,ndepth,lapon,lapcqonly, &
|
|||||||
msg37=message//' '
|
msg37=message//' '
|
||||||
endif
|
endif
|
||||||
return
|
return
|
||||||
endif
|
|
||||||
enddo
|
enddo
|
||||||
return
|
return
|
||||||
end subroutine ft8b_2
|
end subroutine ft8b_2
|
||||||
|
@ -2,16 +2,14 @@ subroutine genft8_174_91(msg,mygrid,bcontest,i5bit,msgsent,msgbits,itone)
|
|||||||
|
|
||||||
! Encode an FT8 message, producing array itone().
|
! Encode an FT8 message, producing array itone().
|
||||||
|
|
||||||
use crc
|
|
||||||
use packjt
|
use packjt
|
||||||
include 'ft8_params.f90'
|
include 'ft8_params.f90'
|
||||||
character*22 msg,msgsent
|
character*22 msg,msgsent
|
||||||
character*6 mygrid
|
character*6 mygrid
|
||||||
character*91 cbits
|
character*91 cbits
|
||||||
logical bcontest,checksumok
|
logical bcontest
|
||||||
integer*4 i4Msg6BitWords(12) !72-bit message as 6-bit words
|
integer*4 i4Msg6BitWords(12) !72-bit message as 6-bit words
|
||||||
integer*1 msgbits(91),codeword(174)
|
integer*1 msgbits(77),codeword(174)
|
||||||
integer*1, target:: i1Msg8BitBytes(12)
|
|
||||||
integer itone(79)
|
integer itone(79)
|
||||||
integer icos7(0:6)
|
integer icos7(0:6)
|
||||||
integer graymap(0:7)
|
integer graymap(0:7)
|
||||||
@ -21,21 +19,8 @@ subroutine genft8_174_91(msg,mygrid,bcontest,i5bit,msgsent,msgbits,itone)
|
|||||||
call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes
|
call packmsg(msg,i4Msg6BitWords,itype,bcontest) !Pack into 12 6-bit bytes
|
||||||
call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent
|
call unpackmsg(i4Msg6BitWords,msgsent,bcontest,mygrid) !Unpack to get msgsent
|
||||||
|
|
||||||
write(cbits,1000) i4Msg6BitWords,8*i5bit
|
write(cbits,'(12b6.6,b8.8)') i4Msg6BitWords,8*i5bit
|
||||||
1000 format(12b6.6,b8.8)
|
read(cbits,'(77i1)') msgbits
|
||||||
read(cbits,1001) i1Msg8BitBytes(1:10)
|
|
||||||
1001 format(10b8)
|
|
||||||
i1Msg8BitBytes(10)=iand(i1Msg8BitBytes(10),128+64+32+16+8)
|
|
||||||
i1Msg8BitBytes(11:12)=0
|
|
||||||
icrc14=crc14(c_loc(i1Msg8BitBytes),12)
|
|
||||||
i1Msg8BitBytes(11)=icrc14/256
|
|
||||||
i1Msg8BitBytes(12)=iand (icrc14,255)
|
|
||||||
|
|
||||||
write(cbits,1003) i4Msg6BitWords,i5bit,icrc14
|
|
||||||
1003 format(12b6.6,b5.5,b14.14)
|
|
||||||
read(cbits,1004) msgbits
|
|
||||||
1004 format(91i1)
|
|
||||||
|
|
||||||
call encode174_91(msgbits,codeword) !Encode the test message
|
call encode174_91(msgbits,codeword) !Encode the test message
|
||||||
|
|
||||||
! Message structure: S7 D29 S7 D29 S7
|
! Message structure: S7 D29 S7 D29 S7
|
||||||
|
Loading…
x
Reference in New Issue
Block a user