Removed some unised files.

Added dphi = 310 degrees, correction different for feedline lengths.
NB: this will be different, with new array!


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@425 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2007-06-27 19:49:29 +00:00
parent 7e3d8b47e2
commit 3620d66451
7 changed files with 16 additions and 294 deletions

View File

@ -1,5 +1,5 @@
subroutine decode1a(id,newdat,nfilt,freq,nflip,ipol,sync2,a,dt,
+ pol,nkv,nhist,qual,decoded)
subroutine decode1a(id,newdat,nfilt,freq,nflip,dphi,ipol,
+ sync2,a,dt,pol,nkv,nhist,qual,decoded)
C Apply AFC corrections to a candidate JT65 signal, and then try
C to decode it.
@ -13,6 +13,7 @@ C to decode it.
complex cx(NMAX/64), cy(NMAX/64) !Data at 1378.125 samples/s
complex c5x(NMAX/256),c5y(NMAX/256)
complex c5a(256), c5b(256)
complex z
real s2(256,126)
real a(5)
@ -73,6 +74,12 @@ C Find best DF, f1, f2, DT, and pol
call fil6521(cx,n5,c5x,n6)
call fil6521(cy,n5,c5y,n6)
! Adjust for cable length difference:
z=cmplx(cos(dphi),sin(dphi))
do i=1,n6
c5y(i)=z*c5y(i)
enddo
fsample=1378.125/4.
a(5)=dt00
i0=nint((a(5)+0.5)*fsample) - 2

View File

@ -35,7 +35,7 @@ C Suppress "birdie messages":
endif
qual=0.
if(nkv.eq.0) then
! if(nkv.eq.0) then
mycall='K1JT'
hiscall='W1ABC'
hisgrid='EM79'
@ -51,7 +51,7 @@ C Save symbol spectra for possible decoding of average.
! if(flip.lt.0.0) k=mdat2(j)
! call move(s2(8,k),ppsave(1,j,nsave),64)
! enddo
endif
! endif
if(nkv.eq.0 .and. qual.ge.1.0) decoded=deepmsg

67
lpf1.f
View File

@ -1,67 +0,0 @@
subroutine lpf1(dat,jz,nz,mousedf,mousedf2)
parameter (NMAX=1024*1024)
parameter (NMAXH=NMAX)
real dat(jz),x(NMAX)
complex c(0:NMAXH)
equivalence (x,c)
C Find FFT length
xn=log(float(jz))/log(2.0)
n=xn
if((xn-n).gt.0.) n=n+1
nfft=2**n
nh=nfft/2
C Load data into real array x; pad with zeros up to nfft.
do i=1,jz
x(i)=dat(i)
enddo
if(nfft.gt.jz) call zero(x(jz+1),nfft-jz)
C Do the FFT
call xfft(x,nfft)
df=11025.0/nfft
ia=70/df
do i=0,ia
c(i)=0.
enddo
ia=5000.0/df
do i=ia,nh
c(i)=0.
enddo
C See if frequency needs to be shifted:
ndf=0
if(mousedf.lt.-600) ndf=-670
if(mousedf.gt.600) ndf=1000
if(mousedf.gt.1600) ndf=2000
if(mousedf.gt.2600) ndf=3000
if(ndf.ne.0) then
C Shift frequency up or down by ndf Hz:
i0=nint(ndf/df)
if(i0.lt.0) then
do i=nh,-i0,-1
c(i)=c(i+i0)
enddo
do i=0,-i0-1
c(i)=0.
enddo
else
do i=0,nh-i0
c(i)=c(i+i0)
enddo
endif
endif
mousedf2=mousedf-ndf !Adjust mousedf
call four2a(c,nh,1,1,-1) !Return to time domain
fac=1.0/nfft
nz=jz/2
do i=1,nz
dat(i)=fac*x(i)
enddo
return
end

View File

