Open pchk and gen files for msk40 from platform-independent directories. Recompute MSK40 hash codes when mycall or hiscall has changed.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6976 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-07-30 18:46:29 +00:00
parent 548c5e8cdc
commit a2893f7673
4 changed files with 29 additions and 21 deletions

View File

@ -1,19 +1,21 @@
subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages,nutc,ntol,t00) subroutine detectmsk40(cbig,n,pchk_file,mycall,hiscall,lines,nmessages, &
use timer_module, only: timer nutc,ntol,t00)
use timer_module, only: timer
parameter (NSPM=240, NPTS=3*NSPM, MAXSTEPS=7500, NFFT=3*NSPM, MAXCAND=15) parameter (NSPM=240, NPTS=3*NSPM, MAXSTEPS=7500, NFFT=3*NSPM, MAXCAND=15)
character*4 rpt(0:63) character*4 rpt(0:63)
character*6 mycall,hiscall character*6 mycall,hiscall,mycall0,hiscall0
character*22 hashmsg,msgreceived character*22 hashmsg,msgreceived
character*80 lines(100) character*80 lines(100)
character*40 pchk_file,gen_file character*512 pchk_file,gen_file
character*512 pchk_file40,gen_file40
complex cbig(n) complex cbig(n)
complex cdat(NPTS) !Analytic signal complex cdat(NPTS) !Analytic signal
complex cdat2(NPTS) complex cdat2(NPTS)
complex c(NSPM) complex c(NSPM)
complex ctmp(NFFT) complex ctmp(NFFT)
complex cb(42) !Complex waveform for sync word complex cb(42) !Complex waveform for sync word
complex cbr(42) !Complex waveform for reversed sync word complex cbr(42) !Complex waveform for reversed sync word
complex cfac,cca,ccb complex cfac,cca,ccb
complex ccr(NPTS) complex ccr(NPTS)
complex ccr1(NPTS) complex ccr1(NPTS)
@ -43,6 +45,7 @@ subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages,nutc,ntol,t00)
real*8 lratio(32) real*8 lratio(32)
logical first logical first
data first/.true./ data first/.true./
data mycall0/'dummy'/,hiscall0/'dummy'/
data s8/0,1,1,1,0,0,1,0/ data s8/0,1,1,1,0,0,1,0/
data s8r/1,0,1,1,0,0,0,1/ data s8r/1,0,1,1,0,0,0,1/
! codeword for the message <K9AN K1JT> RRR ! codeword for the message <K9AN K1JT> RRR
@ -97,22 +100,26 @@ subroutine detectmsk40(cbig,n,mycall,hiscall,lines,nmessages,nutc,ntol,t00)
enddo enddo
rpt(62)='RRR ' rpt(62)='RRR '
rpt(63)='73 ' rpt(63)='73 '
first=.false.
endif
if(mycall.ne.mycall0 .or. hiscall.ne.hiscall0) then
do i=0,63 do i=0,63
hashmsg=trim(mycall)//' '//trim(hiscall)//' '//rpt(i) hashmsg=trim(mycall)//' '//trim(hiscall)//' '//rpt(i)
call fmtmsg(hashmsg,iz) call fmtmsg(hashmsg,iz)
call hash(hashmsg,22,ihash) call hash(hashmsg,22,ihash)
nhashes(i)=iand(ihash,1023) nhashes(i)=iand(ihash,1023)
enddo enddo
mycall0=mycall
first=.false. hiscall0=hiscall
endif endif
! Temporarily hardwire filenames and init on every call ! Temporarily hardwire filenames and init on every call
pchk_file="peg-32-16-reg3.pchk" i=index(pchk_file,"128-80")
i=index(pchk_file,".pchk") pchk_file40=pchk_file(1:i-1)//"32-16"//pchk_file(i+6:)
gen_file=pchk_file(1:i-1)//".gen" i=index(pchk_file40,".pchk")
call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0)) gen_file40=pchk_file40(1:i-1)//".gen"
call init_ldpc(trim(pchk_file40)//char(0),trim(gen_file40)//char(0))
! Fill the detmet, detferr arrays ! Fill the detmet, detferr arrays
nstepsize=60 ! 5ms steps nstepsize=60 ! 5ms steps

View File

@ -82,7 +82,7 @@ subroutine genmsk144(msg0,ichk,msgsent,i4tone,itype,pchk_file)
enddo enddo
if(message(1:1).eq.'<') then if(message(1:1).eq.'<') then
call genmsk40(message,msgsent,ichk,i4tone,itype) call genmsk40(message,msgsent,ichk,i4tone,itype,pchk_file)
if(itype.lt.0) go to 999 if(itype.lt.0) go to 999
i4tone(41)=-40 i4tone(41)=-40
go to 999 go to 999

View File

@ -1,11 +1,12 @@
subroutine genmsk40(msg,msgsent,ichk,itone,itype) subroutine genmsk40(msg,msgsent,ichk,itone,itype,pchk_file)
use hashing use hashing
character*22 msg,msgsent,hashmsg character*22 msg,msgsent,hashmsg
character*32 cwstring character*32 cwstring
character*2 cwstrbit character*2 cwstrbit
character*4 crpt,rpt(0:63) character*4 crpt,rpt(0:63)
character*40 pchk_file,gen_file character*512 pchk_file,gen_file
character*512 pchk_file40,gen_file40
logical first logical first
integer itone(144) integer itone(144)
integer*1 message(16),codeword(32),bitseq(40) integer*1 message(16),codeword(32),bitseq(40)
@ -29,12 +30,12 @@ subroutine genmsk40(msg,msgsent,ichk,itone,itype)
first=.false. first=.false.
endif endif
!####### TEMPORARILY HARDWIRE PCHK AND GEN FILES ################## ! Temporarily hardwire filenames and init on every call
!These files will need to be installed. i=index(pchk_file,"128-80")
pchk_file40=pchk_file(1:i-1)//"32-16"//pchk_file(i+6:)
pchk_file="peg-32-16-reg3.pchk" i=index(pchk_file40,".pchk")
gen_file="peg-32-16-reg3.gen" gen_file40=pchk_file40(1:i-1)//".gen"
call init_ldpc(trim(pchk_file)//char(0),trim(gen_file)//char(0)) call init_ldpc(trim(pchk_file40)//char(0),trim(gen_file40)//char(0))
itype=-1 itype=-1
msgsent='*** bad message ***' msgsent='*** bad message ***'
itone=0 itone=0

View File

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