Revert three jt4 files to svn revision 6701.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6720 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-06-03 12:48:16 +00:00
parent 2f2fd030e1
commit a68384689f
3 changed files with 35 additions and 72 deletions

View File

@ -3,7 +3,6 @@ module jt4
integer iutc(MAXAVE) integer iutc(MAXAVE)
integer nfsave(MAXAVE) integer nfsave(MAXAVE)
integer listutc(10) integer listutc(10)
logical ok(MAXAVE)
real ppsave(207,7,MAXAVE) !Accumulated data for message averaging real ppsave(207,7,MAXAVE) !Accumulated data for message averaging
real rsymbol(207,7) real rsymbol(207,7)
real dtsave(MAXAVE) real dtsave(MAXAVE)

View File

@ -114,6 +114,7 @@ contains
real ccfblue(-5:540) !CCF in time real ccfblue(-5:540) !CCF in time
real ccfred(-224:224) !CCF in frequency real ccfred(-224:224) !CCF in frequency
real ps0(450)
! real z(458,65) ! real z(458,65)
logical first,prtavg logical first,prtavg
@ -123,7 +124,7 @@ contains
data first/.true./,nutc0/-999/,nfreq0/-999999/ data first/.true./,nutc0/-999/,nfreq0/-999999/
save save
if(first .or. nclearave) then if(first) then
nsave=0 nsave=0
first=.false. first=.false.
blank=' ' blank=' '
@ -154,15 +155,15 @@ contains
! Attempt to synchronize: look for sync pattern, get DF and DT. ! Attempt to synchronize: look for sync pattern, get DF and DT.
call timer('sync4 ',0) call timer('sync4 ',0)
call sync4(dat,npts,ntol,1,nfqso,4,mode4,minw+1,dtx,dfx, & mousedf=nint(nfqso + 1.5*4.375*mode4 - 1270.46)
snrx,snrsync,ccfblue,ccfred,flip,width) call sync4(dat,npts,ntol,1,MouseDF,4,mode4,minw+1,dtx,dfx, &
snrx,snrsync,ccfblue,ccfred,flip,width,ps0)
sync=snrsync sync=snrsync
dtxz=dtx-0.8 dtxz=dtx-0.8
nfreqz=dfx + 1270.46 - 1.5*4.375*mode4 nfreqz=dfx + 1270.46 - 1.5*4.375*mode4
call timer('sync4 ',1) call timer('sync4 ',1)
snrx=db(sync) - 26. snrx=db(sync) - 26.
if(snrx.lt.-26.0) snrx=-26.0
nsnr=nint(snrx) nsnr=nint(snrx)
if(sync.lt.syncmin) then if(sync.lt.syncmin) then
if (associated (this%decode_callback)) then if (associated (this%decode_callback)) then
@ -226,8 +227,8 @@ contains
nsave=mod(nsave-1,64)+1 nsave=mod(nsave-1,64)+1
call timer('avg4 ',0) call timer('avg4 ',0)
call this%avg4(nutc,sync,dtx,flip,nfreq,mode4,ntol,ndepth,neme, & call this%avg4(nutc,sync,dtx,flip,nfreq,mode4,ntol,ndepth,neme, &
nclearave,mycall,hiscall,hisgrid,nfanoave,avemsg,qave, & mycall,hiscall,hisgrid,nfanoave,avemsg,qave,deepave,ich, &
deepave,ich,ndeepave) ndeepave)
call timer('avg4 ',1) call timer('avg4 ',1)
endif endif
@ -284,8 +285,7 @@ contains
end subroutine wsjt4 end subroutine wsjt4
subroutine avg4(this,nutc,snrsync,dtxx,flip,nfreq,mode4,ntol,ndepth,neme, & subroutine avg4(this,nutc,snrsync,dtxx,flip,nfreq,mode4,ntol,ndepth,neme, &
nclearave, mycall,hiscall,hisgrid,nfanoave,avemsg,qave,deepave, & mycall,hiscall,hisgrid,nfanoave,avemsg,qave,deepave,ichbest,ndeepave)
ichbest,ndeepave)
! Decodes averaged JT4 data ! Decodes averaged JT4 data
@ -297,14 +297,14 @@ contains
character*1 csync,cused(64) character*1 csync,cused(64)
real sym(207,7) real sym(207,7)
integer iused(64) integer iused(64)
logical first,nclearave logical first
data first/.true./ data first/.true./
save save
if(first .or. nclearave) then if(first) then
iutc=-1 iutc=-1
nfsave=0 nfsave=0
dtdiff=0.25 dtdiff=0.2
first=.false. first=.false.
endif endif
@ -320,33 +320,19 @@ contains
flipsave(nsave)=flip flipsave(nsave)=flip
ppsave(1:207,1:7,nsave)=rsymbol(1:207,1:7) ppsave(1:207,1:7,nsave)=rsymbol(1:207,1:7)
10 dtsum=0. 10 sym=0.
nsum=0
ok=.false.
do i=1,nsave
if(iutc(i).lt.0) cycle
if(mod(iutc(i),2).ne.mod(nutc,2)) cycle !Use only same sequence
if(abs(nfreq-nfsave(i)).gt.ntol) cycle !Freq must match
if(flip.ne.flipsave(i)) cycle !Sync (*/#) must match
if(abs(dtxx-dtsave(i)).gt.2*dtdiff) cycle !Pk-to-pk DT range < 2*dtdiff
dtsum=dtsum+dtsave(i)
nsum=nsum+1
ok(i)=.true.
enddo
dtave=0.
if(nsum.ge.1) dtave=dtsum/nsum
sym=0.
syncsum=0. syncsum=0.
dtsum=0. dtsum=0.
nfsum=0 nfsum=0
nsum=0 nsum=0
do i=1,nsave
do i=1,64
cused(i)='.' cused(i)='.'
dttest=dtsave(i)-dtave if(iutc(i).lt.0) cycle
if(.not.ok(i)) cycle if(mod(iutc(i),2).ne.mod(nutc,2)) cycle !Use only same sequence
if(abs(dttest).gt.dtdiff) cycle !DT must match if(abs(dtxx-dtsave(i)).gt.dtdiff) cycle !DT must match
if(abs(nfreq-nfsave(i)).gt.ntol) cycle !Freq must match
if(flip.ne.flipsave(i)) cycle !Sync (*/#) must match
sym(1:207,1:7)=sym(1:207,1:7) + ppsave(1:207,1:7,i) sym(1:207,1:7)=sym(1:207,1:7) + ppsave(1:207,1:7,i)
syncsum=syncsum + syncsave(i) syncsum=syncsum + syncsave(i)
dtsum=dtsum + dtsave(i) dtsum=dtsum + dtsave(i)

View File

@ -1,5 +1,5 @@
subroutine sync4(dat,jz,ntol,NFreeze,nfqso,mode,mode4,minwidth, & subroutine sync4(dat,jz,ntol,NFreeze,MouseDF,mode,mode4,minwidth, &
dtx,dfx,snrx,snrsync,ccfblue,ccfred1,flip,width) dtx,dfx,snrx,snrsync,ccfblue,ccfred1,flip,width,ps0)
! Synchronizes JT4 data, finding the best-fit DT and DF. ! Synchronizes JT4 data, finding the best-fit DT and DF.
@ -9,6 +9,7 @@ subroutine sync4(dat,jz,ntol,NFreeze,nfqso,mode,mode4,minwidth, &
integer ntol !Range of DF search integer ntol !Range of DF search
real dat(jz) real dat(jz)
real psavg(NHMAX) !Average spectrum of whole record real psavg(NHMAX) !Average spectrum of whole record
real ps0(450) !Avg spectrum for plotting
real s2(NHMAX,NSMAX) !2d spectrum, stepped by half-symbols real s2(NHMAX,NSMAX) !2d spectrum, stepped by half-symbols
real ccfblue(-5:540) !CCF with pseudorandom sequence real ccfblue(-5:540) !CCF with pseudorandom sequence
real ccfred(-450:450) !Peak of ccfblue, as function of freq real ccfred(-450:450) !Peak of ccfblue, as function of freq
@ -22,6 +23,9 @@ subroutine sync4(dat,jz,ntol,NFreeze,nfqso,mode,mode4,minwidth, &
data nch/1,2,4,9,18,36,72/ data nch/1,2,4,9,18,36,72/
save save
! write(*,3001) 'A',ntol,nfreeze,mousedf,mode,mode4,minwidth
!3001 format(a1,6i6)
! Do FFTs of twice symbol length, stepped by half symbols. Note that ! Do FFTs of twice symbol length, stepped by half symbols. Note that
! we have already downsampled the data by factor of 2. ! we have already downsampled the data by factor of 2.
nsym=207 nsym=207
@ -42,21 +46,18 @@ subroutine sync4(dat,jz,ntol,NFreeze,nfqso,mode,mode4,minwidth, &
nsmo=min(10*mode4,150) nsmo=min(10*mode4,150)
call flat1b(psavg,nsmo,s2,nh,nsteps,NHMAX,NSMAX) !Flatten spectra call flat1b(psavg,nsmo,s2,nh,nsteps,NHMAX,NSMAX) !Flatten spectra
if(mode4.ge.9) then if(mode4.ge.9) call smo(psavg,nh,tmp,mode4/4)
call smo(psavg,nh,tmp,mode4/4)
psavg=psavg/(mode4/4.0) i0=132
do j=1,nsteps do i=1,450
call smo(s2(1,j),nh,tmp,mode4/4) ps0(i)=5.0*(psavg(i0+2*i) + psavg(i0+2*i+1) - 2.0)
enddo enddo
s2=s2/(mode4/4.0)
endif
! Set freq and lag ranges ! Set freq and lag ranges
famin=200.0 + 3*mode4*df famin=200.0 + 3*mode4*df
fbmax=2700.0 - 3*mode4*df fbmax=2700.0 - 3*mode4*df
fa=famin fa=famin
fb=fbmax fb=fbmax
mousedf=nint(nfqso + 1.5*4.375*mode4 - 1270.46)
if(NFreeze.eq.1) then if(NFreeze.eq.1) then
fa=max(famin,1270.46+MouseDF-ntol) fa=max(famin,1270.46+MouseDF-ntol)
fb=min(fbmax,1270.46+MouseDF+ntol) fb=min(fbmax,1270.46+MouseDF+ntol)
@ -76,23 +77,21 @@ subroutine sync4(dat,jz,ntol,NFreeze,nfqso,mode,mode4,minwidth, &
ccfred=0. ccfred=0.
jmax=-1000 jmax=-1000
jmin=1000 jmin=1000
! rewind 83
do ich=minwidth,7 !Find best width do ich=minwidth,7 !Find best width
kz=nch(ich)/2
savered=.false. savered=.false.
do i=ia,ib !Find best frequency channel for CCF do i=ia+kz,ib-kz !Find best frequency channel for CCF
call xcor4(s2,i,nsteps,nsym,lag1,lag2,ich,mode4,ccfblue,ccf0, & call xcor4(s2,i,nsteps,nsym,lag1,lag2,ich,mode4,ccfblue,ccf0, &
lagpk0,flip) lagpk0,flip)
j=i-i0 + 3*mode4 j=i-i0 + 3*mode4
if(j.ge.-372 .and. j.le.372) then if(j.ge.-372 .and. j.le.372) then
ccfred(j)=ccf0 ccfred(j)=ccf0
! write(83,4001) i*df,ccf0
!4001 format(f10.1,e12.3)
jmax=max(j,jmax) jmax=max(j,jmax)
jmin=min(j,jmin) jmin=min(j,jmin)
endif endif
! Normalize ccfblue so that baseline rms = 1.0 ! Find rms of the CCF, without main peak
call slope(ccfblue(lag1),lag2-lag1+1,lagpk0-lag1+1.0) call slope(ccfblue(lag1),lag2-lag1+1,lagpk0-lag1+1.0)
sync=abs(ccfblue(lagpk0)) sync=abs(ccfblue(lagpk0))
@ -174,28 +173,7 @@ subroutine sync4(dat,jz,ntol,NFreeze,nfqso,mode,mode4,minwidth, &
enddo enddo
width=(i-i1)*df width=(i-i1)*df
! rewind 80
! rewind 81
! rewind 82
! do i=1,NHMAX
! write(80,3004) i*df,psavg(i),sum(s2(i,1:nsteps))
!3004 format(f10.1,2e12.3)
! enddo
! do i=jmin,jmax
! write(81,3001) i,ccfred1(i),width
!3001 format(i5,2f10.3)
! enddo
! do i=lag1,lag2
! write(82,3002) i,ccfblue(i)
!3002 format(i5,f10.3)
! enddo
! flush(80)
! flush(81)
! flush(82)
! flush(83)
return return
end subroutine sync4 end subroutine sync4
include 'flat1b.f90'