Removed two unused routines.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@1024 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2008-09-18 13:43:20 +00:00
parent 0e24891d04
commit 82b2933cdd
3 changed files with 1 additions and 252 deletions

View File

@ -1,161 +0,0 @@
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)
n2 = NMAX/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
n3 = NMAX/4
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
n4 = NMAX/16
call fil653(c3,n3,c4,n4) !Low-pass at +/- 100 Hz; rate 1/4
dt=4.d0*dt !Down by 32
n5 = NMAX/64
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

View File

@ -1,4 +1,4 @@
#--------------------------------------------------------------------- MAP65 #-------------------------------------------------------------------- MAP65
# $Date$ $Revision$ # $Date$ $Revision$
# #
from Tkinter import * from Tkinter import *

View File

@ -1,90 +0,0 @@
subroutine spec2d65(dat,jz,nsym,flip,istart,f0,
+ 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.
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 s2(77,126) !Spectra of all symbols
real s(77)
real ref(77)
real ps(77)
real x(NMAX)
real ftrack(126)
real*8 pha,dpha,twopi
complex cx(NMAX)
c complex work(NMAX)
include 'prcom.h'
equivalence (x,cx)
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
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
k=k+nfft
if(k.ge.1 .and. k.le.(jz-nfft)) then
C Mix sync tone down to f=5*df (==> bin 6 of array cx, after FFT)
dpha=twopi*dt*(f0 + ftrack(j) - 5.0*df)
pha=0.0
do i=1,nfft
pha=pha+dpha
cx(i)=dat(k-1+i)*cmplx(cos(pha),-sin(pha))
enddo
call four2a(cx,nfft,1,-1,1)
do i=1,77
s(i)=s(i) + real(cx(i))**2 + aimag(cx(i))**2
enddo
else
call zero(s,77)
endif
enddo
call move(s,s2(1,j),77)
call add(ps,s,ps,77)
enddo
C Flatten the spectra by dividing through by the average of the
C "sync on" spectra, with the sync tone explicitly deleted.
nref=nsym/2
do i=1,77
C First we sum all the sync-on spectra:
ref(i)=0.
do j=1,nsym
if(flip*pr(j).gt.0.0) ref(i)=ref(i)+s2(i,j)
enddo
ref(i)=ref(i)/nref !Normalize
enddo
C Remove the sync tone itself:
base=0.25*(ref(1)+ref(2)+ref(10)+ref(11))
do i=3,9
ref(i)=base
enddo
C Now flatten the spectra for all the data symbols:
do i=1,77
fac=1.0/ref(i)
do j=1,nsym
s2(i,j)=fac*s2(i,j)
if(s2(i,j).eq.0.0) s2(i,j)=1.0 !### To fix problem in mfskprob
enddo
enddo
return
end