Progress toward msk40. msk144sim now runs. No decoder yet.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6966 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2016-07-29 21:09:56 +00:00
parent 5a0a582193
commit eec9d0eb28
4 changed files with 31 additions and 19 deletions

View File

@ -81,9 +81,9 @@ subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file)
enddo
if(message(1:1).eq.'<') then
call genmsk32(message,msgsent,ichk,i4tone,itype)
call genmsk40(message,msgsent,ichk,i4tone,itype)
if(itype.lt.0) go to 999
i4tone(33)=-32
i4tone(39)=-40
go to 999
endif

View File

@ -1,19 +1,20 @@
subroutine genmsk32(msg,msgsent,ichk,itone,itype)
subroutine genmsk40(msg,msgsent,ichk,itone,itype)
use hashing
character*22 msg,msgsent,hashmsg
character*32 cwstring
character*2 cwstrbit
character*4 crpt,rpt(0:63)
character*40 pchk_file,gen_file
logical first
integer itone(144)
integer ig32(0:65536-1) !Codewords for LDPC (32,16) code (PEG generated, regular, col wt 3)
integer*1 codeword(32),bitseq(40)
integer*1 message(16),codeword(32),bitseq(40)
integer*1 s8r(8)
data s8r/1,0,1,1,0,0,0,1/
data first/.true./
save first,rpt,ig32
save first,rpt
if(first) then
call ldpc32_table(ig32) !Define the Golay(24,12) codewords
do i=0,30
if( i.lt.5 ) then
write(rpt(i),'(a1,i2.2,a1)') '-',abs(i-5)
@ -28,6 +29,12 @@ subroutine genmsk32(msg,msgsent,ichk,itone,itype)
first=.false.
endif
!####### TEMPORARILY HARDWIRE PCHK AND GEN FILES ##################
!These files will need to be installed.
pchk_file="peg-32-16-reg3.pchk"
gen_file="peg-32-16-reg3.gen"
call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0))
itype=-1
msgsent='*** bad message ***'
itone=0
@ -40,7 +47,7 @@ subroutine genmsk32(msg,msgsent,ichk,itone,itype)
enddo
go to 900
10 irpt=i !Report index, 0-31
10 irpt=i !Report index, 0-63
if(ichk.lt.10000) then
hashmsg=msg(2:i1-1)//' '//crpt
call hash(hashmsg,22,ihash)
@ -50,13 +57,18 @@ subroutine genmsk32(msg,msgsent,ichk,itone,itype)
ig=ichk-10000
endif
ncodeword=ig32(ig)
! write(*,*) 'codeword is: ',ncodeword,'message is: ',ig,'report index: ',irpt,'hash: ',ihash
do i=1,32
codeword(i)=iand(1,ishft(ncodeword,1-i))
do i=1,16
message(i)=iand(1,ishft(ig,1-i))
enddo
call ldpc_encode(message,codeword)
cwstring=" "
do i=1,32
write(cwstrbit,'(i2)') codeword(i)
cwstring=cwstring//cwstrbit
enddo
write(*,'(a6,i6,2x,a6,i6,2x,a6,i6)') ' msg: ',ig,'rprt: ',irpt,'hash: ',ihash
write(*,'(a6,32i1)') ' cw: ',codeword
bitseq(1:8)=s8r
bitseq(9:40)=codeword
@ -76,5 +88,5 @@ subroutine genmsk32(msg,msgsent,ichk,itone,itype)
itype=7
900 return
end subroutine genmsk32
end subroutine genmsk40

View File

@ -46,9 +46,9 @@ subroutine msk144_decode(id2,npts,nutc,nprint,pchk_file,mycall,hiscall, &
if(nline.eq.0 .and. bShMsgs) then
call timer('detect32',0)
call detectmsk32(c,npts,mycall,hiscall,line,nline,nutc,ntol,t0)
call timer('detect32',1)
call timer('detect40',0)
call detectmsk40(c,npts,mycall,hiscall,line,nline,nutc,ntol,t0)
call timer('detect40',1)
if( nprint .ne. 0 ) then
do i=1,nline
write(*,'(a80)') line(i)

View File

@ -40,7 +40,7 @@ program msk144sim
twopi=8.d0*atan(1.d0)
nsym=144
if( itone(33) .lt. 0 ) nsym=32
if( itone(41) .lt. 0 ) nsym=40
dphi0=twopi*(freq-500)/12000.0
dphi1=twopi*(freq+500)/12000.0
phi=0.0