Put back the original jtmsk_decode.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6714 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2016-06-01 11:20:33 +00:00
parent 968705cb9c
commit 311dcdf7b9

View File

@ -1,10 +1,10 @@
subroutine jtmsk_decode(id2,narg,line) subroutine jtmsk_decode(id2,narg,line)
! Calls the experimental decoder for JTMSK 72ms ldpc messages ! Decoder for JTMSK mode
parameter (NMAX=30*12000) parameter (NMAX=30*12000)
parameter (NFFTMAX=512*1024) parameter (NFFTMAX=512*1024)
parameter (NSPM=864) !Samples per JTMSK long message parameter (NSPM=1404) !Samples per JTMSK long message
integer*2 id2(0:NMAX) !Raw i*2 data, up to T/R = 30 s integer*2 id2(0:NMAX) !Raw i*2 data, up to T/R = 30 s
integer hist(0:32868) integer hist(0:32868)
real d(0:NMAX) !Raw r*4 data real d(0:NMAX) !Raw r*4 data
@ -54,58 +54,58 @@ subroutine jtmsk_decode(id2,narg,line)
!### Would it be better to set median rms to 1.0 ? !### Would it be better to set median rms to 1.0 ?
! d(0:npts-1)=d(0:npts-1)/rms !Normalize so that rms=1.0 ! d(0:npts-1)=d(0:npts-1)/rms !Normalize so that rms=1.0
call mskdt(d,npts,ty,yellow,nyel) call mskdt(d,npts,ty,yellow,nyel)
! do i=1,nyel
! print*,i,ty(i),yellow(i)
! enddo
nyel=min(nyel,5) nyel=min(nyel,5)
n=log(float(npts))/log(2.0) + 1.0 n=log(float(npts))/log(2.0) + 1.0
nfft=min(2**n,1024*1024) nfft=min(2**n,1024*1024)
call analytic(d,npts,nfft,c) !Convert to analytic signal and filter call analytic(d,npts,nfft,c) !Convert to analytic signal and filter
nafter=NSPM nbefore=NSPM
nafter=4*NSPM
! Process ping list (sorted by S/N) from top down. ! Process ping list (sorted by S/N) from top down.
! do n=1,nyel
do n=1,nyel do n=1,nyel
ia=ty(n)*12000.0 - NSPM/2 ia=ty(n)*12000.0 - nbefore
if(ia.lt.1) ia=1 if(ia.lt.1) ia=1
ib=ia + 2*nafter-1 ib=ia + nafter
if(ib.gt.NFFTMAX) ib=NFFTMAX if(ib.gt.NFFTMAX) ib=NFFTMAX
iz=ib-ia+1 iz=ib-ia+1
cdat2(1:iz)=c(ia:ib) !Select nlen complex samples cdat2(1:iz)=c(ia:ib) !Select nlen complex samples
! write(*,*) ty(1),ia,ib,iz
ja=ia/NSPM + 1 ja=ia/NSPM + 1
jb=ib/NSPM jb=ib/NSPM
t0=ia/12000.0 t0=ia/12000.0
! do itry=1,21
do itry=1,1 do itry=1,21
idf1=(itry/2) * 50 idf1=(itry/2) * 50
if(mod(itry,2).eq.1) idf1=-idf1 if(mod(itry,2).eq.1) idf1=-idf1
if(abs(idf1).gt.ntol) exit if(abs(idf1).gt.ntol) exit
fpk=idf1 + nrxfreq fpk=idf1 + nrxfreq
call tweak1(cdat2,iz,1500.0-fpk,cdat) call tweak1(cdat2,iz,1500.0-fpk,cdat)
call syncmsk144(cdat,iz,jpk,ipk,idf,rmax,snr,metric,msg,freq) call syncmsk(cdat,iz,jpk,ipk,idf,rmax,snr,metric,msg)
if(metric.eq.-9999) cycle !No output if no significant sync if(metric.eq.-9999) cycle !No output if no significant sync
if(msg(1:1).eq.' ') call jtmsk_short(cdat,iz,narg,tbest,idfpk,msg) if(msg(1:1).eq.' ') call jtmsk_short(cdat,iz,narg,tbest,idfpk,msg)
if(msg(1:1).eq.'<' .and. naggressive.eq.0 .and. & if(msg(1:1).eq.'<' .and. naggressive.eq.0 .and. &
narg(13)/8.ne.narg(12)) msg=' ' narg(13)/8.ne.narg(12)) msg=' '
if(msg(1:1).ne.' ') then if(msg(1:1).ne.' ') then
! if(msg.ne.msg0) then if(msg.ne.msg0) then
nline=nline+1 nline=nline+1
nsnr0=-99 nsnr0=-99
! endif endif
freq=fpk+idf
t0=(ia+jpk)/12000.0 t0=(ia+jpk)/12000.0
y=10.0**(0.1*(yellow(n)-1.5)) y=10.0**(0.1*(yellow(n)-1.5))
nsnr=max(-5,nint(db(y))) nsnr=max(-5,nint(db(y)))
! if(nsnr.gt.nsnr0 .and. nline.gt.0) then if(nsnr.gt.nsnr0 .and. nline.gt.0) then
call rectify_msk(cdat2(jpk:jpk+NSPM-1),msg,narg(13),freq2)
freq=freq2
if(msg(1:1).eq.'<') freq=freq2+idfpk
!### Check freq values !!!
write(line(nline),1020) nutc,nsnr,t0,nint(freq),msg write(line(nline),1020) nutc,nsnr,t0,nint(freq),msg
1020 format(i6.6,i4,f5.1,i5,' & ',a22) 1020 format(i6.6,i4,f5.1,i5,' & ',a22)
nsnr0=nsnr nsnr0=nsnr
! go to 900 go to 900
! endif endif
msg0=msg msg0=msg
! if(nline.ge.maxlines) go to 900 if(nline.ge.maxlines) go to 900
endif endif
enddo enddo
! print*,'c',nutc,n,nint(yellow(n)-4.0),freq,freq2 ! print*,'c',nutc,n,nint(yellow(n)-4.0),freq,freq2