diff --git a/lib/hspec.f90 b/lib/hspec.f90 index b00e6bf70..e1377c3bc 100644 --- a/lib/hspec.f90 +++ b/lib/hspec.f90 @@ -71,7 +71,7 @@ subroutine hspec(id2,k,nutc0,ntrpdepth,nrxfreq,ntol,bmsk144,ingain, & if(bmsk144) then if(k.ge.7168) then tsec=(k-7168)/12000.0 - call mskrtd(id2(k-7168+1:k),nutc0,tsec,ntol,nrxfreq,line1) + call mskrtd(id2(k-7168+1:k),nutc0,tsec,ntol,nrxfreq,ndepth,line1) endif endif !### diff --git a/lib/msk144d2.f90 b/lib/msk144d2.f90 index 8b6507bda..7df8fed18 100644 --- a/lib/msk144d2.f90 +++ b/lib/msk144d2.f90 @@ -18,7 +18,8 @@ program msk144d2 character*12 mycall,hiscall character(len=500) optarg - type (option) :: long_options(7) = [ & + type (option) :: long_options(8) = [ & + option ('ndepth',.true.,'c','ndepth',''), & option ('dxcall',.true.,'d','hiscall',''), & option ('evemode',.true.,'e','',''), & option ('frequency',.true.,'f','rxfreq',''), & @@ -28,6 +29,7 @@ program msk144d2 option ('short',.false.,'s','enable Sh','') & ] t0=0.0 + ndepth=3 ntol=100 nrxfreq=1500 mycall='' @@ -35,11 +37,13 @@ program msk144d2 bShMsgs=.false. do - call getopt('d:ef:hm:n:s',long_options,c,optarg,narglen,nstat,noffset,nremain,.true.) + call getopt('c:d:ef:hm:n:s',long_options,c,optarg,narglen,nstat,noffset,nremain,.true.) if( nstat .ne. 0 ) then exit end if select case (c) + case ('c') + read (optarg(:narglen), *) ndepth case ('d') read (optarg(:narglen), *) hiscall case ('e') @@ -89,7 +93,7 @@ program msk144d2 do i=1,npts,7*512 ichunk=id2(i:i+7*1024-1) tsec=(i-1)/12000.0 - call mskrtd(ichunk,nutc,tsec,ntol,nrxfreq,line) + call mskrtd(ichunk,nutc,tsec,ntol,nrxfreq,ndepth,line) if( index(line,"^") .ne. 0 .or. index(line,"&") .ne. 0 ) then write(*,*) line endif diff --git a/lib/mskrtd.f90 b/lib/mskrtd.f90 index 8a725ca77..c24435094 100644 --- a/lib/mskrtd.f90 +++ b/lib/mskrtd.f90 @@ -1,4 +1,4 @@ -subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,line) +subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line) ! Real-time decoder for MSK144. ! Analysis block size = NZ = 7168 samples, t_block = 0.597333 s @@ -82,7 +82,7 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,line) endif enddo pavg=sum(pow)/8.0 - + ! Short ping decoder uses squared-signal spectrum to determine where to ! center a 3-frame analysis window and attempts to decode each of the ! 3 frames along with 2- and 3-frame averages. @@ -94,9 +94,15 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,line) goto 999 endif -! If short ping decoder doesn't find a decode, then 4-, 5-, and 7-frame averages -! spanning the first 7 frames of the block. - do iavg=1,NPATTERNS + +! If short ping decoder doesn't find a decode, +! Fast - try 4-frame averages only +! Normal - try 4- and 5-frame averages +! Deep - try 4-, 5- and 7-frame averages. + npat=NPATTERNS + if( ndepth .eq. 1 ) npat=2 + if( ndepth .eq. 2 ) npat=3 + do iavg=1,npat iavmask=iavpatterns(1:8,iavg) navg=sum(iavmask) deltaf=7.0/real(navg) ! search increment for frequency sync