mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-23 12:48:40 -05:00
1. New routine "ftpeak65" for peaking up in frequency and time, and for AFC.
2. Removed the "itry" loop in wsjt65, speeding up JT65 decodes. 3. A dded Deep Search to avemsg65. 4. Changed "Decoding" menu accordingly. Karn RS decoder used only if KV decoder not present. 5. Removed sort from deep65; find 1st and 2nd largest values directly. 6. Fixed Makefile.win. (Still need to fix *nix Makefile.) git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@212 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
47d59acb8f
commit
5993b3952d
@ -38,7 +38,8 @@ SRCS2F77 = wsjt1.f avesp2.f bzap.f spec441.f spec2d.f mtdecode.f \
|
||||
sync65.f unpackcall.f unpackgrid.f unpackmsg.f unpacktext.f \
|
||||
xcor.f xfft.f xfft2.f wsjt65.f astro.f azdist.f coord.f dcoord.f \
|
||||
deg2grid.f dot.f ftsky.f geocentric.f GeoDist.f grid2deg.f \
|
||||
moon2.f MoonDop.f sun.f toxyz.f pfxdump.f
|
||||
moon2.f MoonDop.f sun.f toxyz.f pfxdump.f \
|
||||
ftpeak65.f fil651.f fil652.f fil653.f symsync65.f
|
||||
|
||||
SRCS2C = resample.c ptt.c igray.c wrapkarn.c
|
||||
|
||||
|
24
avemsg65.f
24
avemsg65.f
@ -1,9 +1,12 @@
|
||||
subroutine avemsg65(mseg,mode65,ndepth,decoded,nused,ns,ncount)
|
||||
subroutine avemsg65(mseg,mode65,ndepth,decoded,nused,
|
||||
+ nq1,nq2,neme,nsked,flip,mycall,hiscall,hisgrid,qual,
|
||||
+ ns,ncount)
|
||||
|
||||
C Decodes averaged JT65 data for the specified segment (mseg=1 or 2).
|
||||
|
||||
parameter (MAXAVE=120) !Max avg count is 120
|
||||
character decoded*22
|
||||
character decoded*22,deepmsg*22
|
||||
character mycall*12,hiscall*12,hisgrid*6
|
||||
real s3(64,63)
|
||||
common/ave/ppsave(64,63,MAXAVE),nflag(MAXAVE),nsave,iseg(MAXAVE)
|
||||
|
||||
@ -12,6 +15,8 @@ C and the number of spectra flagged as good.
|
||||
|
||||
nused=0
|
||||
ns=0
|
||||
nqual=0
|
||||
deepmsg=' '
|
||||
do i=1,nsave
|
||||
if(iseg(i).eq.mseg) then
|
||||
ns=ns+1
|
||||
@ -32,13 +37,24 @@ C Compute the average of all flagged spectra for this segment.
|
||||
|
||||
nadd=nused*mode65
|
||||
call extract(s3,nadd,ndepth,ncount,decoded) !Extract the message
|
||||
100 if(nused.lt.1.or.ncount.lt.0) decoded=' '
|
||||
if(ncount.lt.0) decoded=' '
|
||||
|
||||
nqual=0
|
||||
C Possibly should pass nadd=nused, also:
|
||||
if(ndepth.ge.3) then
|
||||
call deep65(s3,mode65,neme,nsked,flip,
|
||||
+ mycall,hiscall,hisgrid,deepmsg,qual)
|
||||
nqual=qual
|
||||
if(nqual.lt.nq1) deepmsg=' '
|
||||
if(nqual.ge.nq1 .and. nqual.lt.nq2) deepmsg(19:19)='?'
|
||||
endif
|
||||
if(ncount.lt.0) decoded=deepmsg
|
||||
|
||||
C Suppress "birdie messages":
|
||||
if(decoded(1:7).eq.'000AAA ') decoded=' '
|
||||
if(decoded(1:7).eq.'0L6MWK ') decoded=' '
|
||||
|
||||
! print*,mseg,nused,' ',decoded
|
||||
100 if(nused.lt.1) decoded=' '
|
||||
|
||||
return
|
||||
end
|
||||
|
28
decode65.f
28
decode65.f
@ -1,5 +1,5 @@
|
||||
subroutine decode65(dat,npts,dtx,dfx,flip,ndepth,neme,nsked,
|
||||
+ mycall,hiscall,hisgrid,mode65,lsave,ftrack,decoded,ncount,
|
||||
+ nsnr,mycall,hiscall,hisgrid,mode65,nafc,decoded,ncount,
|
||||
+ deepmsg,qual)
|
||||
|
||||
C Decodes JT65 data, assuming that DT and DF have already been determined.
|
||||
@ -8,7 +8,6 @@ C Decodes JT65 data, assuming that DT and DF have already been determined.
|
||||
real s2(77,126)
|
||||
real s3(64,63)
|
||||
real ftrack(126)
|
||||
logical lsave
|
||||
character decoded*22,deepmsg*22
|
||||
character mycall*12,hiscall*12,hisgrid*6
|
||||
include 'avecom.h'
|
||||
@ -19,9 +18,9 @@ C Decodes JT65 data, assuming that DT and DF have already been determined.
|
||||
istart=nint(dtx/dt) !Start index for synced FFTs
|
||||
nsym=126
|
||||
|
||||
C Compute FFTs of symbols
|
||||
C Compute spectra of the channel symbols
|
||||
f0=1270.46 + dfx
|
||||
call spec2d65(dat,npts,nsym,flip,istart,f0,ftrack,mode65,s2)
|
||||
call spec2d65(dat,npts,nsym,flip,istart,f0,ftrack,nafc,mode65,s2)
|
||||
|
||||
do j=1,63
|
||||
k=mdat(j) !Points to data symbol
|
||||
@ -33,9 +32,9 @@ C Compute FFTs of symbols
|
||||
nadd=mode65
|
||||
|
||||
call extract(s3,nadd,ndepth,ncount,decoded) !Extract the message
|
||||
c if(lsave) call deep65(s3,mode65,neme,nsked,flip,mycall,hiscall,hisgrid,
|
||||
call deep65(s3,mode65,neme,nsked,flip,mycall,hiscall,hisgrid,
|
||||
+ deepmsg,qual)
|
||||
qual=0.
|
||||
if(ndepth.ge.1) call deep65(s3,mode65,neme,
|
||||
+ nsked,flip,mycall,hiscall,hisgrid,deepmsg,qual)
|
||||
|
||||
if(ncount.lt.0) decoded=' '
|
||||
|
||||
@ -43,15 +42,12 @@ C Suppress "birdie messages":
|
||||
if(decoded(1:7).eq.'000AAA ') decoded=' '
|
||||
if(decoded(1:7).eq.'0L6MWK ') decoded=' '
|
||||
|
||||
C If ncount>=0 or if this is the "0,0" run, save spectrum in ppsave:
|
||||
C Q: should ftrack be used here?
|
||||
100 if((ncount.ge.0 .or. lsave)) then
|
||||
do j=1,63
|
||||
k=mdat(j)
|
||||
if(flip.lt.0.0) k=mdat2(j)
|
||||
call move(s2(8,k),ppsave(1,j,nsave),64)
|
||||
enddo
|
||||
endif
|
||||
C Save symbol spectra for possible decoding of average.
|
||||
do j=1,63
|
||||
k=mdat(j)
|
||||
if(flip.lt.0.0) k=mdat2(j)
|
||||
call move(s2(8,k),ppsave(1,j,nsave),64)
|
||||
enddo
|
||||
|
||||
return
|
||||
end
|
||||
|
29
deep65.F
29
deep65.F
@ -3,7 +3,6 @@
|
||||
|
||||
parameter (MAXCALLS=7000,MAXRPT=63)
|
||||
real s3(64,63)
|
||||
real pp(2*MAXCALLS + 2 + MAXRPT)
|
||||
character callsign*12,grid*4,message*22,hisgrid*6,c*1,ceme*3
|
||||
character*12 mycall,hiscall
|
||||
character*22 decoded,deepmsg
|
||||
@ -75,6 +74,7 @@
|
||||
mz=1
|
||||
if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1 .and.
|
||||
+ flip.gt.0.0) mz=MAXRPT+1
|
||||
C Test for messages with MyCall + HisCall + report
|
||||
do m=1,mz
|
||||
if(m.gt.1) grid=rpt(m-1)
|
||||
if(j3.lt.1 .and.j4.lt.1)
|
||||
@ -101,44 +101,41 @@
|
||||
enddo
|
||||
|
||||
p1=-1.e30
|
||||
ip1=0
|
||||
p2=-1.e30
|
||||
n=0
|
||||
do k=1,ntot
|
||||
C If sync=OOO, no CQ messages
|
||||
if(flip.lt.0.0 .and. testmsg(k)(1:3).eq.'CQ ') go to 30
|
||||
sum=0.
|
||||
ref=ref0
|
||||
nhard=0
|
||||
do j=1,63
|
||||
i=ncode(j,k)+1
|
||||
sum=sum + s3(i,j)
|
||||
if(i.eq.mrs(j)) then
|
||||
ref=ref - s3(i,j) + s3(mrs2(j),j)
|
||||
nhard=nhard+1
|
||||
endif
|
||||
enddo
|
||||
p=sum/ref
|
||||
! p=sum/ref0
|
||||
n=n+1
|
||||
pp(n)=p
|
||||
if(p.gt.p1) then
|
||||
if(p1.gt.p2) then
|
||||
p2=p1
|
||||
ip2=ip1
|
||||
endif
|
||||
p1=p
|
||||
ip1=k
|
||||
sum1=sum
|
||||
ref1=ref
|
||||
nhard1=nhard
|
||||
else if(p.gt.p2 .and. p.lt.p1) then
|
||||
p2=p
|
||||
ip2=k
|
||||
endif
|
||||
30 enddo
|
||||
|
||||
ntot=n
|
||||
call sort(ntot,pp)
|
||||
do i=1,100
|
||||
if(pp(ntot-i).ne.pp(ntot)) go to 40
|
||||
enddo
|
||||
|
||||
40 if(mode65.eq.1) bias=max(1.12*pp(ntot-i),0.335)
|
||||
if(mode65.eq.2) bias=max(1.08*pp(ntot-i),0.405)
|
||||
if(mode65.eq.4) bias=max(1.04*pp(ntot-i),0.505)
|
||||
40 if(mode65.eq.1) bias=max(1.12*p2,0.335)
|
||||
if(mode65.eq.2) bias=max(1.08*p2,0.405)
|
||||
if(mode65.ge.4) bias=max(1.04*p2,0.505)
|
||||
|
||||
qual=100.0*(p1-bias)
|
||||
decoded=' '
|
||||
c=' '
|
||||
|
@ -20,12 +20,13 @@
|
||||
call interleave63(mrsym,-1)
|
||||
call interleave63(mrprob,-1)
|
||||
|
||||
ndec=0
|
||||
ndec=1
|
||||
nemax=30
|
||||
maxe=8
|
||||
if(ndepth.ge.2) ndec=1
|
||||
if(ndepth.eq.2) xlambda=13.0
|
||||
if(ndepth.eq.3) xlambda=15.0
|
||||
! if(ndepth.ge.2) ndec=1
|
||||
! if(ndepth.eq.2) xlambda=13.0
|
||||
! if(ndepth.eq.3) xlambda=15.0
|
||||
xlambda=15.0
|
||||
|
||||
if(ndec.eq.1) then
|
||||
call graycode(mr2sym,63,-1)
|
||||
|
67
fil651.f
Normal file
67
fil651.f
Normal file
@ -0,0 +1,67 @@
|
||||
subroutine fil651(d,n1,c,n2)
|
||||
|
||||
C FIR lowpass mixing filter designed with ScopeFIR. Real in, complex out.
|
||||
|
||||
C fsample = 5512.5 Hz
|
||||
C Ntaps = 31
|
||||
C fc = 1000 Hz
|
||||
C fstop = 1378.125 Hz
|
||||
C Ripple = 0.5 dB
|
||||
C Stop Atten = 50 dB
|
||||
C fmix = 1378.125 Hz
|
||||
C fout = 2706.25 Hz
|
||||
|
||||
parameter (NTAPS=31)
|
||||
parameter (NH=NTAPS/2)
|
||||
parameter (NDOWN=2) !Downsample ratio
|
||||
|
||||
real d(n1)
|
||||
complex c(*)
|
||||
|
||||
complex ck(-NH:NH)
|
||||
data ck/
|
||||
+ (-0.000000073578,-0.000859869243),
|
||||
+ ( 0.008518289457,-0.000000680308),
|
||||
+ ( 0.000000834309, 0.011250152594),
|
||||
+ (-0.001061705254, 0.000000072679),
|
||||
+ ( 0.000000875897, 0.013958392128),
|
||||
+ (-0.010047338711, 0.000000573160),
|
||||
+ ( 0.000000770320, 0.015003869984),
|
||||
+ (-0.025027880956, 0.000001142192),
|
||||
+ ( 0.000000285583, 0.007151700551),
|
||||
+ (-0.043634723888, 0.000001493512),
|
||||
+ (-0.000000478847,-0.016788108005),
|
||||
+ (-0.061886192046, 0.000001412144),
|
||||
+ (-0.000001258694,-0.073548459509),
|
||||
+ (-0.075261027462, 0.000000858668),
|
||||
+ (-0.000001749252,-0.306638863572),
|
||||
+ ( 0.419826269508, 0.000000000000),
|
||||
+ (-0.000001749252, 0.306638863572),
|
||||
+ (-0.075261027462,-0.000000858668),
|
||||
+ (-0.000001258694, 0.073548459509),
|
||||
+ (-0.061886192046,-0.000001412144),
|
||||
+ (-0.000000478847, 0.016788108005),
|
||||
+ (-0.043634723888,-0.000001493512),
|
||||
+ ( 0.000000285583,-0.007151700551),
|
||||
+ (-0.025027880956,-0.000001142192),
|
||||
+ ( 0.000000770320,-0.015003869984),
|
||||
+ (-0.010047338711,-0.000000573160),
|
||||
+ ( 0.000000875897,-0.013958392128),
|
||||
+ (-0.001061705254,-0.000000072679),
|
||||
+ ( 0.000000834309,-0.011250152594),
|
||||
+ ( 0.008518289457, 0.000000680308),
|
||||
+ (-0.000000073578, 0.000859869243)/
|
||||
|
||||
n2=(n1-NTAPS+NDOWN)/NDOWN
|
||||
k0=NH-NDOWN+1
|
||||
|
||||
do i=1,n2
|
||||
c(i)=0.
|
||||
k=k0 + NDOWN*i
|
||||
do j=-NH,NH
|
||||
c(i)=c(i) + d(j+k)*conjg(ck(j))
|
||||
enddo
|
||||
enddo
|
||||
|
||||
return
|
||||
end
|
44
fil652.f
Normal file
44
fil652.f
Normal file
@ -0,0 +1,44 @@
|
||||
subroutine fil652(c1,n1,c2,n2)
|
||||
|
||||
C FIR lowpass filter designed using ScopeFIR
|
||||
|
||||
C fsample = 2756.25 Hz
|
||||
C Ntaps = 31
|
||||
C fc = 500 Hz
|
||||
C fstop = 689.0625 Hz
|
||||
C Ripple = 0.5 dB
|
||||
C Stop Atten = 50 dB
|
||||
C fout = 1378.125 Hz
|
||||
|
||||
parameter (NTAPS=31)
|
||||
parameter (NH=NTAPS/2)
|
||||
parameter (NDOWN=2) !Downsample ratio
|
||||
complex c1(n1)
|
||||
complex c2(*)
|
||||
|
||||
C Filter coefficients:
|
||||
real a(-NH:NH)
|
||||
data a/
|
||||
+ -0.000859869246,-0.008518289484,-0.011250152625,-0.001061705256,
|
||||
+ 0.013958392156, 0.010047338728,-0.015003870003,-0.025027880982,
|
||||
+ 0.007151700557, 0.043634723913, 0.016788108012,-0.061886192062,
|
||||
+ -0.073548459520, 0.075261027466, 0.306638863577, 0.419826269508,
|
||||
+ 0.306638863577, 0.075261027466,-0.073548459520,-0.061886192062,
|
||||
+ 0.016788108012, 0.043634723913, 0.007151700557,-0.025027880982,
|
||||
+ -0.015003870003, 0.010047338728, 0.013958392156,-0.001061705256,
|
||||
+ -0.011250152625,-0.008518289484,-0.000859869246/
|
||||
|
||||
n2=(n1-NTAPS+NDOWN)/NDOWN
|
||||
k0=NH-NDOWN+1
|
||||
|
||||
C Loop over all output samples
|
||||
do i=1,n2
|
||||
c2(i)=0.
|
||||
k=k0 + NDOWN*i
|
||||
do j=-NH,NH
|
||||
c2(i)=c2(i) + c1(j+k)*a(j)
|
||||
enddo
|
||||
enddo
|
||||
|
||||
return
|
||||
end
|
49
fil653.f
Normal file
49
fil653.f
Normal file
@ -0,0 +1,49 @@
|
||||
subroutine fil653(c1,n1,c2,n2)
|
||||
|
||||
C FIR lowpass filter designed using ScopeFIR
|
||||
|
||||
C fsample = 1378.125 Hz
|
||||
C Ntaps = 45
|
||||
C fc = 100 Hz
|
||||
C fstop = 172.265625 Hz
|
||||
C Ripple = 0.5 dB
|
||||
C Stop Atten = 50 dB
|
||||
C fout = 172.265625 Hz
|
||||
C BW = 200 Hz
|
||||
|
||||
parameter (NTAPS=45)
|
||||
parameter (NH=NTAPS/2)
|
||||
parameter (NDOWN=4) !Downsample ratio
|
||||
complex c1(n1)
|
||||
complex c2(*)
|
||||
|
||||
C Filter coefficients:
|
||||
real a(-NH:NH)
|
||||
data a/
|
||||
+ -0.000005569862,-0.002503777832,-0.004040335617,-0.005717910288,
|
||||
+ -0.006153385485,-0.004446125293,-0.000305215272, 0.005557289511,
|
||||
+ 0.011329120672, 0.014496551280, 0.012703875898, 0.004837591829,
|
||||
+ -0.008060363689,-0.022474422302,-0.032964876083,-0.033575486327,
|
||||
+ -0.019743889907, 0.009895672340, 0.052467109908, 0.101031155027,
|
||||
+ 0.146073001698, 0.177927966814, 0.189427119395, 0.177927966814,
|
||||
+ 0.146073001698, 0.101031155027, 0.052467109908, 0.009895672340,
|
||||
+ -0.019743889907,-0.033575486327,-0.032964876083,-0.022474422302,
|
||||
+ -0.008060363689, 0.004837591829, 0.012703875898, 0.014496551280,
|
||||
+ 0.011329120672, 0.005557289511,-0.000305215272,-0.004446125293,
|
||||
+ -0.006153385485,-0.005717910288,-0.004040335617,-0.002503777832,
|
||||
+ -0.000005569862/
|
||||
|
||||
n2=(n1-NTAPS+NDOWN)/NDOWN
|
||||
k0=NH-NDOWN+1
|
||||
|
||||
C Loop over all output samples
|
||||
do i=1,n2
|
||||
c2(i)=0.
|
||||
k=k0 + NDOWN*i
|
||||
do j=-NH,NH
|
||||
c2(i)=c2(i) + c1(j+k)*a(j)
|
||||
enddo
|
||||
enddo
|
||||
|
||||
return
|
||||
end
|
157
ftpeak65.f
Normal file
157
ftpeak65.f
Normal file
@ -0,0 +1,157 @@
|
||||
subroutine ftpeak65(dat,jz,istart,f0,flip,pr,nafc,ftrack)
|
||||
|
||||
C Do the the JT65 "peakup" procedure in frequency and time; then
|
||||
C compute ftrack.
|
||||
|
||||
parameter (NMAX=30*11025)
|
||||
parameter (NS=1024)
|
||||
real dat(jz)
|
||||
real pr(126)
|
||||
real ftrack(126)
|
||||
complex c2(NMAX/2)
|
||||
complex c3(NMAX/4)
|
||||
complex c4(NMAX/16)
|
||||
complex c5(NMAX/64)
|
||||
complex c6(NMAX/64)
|
||||
complex z
|
||||
real s(NMAX/64)
|
||||
real ccf(-128:128)
|
||||
real c(-50:50,8)
|
||||
real*8 pha,dpha,twopi,dt,fsyncset
|
||||
|
||||
twopi=8*datan(1.d0)
|
||||
fsyncset=-300.d0
|
||||
dt=2.d0/11025.d0 !Input dt (WSJT has downsampled by 2)
|
||||
call fil651(dat,jz,c2,n2) !Filter and complex mix; rate 1/2
|
||||
dt=2.d0*dt !We're now downsampled by 4
|
||||
|
||||
dpha=twopi*dt*(f0-fsyncset) !Put sync tone at fsyncset
|
||||
pha=0.
|
||||
do i=1,n2
|
||||
pha=pha+dpha
|
||||
c2(i)=c2(i) * cmplx(cos(pha),-sin(pha))
|
||||
enddo
|
||||
|
||||
call fil652(c2,n2,c3,n3) !Low-pass at +/- 500 Hz; rate 1/2
|
||||
dt=2.d0*dt !Down by 8
|
||||
|
||||
dpha=twopi*dt*fsyncset !Mix sync tone to f=0
|
||||
pha=0.
|
||||
do i=1,n3
|
||||
pha=pha+dpha
|
||||
c3(i)=c3(i) * cmplx(cos(pha),-sin(pha))
|
||||
enddo
|
||||
|
||||
call fil653(c3,n3,c4,n4) !Low-pass at +/- 100 Hz; rate 1/4
|
||||
dt=4.d0*dt !Down by 32
|
||||
|
||||
call fil653(c4,n4,c5,n5) !Low-pass at +/- 25 Hz; rate 1/4
|
||||
dt=4.d0*dt !Down by 128
|
||||
|
||||
C Use f0 and istart (as found by sync65) and do CCFs against the
|
||||
C pr(126) array to get improved symbol synchronization.
|
||||
C NB: if istart is increased by 64, kpk will decrease by 1.
|
||||
|
||||
k0=nint(istart/64.0 - 7.0)
|
||||
call symsync65(c5,n5,k0,s,flip,pr,16,kpk,ccf,smax)
|
||||
|
||||
C Fix up the value of istart. (The -1 is empirical.)
|
||||
istart=istart + 64.0*(kpk-1.0)
|
||||
|
||||
C OK, we have symbol synchronization. Now find peak ccf value as a
|
||||
C function of DF, for each group of 16 symbols.
|
||||
|
||||
C What about using filter fil657?
|
||||
|
||||
df=0.25*11025.0/4096.0 !Oversample to get accurate peak
|
||||
idfmax=50
|
||||
iz=n5-31
|
||||
do idf=-idfmax,idfmax
|
||||
dpha=twopi*idf*df*dt
|
||||
pha=0.
|
||||
do i=1,iz
|
||||
pha=pha+dpha
|
||||
c6(i)=c5(i) * cmplx(cos(pha),-sin(pha))
|
||||
enddo
|
||||
|
||||
z=0.
|
||||
do i=1,32
|
||||
z=z + c6(i)
|
||||
enddo
|
||||
s(1)=real(z)*real(z) + aimag(z)*aimag(z)
|
||||
do i=33,n5
|
||||
z=z + c6(i) - c6(i-32)
|
||||
s(i-31)=real(z)*real(z) + aimag(z)*aimag(z)
|
||||
enddo
|
||||
|
||||
do n=1,8
|
||||
ia=nint((n-1)*126.0/8.0 + 1.0)
|
||||
ib=ia+15
|
||||
sum=0.
|
||||
do i=ia,ib
|
||||
j=32*(i-1) + k0 + kpk
|
||||
if(j.ge.1 .and. j.le.iz) sum=sum + flip*pr(i)*s(j)
|
||||
enddo
|
||||
c(idf,n)=sum/smax
|
||||
enddo
|
||||
enddo
|
||||
|
||||
C Get drift rate and compute ftrack.
|
||||
! call getfdot(c,nafc,ftrack)
|
||||
|
||||
jmax=0
|
||||
if(nafc.eq.1) jmax=25
|
||||
ssmax=0.
|
||||
do j=-jmax,jmax
|
||||
do i=-25,25
|
||||
ss=0.
|
||||
xj=j/7.0
|
||||
do n=1,8
|
||||
k=nint(i+(n-4.5)*xj)
|
||||
ss=ss + c(k,n)
|
||||
enddo
|
||||
if(ss.gt.ssmax) then
|
||||
ssmax=ss
|
||||
ipk=i
|
||||
jpk=j
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
|
||||
df=0.25*11025.0/4096.0
|
||||
dfreq=ipk*df
|
||||
fdot=jpk*df*60.0/(0.875*46.8)
|
||||
|
||||
do i=1,126
|
||||
ftrack(i)=dfreq + fdot*(46.8/60.0)*(i-63.5)/126.0
|
||||
enddo
|
||||
|
||||
pha=0.
|
||||
i0=k0 + kpk + 2000
|
||||
do i=1,iz
|
||||
k=nint(63.5 + (i-i0)/32.0)
|
||||
if(k.lt.1) k=1
|
||||
if(k.gt.126) k=126
|
||||
dpha=twopi*dt*ftrack(k)
|
||||
pha=pha+dpha
|
||||
c6(i)=c5(i) * cmplx(cos(pha),-sin(pha))
|
||||
enddo
|
||||
|
||||
z=0.
|
||||
do i=1,32
|
||||
z=z + c6(i)
|
||||
enddo
|
||||
s(1)=real(z)*real(z) + aimag(z)*aimag(z)
|
||||
do i=33,n5
|
||||
z=z + c6(i) - c6(i-32)
|
||||
s(i-31)=real(z)*real(z) + aimag(z)*aimag(z)
|
||||
enddo
|
||||
|
||||
sum=0.
|
||||
do i=1,126
|
||||
j=32*(i-1)+k0+kpk
|
||||
if(j.ge.1 .and. j.le.iz) sum=sum + flip*pr(i)*s(j)
|
||||
enddo
|
||||
|
||||
return
|
||||
end
|
11
spec2d65.f
11
spec2d65.f
@ -1,5 +1,5 @@
|
||||
subroutine spec2d65(dat,jz,nsym,flip,istart,f0,
|
||||
+ ftrack,mode65,s2)
|
||||
+ ftrack,nafc,mode65,s2)
|
||||
|
||||
C Computes the spectrum for each of 126 symbols.
|
||||
C NB: At this point, istart, f0, and ftrack are supposedly known.
|
||||
@ -7,7 +7,7 @@ C The JT65 signal has Sync bin + 2 guard bins + 64 data bins = 67 bins.
|
||||
C We add 5 extra bins at top and bottom for drift, making 77 bins in all.
|
||||
|
||||
parameter (NMAX=2048) !Max length of FFTs
|
||||
real dat(jz) !Raw data
|
||||
real dat(jz) !Raw data
|
||||
real s2(77,126) !Spectra of all symbols
|
||||
real s(77)
|
||||
real ref(77)
|
||||
@ -22,12 +22,19 @@ c complex work(NMAX)
|
||||
data twopi/6.28318530718d0/
|
||||
save
|
||||
|
||||
C Peak up in frequency and time, and compute ftrack.
|
||||
call ftpeak65(dat,jz,istart,f0,flip,pr,nafc,ftrack)
|
||||
|
||||
nfft=2048/mode65 !Size of FFTs
|
||||
nh=nfft/2
|
||||
dt=2.0/11025.0
|
||||
df=0.5*11025.0/nfft
|
||||
call zero(ps,77)
|
||||
k=istart-nfft
|
||||
|
||||
C NB: this could be done starting with array c3, in ftpeak65, instead
|
||||
C of the dat() array. Would save some time this way ...
|
||||
|
||||
do j=1,nsym
|
||||
call zero(s,77)
|
||||
do m=1,mode65
|
||||
|
13
sync65.f
13
sync65.f
@ -1,5 +1,5 @@
|
||||
subroutine sync65(dat,jz,DFTolerance,NFreeze,NAFC,MouseDF,
|
||||
+ dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width,ftrack)
|
||||
+ dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width)
|
||||
|
||||
C Synchronizes JT65 data, finding the best-fit DT and DF.
|
||||
C NB: at this stage, submodes ABC are processed in the same way.
|
||||
@ -16,7 +16,6 @@ C NB: at this stage, submodes ABC are processed in the same way.
|
||||
real ccfred(-224:224) !Peak of ccfblue, as function of freq
|
||||
real tmp(450)
|
||||
integer itry(100)
|
||||
real ftrack(126)
|
||||
save
|
||||
|
||||
C Do FFTs of symbol length, stepped by half symbols. Note that we have
|
||||
@ -95,15 +94,6 @@ C If we found nothing with snrx > -30 dB, take the best sync that *was* found.
|
||||
flippk=flippk2
|
||||
endif
|
||||
|
||||
C Generate frequency-tracking information
|
||||
if(NAFC.eq.1) then
|
||||
call afc65(s2,ipk,lagpk,flippk,ftrack)
|
||||
else
|
||||
do j=1,126
|
||||
ftrack(j)=0.
|
||||
enddo
|
||||
endif
|
||||
|
||||
C Peak up in frequency to fraction of channel
|
||||
base=0.25*(psavg(ipk-3)+psavg(ipk-2)+psavg(ipk+2)+psavg(ipk+3))
|
||||
! call peakup(psavg(ipk-1),psavg(ipk),psavg(ipk+1),dx)
|
||||
@ -177,4 +167,3 @@ C Compute width of sync tone to outermost -3 dB points
|
||||
return
|
||||
end
|
||||
|
||||
include 'afc65.f'
|
||||
|
20
wsjt.py
20
wsjt.py
@ -1,4 +1,4 @@
|
||||
#------------------------------------------------------------------ WSJT
|
||||
#------------------------------------------------------------------- WSJT
|
||||
from Tkinter import *
|
||||
from tkFileDialog import *
|
||||
import Pmw
|
||||
@ -64,7 +64,6 @@ mode=StringVar()
|
||||
mode.set("")
|
||||
mrudir=os.getcwd()
|
||||
nafc=IntVar()
|
||||
naggressive=IntVar()
|
||||
naz=0
|
||||
ndepth=IntVar()
|
||||
nel=0
|
||||
@ -1500,7 +1499,6 @@ def update():
|
||||
Audio.gcom2.neme=neme.get()
|
||||
Audio.gcom2.ndepth=ndepth.get()
|
||||
Audio.gcom2.nsked=nsked.get()
|
||||
Audio.gcom2.naggressive=naggressive.get()
|
||||
try:
|
||||
Audio.gcom2.idinterval=options.IDinterval.get()
|
||||
except:
|
||||
@ -1602,12 +1600,16 @@ decodemenu.FSK441=Menu(decodemenu,tearoff=0)
|
||||
decodemenu.FSK441.add_checkbutton(label='No shorthands',variable=nosh441)
|
||||
decodemenu.JT65=Menu(decodemenu,tearoff=0)
|
||||
decodemenu.JT65.add_checkbutton(label='Only EME calls',variable=neme)
|
||||
decodemenu.JT65.add_checkbutton(label='Aggressive',variable=naggressive)
|
||||
decodemenu.JT65.add_checkbutton(label='No Shorthands if Tx 1',variable=noshjt65)
|
||||
decodemenu.JT65.add_separator()
|
||||
decodemenu.JT65.add_radiobutton(label = 'Fast', variable=ndepth, value=1)
|
||||
decodemenu.JT65.add_radiobutton(label = 'Normal', variable=ndepth, value=2)
|
||||
decodemenu.JT65.add_radiobutton(label = 'Exhaustive', variable=ndepth, value=3)
|
||||
decodemenu.JT65.add_radiobutton(label = 'No Deep Search',
|
||||
variable=ndepth, value=0)
|
||||
decodemenu.JT65.add_radiobutton(label = 'Normal Deep Search',
|
||||
variable=ndepth, value=1)
|
||||
decodemenu.JT65.add_radiobutton(label = 'Aggressive Deep Search',
|
||||
variable=ndepth, value=2)
|
||||
decodemenu.JT65.add_radiobutton(label ='Include Average in Aggressive Deep Search',
|
||||
variable=ndepth, value=3)
|
||||
decodemenu.add_cascade(label = 'FSK441',menu=decodemenu.FSK441)
|
||||
decodemenu.add_cascade(label = 'JT65',menu=decodemenu.JT65)
|
||||
|
||||
@ -1965,7 +1967,7 @@ ldate.after(100,update)
|
||||
lauto=0
|
||||
isync=1
|
||||
ntx.set(1)
|
||||
ndepth.set(2)
|
||||
ndepth.set(1)
|
||||
|
||||
import options
|
||||
options.defaults()
|
||||
@ -2079,7 +2081,6 @@ try:
|
||||
elif key == 'Sked': nsked.set(value)
|
||||
elif key == 'NoSh441': nosh441.set(value)
|
||||
elif key == 'NoShJT65': noshjt65.set(value)
|
||||
elif key == 'Aggressive': naggressive.set(value)
|
||||
elif key == 'NEME': neme.set(value)
|
||||
elif key == 'NDepth': ndepth.set(value)
|
||||
elif key == 'Debug': ndebug.set(value)
|
||||
@ -2174,7 +2175,6 @@ f.write("NAFC " + str(nafc.get()) + "\n")
|
||||
f.write("Sked " + str(nsked.get()) + "\n")
|
||||
f.write("NoSh441 " + str(nosh441.get()) + "\n")
|
||||
f.write("NoShJT65 " + str(noshjt65.get()) + "\n")
|
||||
f.write("Aggressive " + str(naggressive.get()) + "\n")
|
||||
f.write("NEME " + str(neme.get()) + "\n")
|
||||
f.write("NDepth " + str(ndepth.get()) + "\n")
|
||||
f.write("Debug " + str(ndebug.get()) + "\n")
|
||||
|
2
wsjt1.F
2
wsjt1.F
@ -198,7 +198,7 @@ C Intentionally degrade SNR by -nclip dB.
|
||||
! Offset data by about 1 s.
|
||||
if(jz.ge.126*2048) call wsjt65(dat(4097),jz-4096,cfile6,
|
||||
+ NClearAve,MinSigdB,DFTolerance,NFreeze,NAFC,mode65,Nseg,
|
||||
+ MouseDF,NAgain,naggressive,ndepth,neme,nsked,
|
||||
+ MouseDF,NAgain,ndepth,neme,nsked,
|
||||
+ mycall,hiscall,hisgrid,lumsg,lcum,nspecial,ndf,
|
||||
+ nstest,dfsh,iderrsh,idriftsh,snrsh,
|
||||
+ NSyncOK,ccf,psavg,ndiag,nwsh)
|
||||
|
105
wsjt65.f
105
wsjt65.f
@ -1,6 +1,6 @@
|
||||
subroutine wsjt65(dat,npts,cfile6,NClearAve,MinSigdB,
|
||||
+ DFTolerance,NFreeze,NAFC,mode65,Nseg,MouseDF,NAgain,
|
||||
+ naggressive,ndepth,neme,nsked,mycall,hiscall,hisgrid,
|
||||
+ ndepth,neme,nsked,mycall,hiscall,hisgrid,
|
||||
+ lumsg,lcum,nspecial,ndf,nstest,dfsh,iderrsh,idriftsh,
|
||||
+ snrsh,NSyncOK,ccfblue,ccfred,ndiag,nwsh)
|
||||
|
||||
@ -37,6 +37,8 @@ C already been done.
|
||||
ave2=' '
|
||||
endif
|
||||
|
||||
naggressive=0
|
||||
if(ndepth.ge.2) naggressive=1
|
||||
nq1=3
|
||||
nq2=6
|
||||
if(naggressive.eq.1) nq1=1
|
||||
@ -55,10 +57,11 @@ C already been done.
|
||||
|
||||
C Attempt to synchronize: look for sync tone, get DF and DT.
|
||||
call sync65(dat,npts,DFTolerance,NFreeze,NAFC,MouseDF,
|
||||
+ dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width,ftrack)
|
||||
+ dtx,dfx,snrx,snrsync,ccfblue,ccfred,flip,width)
|
||||
f0=1270.46 + dfx
|
||||
csync=' '
|
||||
decoded=' '
|
||||
deepmsg=' '
|
||||
special=' '
|
||||
cooo=' '
|
||||
itry=0
|
||||
@ -66,7 +69,6 @@ C Attempt to synchronize: look for sync tone, get DF and DT.
|
||||
ncount1=-1 !Flag for RS Decode of ave1
|
||||
ncount2=-1 !Flag for RS Decode of ave2
|
||||
NSyncOK=0
|
||||
qbest=0.
|
||||
|
||||
if(nsave.lt.MAXAVE .and. (NAgain.eq.0 .or. NClearAve.eq.1))
|
||||
+ nsave=nsave+1
|
||||
@ -110,51 +112,15 @@ C If we get here, we have achieved sync!
|
||||
cooo='O ?'
|
||||
endif
|
||||
|
||||
C Do a "peakup search" over DT, looking for successful
|
||||
C result from the Reed-Solomon decoder.
|
||||
itrymax=1
|
||||
if(ndepth.eq.2) itrymax=1
|
||||
if(ndepth.eq.3) itrymax=5
|
||||
|
||||
do itry=1,itrymax
|
||||
idt=itf(1,itry)
|
||||
idf=itf(2,itry)
|
||||
dtxx=dtx + idt*0.036 !### Was 0.012 ###
|
||||
dfxx=dfx + mode65*idf*1.346
|
||||
lmid=.false.
|
||||
if(itry.eq.1) lmid=.true.
|
||||
call decode65(dat,npts,dtxx,dfxx,flip,ndepth,neme,nsked,
|
||||
+ mycall,hiscall,hisgrid,mode65,lmid,ftrack,decoded,
|
||||
+ ncount,deepmsg,qual)
|
||||
if(ncount.eq.-999) then
|
||||
qbest=0 !Bad data
|
||||
go to 200
|
||||
endif
|
||||
if(qual.gt.qbest) then
|
||||
qbest=qual
|
||||
dtbest=dtxx
|
||||
dfbest=dfxx
|
||||
deepbest=deepmsg
|
||||
itrybest=itry
|
||||
endif
|
||||
if(ncount.ge.0) then
|
||||
dtx=dtxx !Successful decode
|
||||
dfx=dfxx
|
||||
go to 200
|
||||
endif
|
||||
enddo
|
||||
itry=itrybest
|
||||
ncount=-1
|
||||
|
||||
200 continue
|
||||
kvqual=0
|
||||
call decode65(dat,npts,dtx,dfx,flip,ndepth,neme,nsked,
|
||||
+ nsnr,mycall,hiscall,hisgrid,mode65,nafc,decoded,
|
||||
+ ncount,deepmsg,qual)
|
||||
if(ncount.eq.-999) qual=0 !Bad data
|
||||
200 kvqual=0
|
||||
if(ncount.ge.0) kvqual=1
|
||||
nqual=min(qbest,10.0)
|
||||
if(nqual.ge.nq1 .and.kvqual.eq.0) then
|
||||
dtx=dtbest
|
||||
dfx=dfbest
|
||||
decoded=deepbest
|
||||
endif
|
||||
nqual=qual
|
||||
if(ndiag.eq.0 .and. nqual.gt.10) nqual=10
|
||||
if(nqual.ge.nq1 .and.kvqual.eq.0) decoded=deepmsg
|
||||
|
||||
ndf=nint(dfx)
|
||||
if(flip.lt.0.0 .and. (kvqual.eq.1 .or. nqual.ge.nq2)) cooo='OOO'
|
||||
@ -165,8 +131,8 @@ C result from the Reed-Solomon decoder.
|
||||
if(c1.ge.'a' .and. c1.le.'z') decoded(i:i)=char(ichar(c1)-32)
|
||||
enddo
|
||||
write(line,1010) cfile6,nsync,nsnr,dtx-1.0,ndf,
|
||||
+ nint(width),csync,special,decoded(1:19),cooo,kvqual,nqual,itry
|
||||
1010 format(a6,i3,i5,f5.1,i5,i3,1x,a1,1x,a5,a19,1x,a3,i4,i3,i2)
|
||||
+ nint(width),csync,special,decoded(1:19),cooo,kvqual,nqual
|
||||
1010 format(a6,i3,i5,f5.1,i5,i3,1x,a1,1x,a5,a19,1x,a3,i4,i4)
|
||||
|
||||
C Blank DT if shorthand message (### wrong logic? ###)
|
||||
if(special.ne.' ') then
|
||||
@ -188,31 +154,46 @@ C Write decoded msg unless this is an "Exclude" request:
|
||||
if(MinSigdB.lt.99) write(lumsg,1011) line
|
||||
|
||||
if(nsave.ge.1) call avemsg65(1,mode65,ndepth,avemsg1,nused1,
|
||||
+ ns1,ncount1)
|
||||
+ nq1,nq2,neme,nsked,flip,mycall,hiscall,hisgrid,qual1,
|
||||
+ ns1,ncount1)
|
||||
if(nsave.ge.1) call avemsg65(2,mode65,ndepth,avemsg2,nused2,
|
||||
+ ns2,ncount2)
|
||||
+ nq1,nq2,neme,nsked,flip,mycall,hiscall,hisgrid,qual2,
|
||||
+ ns2,ncount2)
|
||||
nqual1=qual1
|
||||
nqual2=qual2
|
||||
if(ndiag.eq.0 .and. nqual1.gt.10) nqual1=10
|
||||
if(ndiag.eq.0 .and. nqual2.gt.10) nqual2=10
|
||||
nc1=0
|
||||
nc2=0
|
||||
if(ncount1.ge.0) nc1=1
|
||||
if(ncount2.ge.0) nc2=1
|
||||
|
||||
C Write the average line
|
||||
if(ns1.ge.1 .and. ns1.ne.ns10) then
|
||||
if(ns1.lt.10) write(ave1,1021) cfile6,1,nused1,ns1,avemsg1
|
||||
1021 format(a6,i3,i4,'/',i1,20x,a19)
|
||||
! if(ns1.ge.1 .and. ns1.ne.ns10) then
|
||||
if(ns1.ge.1) then
|
||||
if(ns1.lt.10) write(ave1,1021) cfile6,1,nused1,ns1,avemsg1,
|
||||
+ nc1,nqual1
|
||||
1021 format(a6,i3,i4,'/',i1,20x,a19,i8,i4)
|
||||
if(ns1.ge.10 .and. nsave.le.99) write(ave1,1022) cfile6,
|
||||
+ 1,nused1,ns1,avemsg1
|
||||
1022 format(a6,i3,i4,'/',i2,19x,a19)
|
||||
+ 1,nused1,ns1,avemsg1,nc1,nqual1
|
||||
1022 format(a6,i3,i4,'/',i2,19x,a19,i8,i4)
|
||||
if(ns1.ge.100) write(ave1,1023) cfile6,1,nused1,ns1,
|
||||
+ avemsg1
|
||||
1023 format(a6,i3,i4,'/',i3,18x,a19)
|
||||
+ avemsg1,nc1,nqual1
|
||||
1023 format(a6,i3,i4,'/',i3,18x,a19,i8,i4)
|
||||
if(lcum .and. (avemsg1.ne.' '))
|
||||
+ write(21,1011) ave1(1:57)//' '
|
||||
ns10=ns1
|
||||
endif
|
||||
|
||||
C If Monitor segment #2 is available, write that line also
|
||||
if(ns2.ge.1 .and. ns2.ne.ns20) then
|
||||
if(ns2.lt.10) write(ave2,1021) cfile6,2,nused2,ns2,avemsg2
|
||||
! if(ns2.ge.1 .and. ns2.ne.ns20) then !***Why the 2nd part?? ***
|
||||
if(ns2.ge.1) then
|
||||
if(ns2.lt.10) write(ave2,1021) cfile6,2,nused2,ns2,avemsg2,
|
||||
+ nc2,nqual2
|
||||
if(ns2.ge.10 .and. nsave.le.99) write(ave2,1022) cfile6,
|
||||
+ 2,nused2,ns2,avemsg2
|
||||
if(ns2.ge.100) write(ave2,1023) cfile6,2,nused2,ns2,avemsg2
|
||||
+ 2,nused2,ns2,avemsg2,nc2,nqual2
|
||||
if(ns2.ge.100) write(ave2,1023) cfile6,2,nused2,ns2,avemsg2,
|
||||
+ nc2,nqual2
|
||||
if(lcum .and. (avemsg2.ne.' '))
|
||||
+ write(21,1011) ave2(1:57)//' '
|
||||
ns20=ns2
|
||||
|
Loading…
Reference in New Issue
Block a user