Working on peakups for DF and DT.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2642 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-10-03 17:47:55 +00:00
parent 22e31366a0
commit bb02cd3e8c
5 changed files with 88 additions and 12 deletions

View File

@ -27,15 +27,16 @@ OBJS1 = trimlist.o pctile.o sort.o indexx.o ssort.o graycode.o \
grid2k.o unpacktext.o getpfx2.o packmsg.o deg2grid.o \ grid2k.o unpacktext.o getpfx2.o packmsg.o deg2grid.o \
packtext.o getpfx1.o packcall.o k2grid.o packgrid.o \ packtext.o getpfx1.o packcall.o k2grid.o packgrid.o \
nchar.o four2a.o grid2deg.o pfxdump.o f77_wisdom.o \ nchar.o four2a.o grid2deg.o pfxdump.o f77_wisdom.o \
symspecx.o timf2x.o analytic.o db.o genjt9.o ptt.o \ symspec.o timf2.o analytic.o db.o genjt9.o ptt.o \
packbits.o unpackbits.o encode232.o interleave9.o \ packbits.o unpackbits.o encode232.o interleave9.o \
entail.o fano232.o gran.o spec9.o decode9.o entail.o fano232.o gran.o spec9.o sync9.o decode9.o \
peakdt9.o peakdf9.o
libjt9.a: $(OBJS1) libjt9.a: $(OBJS1)
ar cr libjt9.a $(OBJS1) ar cr libjt9.a $(OBJS1)
ranlib libjt9.a ranlib libjt9.a
OBJS2 = jt9.o symspec.o timf2x.o sync9.o OBJS2 = jt9.o
jt9.exe: $(OBJS2) libjt9.a jt9.exe: $(OBJS2) libjt9.a
$(FC) -o jt9.exe $(OBJS2) libjt9.a ../libfftw3f_win.a $(FC) -o jt9.exe $(OBJS2) libjt9.a ../libfftw3f_win.a

37
lib/peakdf9.f90 Normal file
View File

@ -0,0 +1,37 @@
subroutine peakdf9(c0,npts8,nsps8,istart,foffset,xdf)
complex c0(0:npts8-1)
complex zsum
integer ii(16) !Locations of sync symbols
data ii/1,6,11,16,21,26,31,39,45,51,57,63,69,75,81,85/
twopi=8.0*atan(1.0)
df=1500.0/nsps8
smax=0.
do idf=-10,10
f0=foffset + 0.1*df*idf
dphi=twopi*f0/1500.0
sum=0.
do j=1,16
i1=(ii(j)-1)*nsps8 + istart
phi=0.
zsum=0.
do i=i1,i1+nsps8-1
if(i.lt.0) cycle
phi=phi + dphi
zsum=zsum + c0(i) * cmplx(cos(phi),-sin(phi))
enddo
sum=sum + real(zsum)**2 + aimag(zsum)**2
enddo
if(sum.gt.smax) then
idfpk=idf
fpk=f0
smax=sum
endif
enddo
write(*,3001) idfpk,fpk,smax
3001 format('DF:'i5,f8.2,f12.3)
return
end subroutine peakdf9

38
lib/peakdt9.f90 Normal file
View File

@ -0,0 +1,38 @@
subroutine peakdt9(c0,npts8,nsps8,istart,foffset,idt)
complex c0(0:npts8-1)
complex zsum
integer ii(16) !Locations of sync symbols
data ii/1,6,11,16,21,26,31,39,45,51,57,63,69,75,81,85/
twopi=8.0*atan(1.0)
smax=0.
f0=foffset
dphi=twopi*f0/1500.0
do idt=-10,10
i0=istart + 0.1*nsps8*idt
sum=0.
do j=1,16
i1=(ii(j)-1)*nsps8 + i0
phi=0.
zsum=0.
do i=i1,i1+nsps8-1
if(i.lt.0) cycle
phi=phi + dphi
zsum=zsum + c0(i) * cmplx(cos(phi),-sin(phi))
enddo
sum=sum + real(zsum)**2 + aimag(zsum)**2
enddo
if(sum.gt.smax) then
idtpk=idt
smax=sum
endif
enddo
tpk=idtpk/1500.0
write(*,3001) idtpk,tpk,smax
3001 format('DT:'i5,f8.2,f12.3)
return
end subroutine peakdt9

View File

@ -2,7 +2,6 @@ subroutine spec9(c0,npts8,nsps,f0a,lagpk,fpk,i1SoftSymbols)
parameter (MAXFFT=31500) parameter (MAXFFT=31500)
complex c0(0:npts8-1) complex c0(0:npts8-1)
real s(0:MAXFFT-1)
real ssym(0:7,69) real ssym(0:7,69)
complex c(0:MAXFFT-1) complex c(0:MAXFFT-1)
integer*1 i1SoftSymbolsScrambled(207) integer*1 i1SoftSymbolsScrambled(207)
@ -21,17 +20,19 @@ subroutine spec9(c0,npts8,nsps,f0a,lagpk,fpk,i1SoftSymbols)
save save
nsps8=nsps/8 nsps8=nsps/8
foffset=fpk-f0a
istart=1520
idt=0
xdf=0.
idt=-400 call peakdf9(c0,npts8,nsps8,istart,foffset,xdf)
idf=0. call peakdt9(c0,npts8,nsps8,istart,foffset,idt)
fshift=fpk-f0a + 0.1*idf
fshift=foffset + xdf
twopi=8.0*atan(1.0) twopi=8.0*atan(1.0)
dphi=twopi*fshift/1500.0 dphi=twopi*fshift/1500.0
nfft=nsps8 nfft=nsps8
s=0.
! istart=lagpk*nsps8 + idt
istart=1520
nsym=min((npts8-istart)/nsps8,85) nsym=min((npts8-istart)/nsps8,85)
k=0 k=0
@ -52,7 +53,6 @@ subroutine spec9(c0,npts8,nsps,f0a,lagpk,fpk,i1SoftSymbols)
do i=0,nfft-1 do i=0,nfft-1
sx=real(c(i))**2 + aimag(c(i))**2 sx=real(c(i))**2 + aimag(c(i))**2
if(i.ge.1 .and. i.le.8) ssym(ig(i-1),k)=sx if(i.ge.1 .and. i.le.8) ssym(ig(i-1),k)=sx
s(i)=s(i) + sx
enddo enddo
enddo enddo

View File

@ -12,7 +12,7 @@ short int iwave[30*48000]; //Wave file for Tx audio
int nwave; //Length of Tx waveform int nwave; //Length of Tx waveform
bool btxok; //True if OK to transmit bool btxok; //True if OK to transmit
double outputLatency; //Latency in seconds double outputLatency; //Latency in seconds
qint16 id[30*48000]; //qint16 id[30*48000];
WideGraph* g_pWideGraph = NULL; WideGraph* g_pWideGraph = NULL;