summaryrefslogtreecommitdiff
path: root/lib/msk40decodeframe.f90
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msk40decodeframe.f90')
-rw-r--r--lib/msk40decodeframe.f9022
1 files changed, 8 insertions, 14 deletions
diff --git a/lib/msk40decodeframe.f90 b/lib/msk40decodeframe.f90
index ae75ddf9..2023412e 100644
--- a/lib/msk40decodeframe.f90
+++ b/lib/msk40decodeframe.f90
@@ -1,19 +1,19 @@
subroutine msk40decodeframe(c,mycall,hiscall,xsnr,bswl,nhasharray, &
- recent_calls,nrecent,msgreceived,nsuccess)
+ msgreceived,nsuccess)
! use timer_module, only: timer
+ use packjt77
parameter (NSPM=240)
character*4 rpt(0:15)
- character*6 mycall,hiscall,mycall0,hiscall0
- character*22 hashmsg,msgreceived
- character*12 recent_calls(nrecent)
+ character*12 mycall,hiscall,mycall0,hiscall0
+ character*37 hashmsg,msgreceived
complex cb(42)
complex cfac,cca
complex c(NSPM)
integer*1 cw(32)
integer*1 decoded(16)
integer s8r(8),hardbits(40)
- integer nhasharray(nrecent,nrecent)
+ integer nhasharray(MAXRECENT,MAXRECENT)
real*8 dt, fs, pi, twopi
real cbi(42),cbq(42)
real pp(12)
@@ -59,7 +59,7 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,bswl,nhasharray, &
hashmsg=trim(mycall)//' '//trim(hiscall)
if( hashmsg .ne. ' ' .and. hiscall .ne. '' ) then ! protect against blank mycall/hiscall
call fmtmsg(hashmsg,iz)
- call hash(hashmsg,22,ihash)
+ call hash(hashmsg,37,ihash)
ihash=iand(ihash,4095)
else
ihash=9999 ! so that it can never match a received hash
@@ -115,7 +115,6 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,bswl,nhasharray, &
max_iterations=5
call bpdecode40(llr,max_iterations,decoded,niterations)
-
if( niterations .ge. 0.0 ) then
call encode_msk40(decoded,cw)
nhammd=0
@@ -133,33 +132,28 @@ subroutine msk40decodeframe(c,mycall,hiscall,xsnr,bswl,nhasharray, &
enddo
nrxrpt=iand(imsg,15)
nrxhash=(imsg-nrxrpt)/16
-
if(nhammd.le.4 .and. cord .lt. 0.65 .and. &
nrxhash.eq.ihash .and. nrxrpt.ge.7) then
-!write(*,*) 'decodeframe 1',nbadsync,nhammd,cord,nrxhash,nrxrpt,ihash,xsnr,sigma
nsuccess=1
write(msgreceived,'(a1,a,1x,a,a1,1x,a4)') "<",trim(mycall), &
trim(hiscall),">",rpt(nrxrpt)
return
elseif(bswl .and. nhammd.le.4 .and. cord.lt.0.65 .and. nrxrpt.ge.7 ) then
- do i=1,nrecent
- do j=i+1,nrecent
+ do i=1,MAXRECENT
+ do j=i+1,MAXRECENT
if( nrxhash .eq. nhasharray(i,j) ) then
nsuccess=2
write(msgreceived,'(a1,a,1x,a,a1,1x,a4)') "<",trim(recent_calls(i)), &
trim(recent_calls(j)),">",rpt(nrxrpt)
-!write(*,*) 'decodeframe 2',nbadsync,nhammd,cord,nrxhash,nrxrpt,ihash,xsnr,sigma
elseif( nrxhash .eq. nhasharray(j,i) ) then
nsuccess=2
write(msgreceived,'(a1,a,1x,a,a1,1x,a4)') "<",trim(recent_calls(j)), &
trim(recent_calls(i)),">",rpt(nrxrpt)
-!write(*,*) 'decodeframe 3',nbadsync,nhammd,cord,nrxhash,nrxrpt,ihash,xsnr,sigma
endif
enddo
enddo
if(nsuccess.eq.0) then
nsuccess=3
-!write(*,*) 'decodeframe 4',bswl,nbadsync,nhammd,cord,nrxhash,nrxrpt,ihash,xsnr,sigma,nsuccess
write(msgreceived,'(a1,i4.4,a1,1x,a4)') "<",nrxhash,">",rpt(nrxrpt)
endif
endif