mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-10-31 23:57:10 -04:00
Update some test routines.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7719 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
7c56769454
commit
98877f526c
@ -333,6 +333,7 @@ set (wsjt_FSRCS
|
||||
lib/ccf65.f90
|
||||
lib/fsk4hf/chkcrc10.f90
|
||||
lib/fsk4hf/chkcrc12.f90
|
||||
lib/fsk4hf/chkcrc12a.f90
|
||||
lib/chkhist.f90
|
||||
lib/chkmsg.f90
|
||||
lib/chkss2.f90
|
||||
@ -890,7 +891,7 @@ if (Fortran_COMPILER_NAME MATCHES "gfortran.*")
|
||||
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -isysroot ${CMAKE_OSX_SYSROOT}")
|
||||
endif (CMAKE_OSX_SYSROOT)
|
||||
|
||||
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -fbounds-check -funroll-all-loops -fno-f2c ${General_FFLAGS}")
|
||||
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE} -funroll-all-loops -fno-f2c ${General_FFLAGS}")
|
||||
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -fbounds-check -fno-f2c ${General_FFLAGS}")
|
||||
elseif (Fortran_COMPILER_NAME MATCHES "ifort.*")
|
||||
# ifort (untested)
|
||||
|
24
lib/fsk4hf/chkcrc12a.f90
Normal file
24
lib/fsk4hf/chkcrc12a.f90
Normal file
@ -0,0 +1,24 @@
|
||||
subroutine chkcrc12a(decoded,nbadcrc)
|
||||
|
||||
use crc
|
||||
integer*1 decoded(87)
|
||||
integer*1, target:: i1Dec8BitBytes(11)
|
||||
character*87 cbits
|
||||
|
||||
! Write decoded bits into cbits: 75-bit message plus 12-bit CRC
|
||||
write(cbits,1000) decoded
|
||||
1000 format(87i1)
|
||||
read(cbits,1001) i1Dec8BitBytes
|
||||
1001 format(11b8)
|
||||
read(cbits,1002) ncrc12 !Received CRC12
|
||||
1002 format(75x,b12)
|
||||
|
||||
i1Dec8BitBytes(10)=iand(i1Dec8BitBytes(10),128+64+32)
|
||||
i1Dec8BitBytes(11)=0
|
||||
icrc12=crc12(c_loc(i1Dec8BitBytes),11) !CRC12 computed from 75 msg bits
|
||||
|
||||
nbadcrc=1
|
||||
if(ncrc12.eq.icrc12) nbadcrc=0
|
||||
|
||||
return
|
||||
end subroutine chkcrc12a
|
@ -6,28 +6,24 @@ subroutine extractmessage174(decoded,msgreceived,ncrcflag,recent_calls,nrecent)
|
||||
character*22 msgreceived
|
||||
character*12 call1,call2
|
||||
character*12 recent_calls(nrecent)
|
||||
character*87 cbits
|
||||
integer*1 decoded(87)
|
||||
integer*1, target:: i1Dec8BitBytes(11)
|
||||
integer*4 i4Dec6BitWords(12)
|
||||
|
||||
! Collapse 87 decoded bits to 11 bytes. Bytes 1-9 are the message, byte 10 and first half of byte 11 is the crc
|
||||
do ibyte=1,9
|
||||
itmp=0
|
||||
do ibit=1,8
|
||||
itmp=ishft(itmp,1)+iand(1,decoded((ibyte-1)*8+ibit))
|
||||
enddo
|
||||
i1Dec8BitBytes(ibyte)=itmp
|
||||
enddo
|
||||
! Need to pack the crc into bytes 10 and 11 for crc12_check
|
||||
! i1Dec8BitBytes(10)=decoded(73)*8+decoded(74)*4+decoded(75)*2+decoded(76)
|
||||
! i1Dec8BitBytes(11)=decoded(77)*128+decoded(78)*64+decoded(79)*2*32+decoded(80)*16
|
||||
! i1Dec8BitBytes(11)=i1Dec8BitBytes(11)+decoded(81)*8+decoded(82)*4+decoded(83)*2+decoded(84)
|
||||
i1Dec8BitBytes(10)=decoded(76)*8+decoded(77)*4+decoded(78)*2+decoded(79)
|
||||
i1Dec8BitBytes(11)=decoded(80)*128+decoded(81)*64+decoded(82)*2*32+decoded(83)*16
|
||||
i1Dec8BitBytes(11)=i1Dec8BitBytes(11)+decoded(84)*8+decoded(85)*4+decoded(86)*2+decoded(87)
|
||||
! Write decoded bits into cbits: 75-bit message plus 12-bit CRC
|
||||
write(cbits,1000) decoded
|
||||
1000 format(87i1)
|
||||
read(cbits,1001) i1Dec8BitBytes
|
||||
1001 format(11b8)
|
||||
read(cbits,1002) ncrc12 !Received CRC12
|
||||
1002 format(75x,b12)
|
||||
|
||||
! if( crc12_check(c_loc (i1Dec8BitBytes), 11) ) then
|
||||
if(.true.) then !### TEST ###
|
||||
i1Dec8BitBytes(10)=iand(i1Dec8BitBytes(10),128+64+32)
|
||||
i1Dec8BitBytes(11)=0
|
||||
icrc12=crc12(c_loc(i1Dec8BitBytes),11) !CRC12 computed from 75 msg bits
|
||||
|
||||
if(ncrc12.eq.icrc12) then
|
||||
! CRC12 checks out --- unpack 72-bit message
|
||||
do ibyte=1,12
|
||||
itmp=0
|
||||
|
@ -13,7 +13,7 @@ program ft8d
|
||||
include 'ft8_params.f90'
|
||||
parameter(NRECENT=10)
|
||||
character*12 recent_calls(NRECENT)
|
||||
character message*22,cbits*75,infile*80,datetime*11
|
||||
character message*22,infile*80,datetime*11
|
||||
real s(NH1,NHSYM)
|
||||
real s1(0:7,ND)
|
||||
real ps(0:7)
|
||||
@ -47,6 +47,7 @@ program ft8d
|
||||
datetime=infile(j2-11:j2-1)
|
||||
call sync8(iwave,xdt,f1,s)
|
||||
|
||||
xsnr=0.
|
||||
tstep=0.5*NSPS/12000.0
|
||||
df=12000.0/NFFT1
|
||||
i0=nint(f1/df)
|
||||
@ -83,15 +84,13 @@ program ft8d
|
||||
ss=0.84
|
||||
llr=2.0*rxdata/(ss*ss)
|
||||
apmask=0
|
||||
max_iterations=20
|
||||
max_iterations=40
|
||||
ifer=0
|
||||
call bpdecode174(llr,apmask,max_iterations,decoded,niterations)
|
||||
! if(niterations.lt.0) call osd174(llr,4,decoded,niterations,cw)
|
||||
if(niterations.lt.0) call osd174(llr,2,decoded,niterations,cw)
|
||||
nbadcrc=0
|
||||
if(niterations.ge.0) call chkcrc10(decoded,nbadcrc)
|
||||
! if(niterations.lt.0 .or. nbadcrc.ne.0) ifer=1
|
||||
if(niterations.lt.0) ifer=1
|
||||
! if(ifer.eq.0) exit
|
||||
if(niterations.ge.0) call chkcrc12a(decoded,nbadcrc)
|
||||
if(niterations.lt.0 .or. nbadcrc.ne.0) ifer=1
|
||||
|
||||
message=' '
|
||||
if(ifer.eq.0) then
|
||||
|
@ -4,28 +4,41 @@ subroutine genft8(msg,msgsent,itone)
|
||||
|
||||
use crc
|
||||
use packjt
|
||||
use hashing
|
||||
include 'ft8_params.f90'
|
||||
|
||||
character*22 msg,msgsent
|
||||
character*87 cbits
|
||||
logical checksumok
|
||||
integer*4 i4Msg6BitWords(12) !72-bit message as 6-bit words
|
||||
integer*1 msgbits(KK),codeword(3*ND)
|
||||
integer*1, target:: i1Msg8BitBytes(11)
|
||||
integer itone(NN)
|
||||
integer icos7(0:6)
|
||||
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
|
||||
|
||||
call packmsg(msg,i4Msg6BitWords,itype) !Pack into 12 6-bit bytes
|
||||
call unpackmsg(i4Msg6BitWords,msgsent) !Unpack to get msgsent
|
||||
i3bit=0 !### temporary ###
|
||||
icrc12=0 !### temporary ###
|
||||
i3bit=0 !### temporary ###
|
||||
write(cbits,1000) i4Msg6BitWords,32*i3bit
|
||||
1000 format(12b6.6,b8.8)
|
||||
read(cbits,1001) i1Msg8BitBytes(1:10)
|
||||
1001 format(10b8)
|
||||
i1Msg8BitBytes(10)=iand(i1Msg8BitBytes(10),128+64+32)
|
||||
i1Msg8BitBytes(11)=0
|
||||
icrc12=crc12(c_loc(i1Msg8BitBytes),11)
|
||||
|
||||
write(cbits,1000) i4Msg6BitWords,i3bit,icrc12
|
||||
1000 format(12b6.6,b3.3,b12.12)
|
||||
read(cbits,1002) msgbits
|
||||
1002 format(87i1)
|
||||
! For reference, here's how to check the CRC
|
||||
i1Msg8BitBytes(10)=icrc12/256
|
||||
i1Msg8BitBytes(11)=iand (icrc12,255)
|
||||
checksumok = crc12_check(c_loc (i1Msg8BitBytes), 11)
|
||||
if( checksumok ) write(*,*) 'Good checksum'
|
||||
|
||||
write(cbits,1003) i4Msg6BitWords,i3bit,icrc12
|
||||
1003 format(12b6.6,b3.3,b12.12)
|
||||
read(cbits,1004) msgbits
|
||||
1004 format(87i1)
|
||||
print*,cbits
|
||||
|
||||
print*,icrc12
|
||||
|
||||
call encode174(msgbits,codeword) !Encode the test message
|
||||
|
||||
! Message structure: S7 D29 S7 D29 S7
|
||||
|
Loading…
Reference in New Issue
Block a user