@ -54,6 +54,7 @@ subroutine map65a(newdat)
! nfilt=2 should be faster (but doesn't work quite right?)
nfilt=1 !nfilt=2 is faster for selected freq
dphi=310/57.2957795
do kpol=0,3
freq=fselect + 0.001*mousedf
if(even) ip0=ip000+kpol
@ -61,8 +62,8 @@ subroutine map65a(newdat)
if(ip0.gt.4) ip0=ip0-4
dt00=2.314240
dt=dt00
call decode1a(id(1,1,kbuf),newdat,nfilt,freq,nflip,ip0,sync2, &
a,dt,pol,nkv,nhist,qual,decoded)
call decode1a(id(1,1,kbuf),newdat,nfilt,freq,nflip,dphi,ip0, &
sync2,a,dt,pol,nkv,nhist,qual,decoded)
nsync1=0
nsync2=nint(10.0*log10(sync2)) - 40 !### empirical ###
ndf=nint(a(1)) + mousedf
@ -194,8 +195,8 @@ subroutine map65a(newdat)
if(freq-freq0.gt.ftol .or. sync1.gt.sync10) then
nflip=nint(flipk)
call decode1a(id(1,1,kbuf),newdat,nfilt,freq,nflip,ipol, &
sync2,a,dt,pol,nkv,nhist,qual,decoded)
call decode1a(id(1,1,kbuf),newdat,nfilt,freq,nflip,dphi, &
ipol,sync2,a,dt,pol,nkv,nhist,qual,decoded)
! i9=index(decoded,'AA1YN')
! if(i9.gt.0) print*,i,i9,fselect,freq,decoded
kk=kk+1

23
ps.f
View File

@ -1,23 +0,0 @@
subroutine ps(dat,nfft,s)
parameter (NMAX=16384+2)
parameter (NHMAX=NMAX/2-1)
real dat(nfft)
real s(NHMAX)
real x(NMAX)
complex c(0:NHMAX)
equivalence (x,c)
nh=nfft/2
do i=1,nfft
x(i)=dat(i)/128.0 !### Why 128 ??
enddo
call xfft(x,nfft)
fac=1.0/nfft
do i=1,nh
s(i)=fac*(real(c(i))**2 + aimag(c(i))**2)
enddo
return
end

12
xfft.f
View File

@ -1,12 +0,0 @@
subroutine xfft(x,nfft)
C Real-to-complex FFT.
real x(nfft)
! call four2(x,nfft,1,-1,0)
call four2a(x,nfft,1,-1,0)
return
end

184
xfft2.f
View File

@ -1,184 +0,0 @@
SUBROUTINE xfft2(DATA,NB)
c
c the cooley-tukey fast fourier transform in usasi basic fortran
c
C .. Scalar Arguments ..
INTEGER NB
C ..
C .. Array Arguments ..
REAL DATA(NB+2)
C ..
C .. Local Scalars ..
REAL DIFI,DIFR,RTHLF,SUMI,SUMR,T2I,T2R,T3I,T3R,T4I,
+ T4R,TEMPI,TEMPR,THETA,TWOPI,U1I,U1R,U2I,U2R,U3I,U3R,
+ U4I,U4R,W2I,W2R,W3I,W3R,WI,WR,WSTPI,WSTPR
INTEGER I,I2,IPAR,J,K1,K2,K3,K4,KDIF,KMIN,
+ KSTEP,L,LMAX,M,MMAX,NH
C ..
C .. Intrinsic Functions ..
INTRINSIC COS,MAX0,REAL,SIN
C ..
C .. Data statements ..
DATA TWOPI/6.2831853071796/,RTHLF/0.70710678118655/
c
c 1. real transform for the 1st dimension, n even. method--
c transform a complex array of length n/2 whose real parts
c are the even numbered real values and whose imaginary parts
c are the odd numbered real values. separate and supply
c the second half by conjugate symmetry.
c
NH = NB/2
c
c shuffle data by bit reversal, since n=2**k.
c
J = 1
DO 131 I2 = 1,NB,2
IF (J-I2) 124,127,127
124 TEMPR = DATA(I2)
TEMPI = DATA(I2+1)
DATA(I2) = DATA(J)
DATA(I2+1) = DATA(J+1)
DATA(J) = TEMPR
DATA(J+1) = TEMPI
127 M = NH
128 IF (J-M) 130,130,129
129 J = J - M
M = M/2
IF (M-2) 130,128,128
130 J = J + M
131 CONTINUE
c
c main loop for factors of two. perform fourier transforms of
c length four, with one of length two if needed. the twiddle factor
c w=exp(-2*pi*sqrt(-1)*m/(4*mmax)). check for w=-sqrt(-1)
c and repeat for w=w*(1-sqrt(-1))/sqrt(2).
c
IF (NB-2) 174,174,143
143 IPAR = NH
144 IF (IPAR-2) 149,146,145
145 IPAR = IPAR/4
GO TO 144
146 DO 147 K1 = 1,NB,4
K2 = K1 + 2
TEMPR = DATA(K2)
TEMPI = DATA(K2+1)
DATA(K2) = DATA(K1) - TEMPR
DATA(K2+1) = DATA(K1+1) - TEMPI
DATA(K1) = DATA(K1) + TEMPR
DATA(K1+1) = DATA(K1+1) + TEMPI
147 CONTINUE
149 MMAX = 2
150 IF (MMAX-NH) 151,174,174
151 LMAX = MAX0(4,MMAX/2)
DO 173 L = 2,LMAX,4
M = L
IF (MMAX-2) 156,156,152
152 THETA = -TWOPI*REAL(L)/REAL(4*MMAX)
WR = COS(THETA)
WI = SIN(THETA)
155 W2R = WR*WR - WI*WI
W2I = 2.*WR*WI
W3R = W2R*WR - W2I*WI
W3I = W2R*WI + W2I*WR
156 KMIN = 1 + IPAR*M
IF (MMAX-2) 157,157,158
157 KMIN = 1
158 KDIF = IPAR*MMAX
159 KSTEP = 4*KDIF
IF (KSTEP-NB) 160,160,169
160 DO 168 K1 = KMIN,NB,KSTEP
K2 = K1 + KDIF
K3 = K2 + KDIF
K4 = K3 + KDIF
IF (MMAX-2) 161,161,164
161 U1R = DATA(K1) + DATA(K2)
U1I = DATA(K1+1) + DATA(K2+1)
U2R = DATA(K3) + DATA(K4)
U2I = DATA(K3+1) + DATA(K4+1)
U3R = DATA(K1) - DATA(K2)
U3I = DATA(K1+1) - DATA(K2+1)
U4R = DATA(K3+1) - DATA(K4+1)
U4I = DATA(K4) - DATA(K3)
GO TO 167
164 T2R = W2R*DATA(K2) - W2I*DATA(K2+1)
T2I = W2R*DATA(K2+1) + W2I*DATA(K2)
T3R = WR*DATA(K3) - WI*DATA(K3+1)
T3I = WR*DATA(K3+1) + WI*DATA(K3)
T4R = W3R*DATA(K4) - W3I*DATA(K4+1)
T4I = W3R*DATA(K4+1) + W3I*DATA(K4)
U1R = DATA(K1) + T2R
U1I = DATA(K1+1) + T2I
U2R = T3R + T4R
U2I = T3I + T4I
U3R = DATA(K1) - T2R
U3I = DATA(K1+1) - T2I
U4R = T3I - T4I
U4I = T4R - T3R
167 DATA(K1) = U1R + U2R
DATA(K1+1) = U1I + U2I
DATA(K2) = U3R + U4R
DATA(K2+1) = U3I + U4I
DATA(K3) = U1R - U2R
DATA(K3+1) = U1I - U2I
DATA(K4) = U3R - U4R
DATA(K4+1) = U3I - U4I
168 CONTINUE
KDIF = KSTEP
KMIN = 4*KMIN - 3
GO TO 159
169 M = M + LMAX
IF (M-MMAX) 170,170,173
170 TEMPR = WR
WR = (WR+WI)*RTHLF
WI = (WI-TEMPR)*RTHLF
GO TO 155
173 CONTINUE
IPAR = 3 - IPAR
MMAX = MMAX + MMAX
GO TO 150
c
c complete a real transform in the 1st dimension, n even, by con-
c jugate symmetries.
c
174 THETA = -TWOPI/REAL(NB)
WSTPR = COS(THETA)
WSTPI = SIN(THETA)
WR = WSTPR
WI = WSTPI
I = 3
J = NB - 1
GO TO 207
205 SUMR = (DATA(I)+DATA(J))/2.
SUMI = (DATA(I+1)+DATA(J+1))/2.
DIFR = (DATA(I)-DATA(J))/2.
DIFI = (DATA(I+1)-DATA(J+1))/2.
TEMPR = WR*SUMI + WI*DIFR
TEMPI = WI*SUMI - WR*DIFR
DATA(I) = SUMR + TEMPR
DATA(I+1) = DIFI + TEMPI
DATA(J) = SUMR - TEMPR
DATA(J+1) = -DIFI + TEMPI
I = I + 2
J = J - 2
TEMPR = WR
WR = WR*WSTPR - WI*WSTPI
WI = TEMPR*WSTPI + WI*WSTPR
207 IF (I-J) 205,208,211
208 DATA(I+1) = -DATA(I+1)
211 DATA(NB+1) = DATA(1) - DATA(2)
DATA(NB+2) = 0.
DATA(1) = DATA(1) + DATA(2)
DATA(2) = 0.
RETURN
END