2016-06-09 11:06:15 -04:00
|
|
|
subroutine msk144_decode(id2,npts,nutc,nprint,pchk_file,line)
|
2016-06-01 22:46:53 -04:00
|
|
|
|
|
|
|
! Calls the experimental decoder for JTMSK 72ms ldpc messages
|
|
|
|
|
|
|
|
parameter (NMAX=30*12000)
|
|
|
|
parameter (NFFTMAX=512*1024)
|
|
|
|
integer*2 id2(0:NMAX) !Raw i*2 data, up to T/R = 30 s
|
|
|
|
integer hist(0:32868)
|
|
|
|
real d(0:NMAX) !Raw r*4 data
|
|
|
|
complex c(NFFTMAX) !Complex (analytic) data
|
|
|
|
character*80 line(100) !Decodes passed back to caller
|
2016-06-09 11:06:15 -04:00
|
|
|
character*512 pchk_file
|
2016-06-11 22:43:49 -04:00
|
|
|
! equivalence (hist,d)
|
2016-06-01 22:46:53 -04:00
|
|
|
|
|
|
|
line(1:100)(1:1)=char(0)
|
|
|
|
|
|
|
|
hist=0
|
|
|
|
do i=0,npts-1
|
|
|
|
n=abs(id2(i))
|
|
|
|
hist(n)=hist(n)+1
|
|
|
|
enddo
|
|
|
|
ns=0
|
|
|
|
do n=0,32768
|
|
|
|
ns=ns+hist(n)
|
|
|
|
if(ns.gt.npts/2) exit
|
|
|
|
enddo
|
|
|
|
fac=1.0/(1.5*n)
|
|
|
|
d(0:npts-1)=fac*id2(0:npts-1)
|
|
|
|
|
|
|
|
n=log(float(npts))/log(2.0) + 1.0
|
|
|
|
nfft=min(2**n,1024*1024)
|
|
|
|
call analytic(d,npts,nfft,c) !Convert to analytic signal and filter
|
2016-06-11 22:43:49 -04:00
|
|
|
call detectmsk144(c,npts,pchk_file,line,nline,nutc)
|
|
|
|
if( nprint .ne. 0 ) then
|
|
|
|
do i=1,nline
|
|
|
|
write(*,'(a80)') line(i)
|
|
|
|
enddo
|
|
|
|
endif
|
|
|
|
if(line(1)(1:6).eq.' ') line(1)(1:1)=char(0)
|
2016-06-01 22:46:53 -04:00
|
|
|
return
|
|
|
|
end subroutine msk144_decode
|