From 9375b9e9f219f2dc9bd89958b156dbd212a6b59c Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 3 Oct 2012 18:39:37 +0000 Subject: [PATCH] Can decode in modes 1 2 5 10, but not 30 -- why??? git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2643 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/jt9.f90 | 5 ++--- lib/peakdf9.f90 | 12 +++++------- lib/peakdt9.f90 | 12 ++++-------- lib/spec9.f90 | 15 ++++++++++----- lib/sync9.f90 | 2 +- mainwindow.cpp | 2 +- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/lib/jt9.f90 b/lib/jt9.f90 index dd93e91d6..663f196b4 100644 --- a/lib/jt9.f90 +++ b/lib/jt9.f90 @@ -92,10 +92,9 @@ program jt9 nutc=nutc0 nstandalone=1 - call sync9(ss,tstep,f0a,df3,lagpk,fpk) !Find sig, get rough DT and DF - call spec9(c0,npts8,nsps,f0a,lagpk,fpk,i1SoftSymbols) + call sync9(ss,tstep,f0a,df3,fpk) !Find sig, get rough freq + call spec9(c0,npts8,nsps,f0a,fpk,xdt,i1SoftSymbols) call decode9(i1SoftSymbols,msg) - xdt=lagpk*0.5*nsps/12000.0 write(*,1010) nutc,xdt,fpk,msg 1010 format(i4.4,f6.1,f7.1,2x,a22) enddo diff --git a/lib/peakdf9.f90 b/lib/peakdf9.f90 index 9d4c68731..f436eba08 100644 --- a/lib/peakdf9.f90 +++ b/lib/peakdf9.f90 @@ -1,4 +1,4 @@ -subroutine peakdf9(c0,npts8,nsps8,istart,foffset,xdf) +subroutine peakdf9(c0,npts8,nsps8,istart,foffset,idfpk) complex c0(0:npts8-1) complex zsum @@ -8,7 +8,7 @@ subroutine peakdf9(c0,npts8,nsps8,istart,foffset,xdf) twopi=8.0*atan(1.0) df=1500.0/nsps8 smax=0. - do idf=-10,10 + do idf=-5,5 f0=foffset + 0.1*df*idf dphi=twopi*f0/1500.0 sum=0. @@ -17,7 +17,7 @@ subroutine peakdf9(c0,npts8,nsps8,istart,foffset,xdf) phi=0. zsum=0. do i=i1,i1+nsps8-1 - if(i.lt.0) cycle + if(i.lt.0 .or. i.gt.npts8-1) cycle phi=phi + dphi zsum=zsum + c0(i) * cmplx(cos(phi),-sin(phi)) enddo @@ -25,13 +25,11 @@ subroutine peakdf9(c0,npts8,nsps8,istart,foffset,xdf) enddo if(sum.gt.smax) then idfpk=idf - fpk=f0 smax=sum endif + write(71,3001) idf,sum +3001 format(i5,f12.3) enddo - write(*,3001) idfpk,fpk,smax -3001 format('DF:'i5,f8.2,f12.3) - return end subroutine peakdf9 diff --git a/lib/peakdt9.f90 b/lib/peakdt9.f90 index 0d635ada1..a4178aef7 100644 --- a/lib/peakdt9.f90 +++ b/lib/peakdt9.f90 @@ -1,4 +1,4 @@ -subroutine peakdt9(c0,npts8,nsps8,istart,foffset,idt) +subroutine peakdt9(c0,npts8,nsps8,istart,foffset,idtpk) complex c0(0:npts8-1) complex zsum @@ -10,15 +10,15 @@ subroutine peakdt9(c0,npts8,nsps8,istart,foffset,idt) f0=foffset dphi=twopi*f0/1500.0 - do idt=-10,10 - i0=istart + 0.1*nsps8*idt + do idt=-5,5 + i0=istart + 0.0625*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 + if(i.lt.0 .or. i.gt.npts8-1) cycle phi=phi + dphi zsum=zsum + c0(i) * cmplx(cos(phi),-sin(phi)) enddo @@ -30,9 +30,5 @@ subroutine peakdt9(c0,npts8,nsps8,istart,foffset,idt) endif enddo - tpk=idtpk/1500.0 - write(*,3001) idtpk,tpk,smax -3001 format('DT:'i5,f8.2,f12.3) - return end subroutine peakdt9 diff --git a/lib/spec9.f90 b/lib/spec9.f90 index 2c1fc212d..d9487b333 100644 --- a/lib/spec9.f90 +++ b/lib/spec9.f90 @@ -1,4 +1,4 @@ -subroutine spec9(c0,npts8,nsps,f0a,lagpk,fpk,i1SoftSymbols) +subroutine spec9(c0,npts8,nsps,f0a,fpk,xdt,i1SoftSymbols) parameter (MAXFFT=31500) complex c0(0:npts8-1) @@ -22,13 +22,18 @@ subroutine spec9(c0,npts8,nsps,f0a,lagpk,fpk,i1SoftSymbols) nsps8=nsps/8 foffset=fpk-f0a istart=1520 - idt=0 - xdf=0. - call peakdf9(c0,npts8,nsps8,istart,foffset,xdf) + call peakdf9(c0,npts8,nsps8,istart,foffset,idf) + fpk=fpk + idf*0.1*1500.0/nsps8 + foffset=foffset + idf*0.1*1500.0/nsps8 call peakdt9(c0,npts8,nsps8,istart,foffset,idt) + istart=istart + 0.0625*nsps8*idt + xdt=istart/1500.0 - 1.0 +! write(*,3002) 0.0625*nsps8*idt/1500.0,idf*0.1*1500.0/nsps8 +!3002 format(2f8.2) - fshift=foffset + xdf + + fshift=foffset twopi=8.0*atan(1.0) dphi=twopi*fshift/1500.0 diff --git a/lib/sync9.f90 b/lib/sync9.f90 index 36b4c553e..946583f2e 100644 --- a/lib/sync9.f90 +++ b/lib/sync9.f90 @@ -1,4 +1,4 @@ -subroutine sync9(ss,tstep,f0a,df3,lagpk,fpk) +subroutine sync9(ss,tstep,f0a,df3,fpk) parameter (NSMAX=22000) !Max length of saved spectra real ss(184,NSMAX) diff --git a/mainwindow.cpp b/mainwindow.cpp index 2bf4637f1..c4f99779a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,4 +1,4 @@ -//------------------------------------------------------------ MainWindow +//----------------------------------------------------------- MainWindow #include "mainwindow.h" #include "ui_mainwindow.h" #include "devsetup.h"