Fix a wrong number in User Guide. Add qratest.f90 and a private makefile.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7366 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2016-12-05 21:00:13 +00:00
parent 86780684a0
commit 77a4d19676
3 changed files with 82 additions and 214 deletions

View File

@ -249,7 +249,7 @@ many times as will fit into a Tx sequence.
==== JT9
The JT9 slow modes all use keying rate 4.375 baud. By contrast, with
The JT9 slow modes all use keying rate 12000/6912 = 1.736 baud. By contrast, with
the *Fast* setting submodes JT9E-H adjust the keying rate to match the
increased tone spacings. Message durations are therefore much
shorter, and they are sent repeatedly throughout each Tx sequence.

View File

@ -1,54 +1,69 @@
CC = gcc
CXX = g++
FC = gfortran
AR = ar cr
MKDIR = mkdir -p
CP = cp
RANLIB = ranlib
RM = rm -f
FFLAGS = -O3 -funroll-loops -Wall -Wno-conversion -fno-second-underscore -DUNIX
CFLAGS = -I. -fPIE
# Default rules
%.o: %.c
${CC} ${CFLAGS} -c $<
%.o: %.f
${FC} ${FFLAGS} -c $<
%.o: %.F
${FC} ${FFLAGS} -c $<
%.o: %.f90
${FC} ${FFLAGS} -c $<
%.o: %.F90
${FC} ${FFLAGS} -c $<
%.mod: %.f90
${FC} ${FFLAGS} -c $<
#all: jt4.mod testjt4 testfast9
all: testjt65
OBJS1 = testjt4.o jt4.o sync4.o ps4.o four2a.o flat1a.o smo.o xcor4.o \
slope.o peakup.o db.o pctile.o sort.o timer.o image.o zplt.o
testjt4: $(OBJS1)
$(FC) -o testjt4 $(OBJS1) -L. -lfftw3f_threads -lfftw3f
OBJS2 = t2.o image.o
t2: $(OBJS2)
$(FC) -o t2 $(OBJS2)
OBJS3 = testfast9.o fast9.o four2a.o pctile.o db.o interleave9.o jt9fano.o \
sort.o fano232.o packjt.o deg2grid.o grid2deg.o fmtmsg.o \
spec9f.o foldspec9f.o sync9f.o softsym9f.o
testfast9: $(OBJS3)
$(FC) -o testfast9 $(OBJS3) C:\JTSDK\fftw3f\libfftw3f-3.dll
OBJS4 = testjt65.o symspec65.o four2a.o db.o flat65.o pctile.o shell.o \
xcor.o setup65.o slope.o peakup.o sync65.o
testjt65: $(OBJS4)
$(FC) -o testjt65 $(OBJS4) C:\JTSDK\fftw3f\libfftw3f-3.dll
.PHONY : clean
clean:
$(RM) *.o libjt9.a testjt4
# Set paths
EXE_DIR = ..\\..\\wsjtx_install
QT_DIR = C:/wsjt-env/Qt5/5.2.1/mingw48_32
FFTW3_DIR = ..
INCPATH = -I${QT_DIR}/include/QtCore -I${QT_DIR}/include
# Compilers
CC = gcc
CXX = g++
FC = gfortran
AR = ar cr
RANLIB = ranlib
MKDIR = mkdir -p
CP = cp
RM = rm -f
FFLAGS = -O2 -fbounds-check -Wall -Wno-conversion
CFLAGS = -O2 -I.
# Default rules
%.o: %.c
${CC} ${CFLAGS} -c $<
%.o: %.f
${FC} ${FFLAGS} -c $<
%.o: %.F
${FC} ${FFLAGS} -c $<
%.o: %.f90
${FC} ${FFLAGS} -c $<
%.o: %.F90
${FC} ${FFLAGS} -c $<
all: qratest.exe
OBJS1 = qratest.o qra64a.o sync64.o four2a.o smo.o smo121.o averms.o \
timer_module.o packjt.o twkfreq.o spec64.o fmtmsg.o pctile.o \
grid2deg.o deg2grid.o shell.o badmsg.o qra64_subs.o \
qracodes.o npfwht.o pdmath.o qra12_63_64_irr_b.o \
qra13_64_64_irr_e.o qra64.o
qra64_subs.o: qra/qra64/qra64_subs.c
gcc -c -O2 -o qra64_subs.o qra/qra64/qra64_subs.c
qracodes.o: qra/qracodes/qracodes.c
gcc -c -O2 -o qracodes.o qra/qracodes/qracodes.c
qra64.o: qra/qra64/qra64.c
gcc -c -O2 -o qra64.o qra/qra64/qra64.c
npfwht.o: qra/qracodes/npfwht.c
gcc -c -O2 -o npfwht.o qra/qracodes/npfwht.c
pdmath.o: qra/qracodes/pdmath.c
gcc -c -O2 -o pdmath.o qra/qracodes/pdmath.c
qra12_63_64_irr_b.o: qra/qracodes/qra12_63_64_irr_b.c
gcc -c -O2 -o qra12_63_64_irr_b.o qra/qracodes/qra12_63_64_irr_b.c
qra13_64_64_irr_e.o: qra/qracodes/qra13_64_64_irr_e.c
gcc -c -O2 -o qra13_64_64_irr_e.o qra/qracodes/qra13_64_64_irr_e.c
qratest.exe: $(OBJS1)
$(FC) -o qratest.exe $(OBJS1) C:\JTSDK\fftw3f\libfftw3f-3.dll
.PHONY : clean
clean:
$(RM) *.o qratest.exe

View File

@ -2,9 +2,10 @@ program qratest
parameter (NMAX=60*12000)
real dd(NMAX)
real t(5)
integer*8 count0,count1,clkfreq
character*8 arg
character*12 mycall,hiscall
character*6 hisgrid
character*22 decoded
nargs=iargc()
if(nargs.ne.3) then
@ -17,164 +18,16 @@ program qratest
read(arg,*) maxf1
call getarg(3,arg)
read(arg,*) ntol
nf1=nf0-ntol
nf2=nf0+ntol
ndepth=3
! do iskip=1,13
! read(60)
! enddo
do n=1,999
read(60,end=999) dd
call system_clock(count0,clkfreq)
call sync64(dd,nf1,nf2,maxf1,dtx,f0,kpk,snr,t)
call system_clock(count1,clkfreq)
tsec=float(count1-count0)/float(clkfreq)
! nf0=200*nint(f0/200.)
dfreq0=f0-nf0
write(*,1000) dtx,f0,dfreq0,kpk,snr,tsec
1000 format(f8.3,f8.2,f7.2,i4,f8.1,f7.3)
! do n=1,999
do n=1,1
read(60,end=999) dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,mycall, &
hiscall,hisgrid
call qra64a(dd,npts,nutc,nf1,nf2,nfqso,ntol,mode64,minsync,ndepth, &
mycall,hiscall,hisgrid,sync,nsnr,dtx,nfreq,decoded,nft)
write(*,1000) nutc,nsnr,dtx,nfreq,decoded,nft-100
1000 format(i4.4,i4,f6.2,i5,1x,a22,i3)
enddo
999 end program qratest
subroutine sync64(dd,nf1,nf2,maxf1,dtx,f0,kpk,snr,t)
parameter (NMAX=60*12000) !Max size of raw data at 12000 Hz
parameter (NSPS=2304) !Samples per symbol at 4000 Hz
parameter (NSPC=7*NSPS) !Samples per Costas array
real dd(NMAX) !Raw data
real x(672000) !Up to 56 s at 12000 Hz
real t(5)
real s0(0:NSPC-1)
real s1(0:NSPC-1)
real s2(0:NSPC-1)
real s3(0:NSPC-1)
real s0a(0:NSPC-1)
integer*8 count0,count1,clkfreq
integer icos7(0:6)
integer ipk0(1)
complex cc(0:NSPC-1)
complex c0(0:336000)
complex c1(0:NSPC-1)
complex c2(0:NSPC-1)
complex c3(0:NSPC-1)
equivalence (x,c0)
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 pattern
twopi=8.0*atan(1.0)
dfgen=12000.0/6912.0
k=-1
phi=0.
do j=0,6
dphi=twopi*icos7(j)*dfgen/4000.0
do i=1,2304
phi=phi + dphi
if(phi.gt.twopi) phi=phi-twopi
k=k+1
cc(k)=cmplx(cos(phi),sin(phi))
enddo
enddo
npts0=54*12000
nfft1=672000
nfft2=nfft1/3
df1=12000.0/nfft1
fac=2.0/nfft1
x=fac*dd(1:nfft1)
call system_clock(count0,clkfreq)
call four2a(c0,nfft1,1,-1,0) !Forward r2c FFT
call four2a(c0,nfft2,1,1,1) !Inverse c2c FFT; c0 is analytic sig
call system_clock(count1,clkfreq)
t(1)=float(count1-count0)/float(clkfreq)
npts2=npts0/3 !Downsampled complex data length
nfft3=NSPC
nh3=nfft3/2
df3=4000.0/nfft3
ia=nint(nf1/df3)
ib=nint(nf2/df3)
iz=ib-ia+1
snr=0.
jpk=0
ja=0
jb=6*4000
jstep=200
ka=-maxf1
kb=maxf1
ipk=0
kpk=0
call system_clock(count0,clkfreq)
do iter=1,2
do j1=ja,jb,jstep
j2=j1 + 39*2304
j3=j1 + 77*2304
c1=1.e-4*c0(j1:j1+NSPC-1) * conjg(cc)
call four2a(c1,nfft3,1,-1,1)
c2=1.e-4*c0(j2:j2+NSPC-1) * conjg(cc)
call four2a(c2,nfft3,1,-1,1)
c3=1.e-4*c0(j3:j3+NSPC-1) * conjg(cc)
call four2a(c3,nfft3,1,-1,1)
s0=0.
s1=0.
s2=0.
s3=0.
do i=ia,ib
freq=i*df3
s1(i)=real(c1(i))**2 + aimag(c1(i))**2
s2(i)=real(c2(i))**2 + aimag(c2(i))**2
s3(i)=real(c3(i))**2 + aimag(c3(i))**2
enddo
do k=ka,kb
s0(ia:ib)=s1(ia-k:ib-k) + s2(ia:ib) + s3(ia+k:ib+k)
call smo121(s0(ia:ib),iz)
call averms(s0(ia:ib),iz,14,ave,rms)
s=(maxval(s0(ia:ib))-ave)/rms
if(s.gt.snr) then
jpk=j1
s0a=s0
snr=s
dtx=jpk/4000.0 - 1.0
ipk0=maxloc(s0(ia:ib))
ipk=ipk0(1)
f0=(ipk+ia-1)*df3
kpk=k
write(16,3101) jpk,ipk,kpk,dtx,f0,snr
3101 format(3i5,f8.3,f8.2,f10.1)
endif
enddo
enddo
ja=jpk-2*jstep
jb=jpk+2*jstep
jstep=10
! ka=kpk
! kb=kpk
enddo
call system_clock(count1,clkfreq)
t(2)=float(count1-count0)/float(clkfreq)
return
end subroutine sync64
subroutine averms(x,n,nskip,ave,rms)
real x(n)
integer ipk(1)
ns=0
s=0.
sq=0.
ipk=maxloc(x)
do i=1,n
if(abs(i-ipk(1)).gt.nskip) then
s=s + x(i)
sq=sq + x(i)**2
ns=ns+1
endif
enddo
ave=s/ns
rms=sqrt(sq/ns - ave*ave)
return
end subroutine averms