From 4acf8274198f380835019bae7922385b5bc4a411 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Sat, 14 Jan 2017 16:58:31 +0000 Subject: [PATCH] Use only one twkfreq routine. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/map65@7498 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- libm65/CMakeLists.txt | 2 -- libm65/decode1a.f90 | 2 +- libm65/qra64c.f90 | 2 +- libm65/twkfreq.f90 | 55 ++++++++++++++++++++----------------------- libm65/twkfreq2.f90 | 26 -------------------- mainwindow.cpp | 2 +- 6 files changed, 29 insertions(+), 60 deletions(-) delete mode 100644 libm65/twkfreq2.f90 diff --git a/libm65/CMakeLists.txt b/libm65/CMakeLists.txt index f8d7f456b..1a9422eed 100644 --- a/libm65/CMakeLists.txt +++ b/libm65/CMakeLists.txt @@ -133,8 +133,6 @@ set (FSRCS toxyz.f90 trimlist.f90 twkfreq.f90 - twkfreq2.f90 - zplot.f90 f77_wisdom.f ) diff --git a/libm65/decode1a.f90 b/libm65/decode1a.f90 index db8a7fc34..91cd8dec5 100644 --- a/libm65/decode1a.f90 +++ b/libm65/decode1a.f90 @@ -83,7 +83,7 @@ subroutine decode1a(dd,newdat,f0,nflip,mode65,nfast,nfsample,xpol, & ! accommodate the full JT65C bandwidth. call timer('twkfreq ',0) - call twkfreq(cx,cy,n5,a) + call twkfreq(cx,cy,n5,1378.125,a) call timer('twkfreq ',1) ! Compute spectrum at best polarization for each half symbol. diff --git a/libm65/qra64c.f90 b/libm65/qra64c.f90 index a2950cb5f..bbb069074 100644 --- a/libm65/qra64c.f90 +++ b/libm65/qra64c.f90 @@ -80,7 +80,7 @@ subroutine qra64c(cx,cy,nutc,nqd,ikhz,nfqso,ntol,xpol,mycall_12, & if(mode64.eq.1 .and. minsync.ge.0 .and. (sync-7.0).lt.minsync) go to 900 a=0. a(1)=-f0 - call twkfreq2(c00,c0,npts2,6000.0,a) + call twkfreq(c00,c0,npts2,6000.0,a) irc=-99 s3lim=20. diff --git a/libm65/twkfreq.f90 b/libm65/twkfreq.f90 index 7fc8ea0ff..7c240d529 100644 --- a/libm65/twkfreq.f90 +++ b/libm65/twkfreq.f90 @@ -1,29 +1,26 @@ -subroutine twkfreq(c4aa,c4bb,n5,a) - - complex c4aa(n5) - complex c4bb(n5) - real a(5) - complex w,wstep - data twopi/6.283185307/ - -! Apply AFC corrections to the c4aa and c4bb data - w=1.0 - wstep=1.0 - x0=0.5*(n5+1) - s=2.0/n5 - do i=1,n5 - x=s*(i-x0) - if(mod(i,1000).eq.1) then - p2=1.5*x*x - 0.5 -! p3=2.5*(x**3) - 1.5*x -! p4=4.375*(x**4) - 3.75*(x**2) + 0.375 - dphi=(a(1) + x*a(2) + p2*a(3)) * (twopi/1378.125) - wstep=cmplx(cos(dphi),sin(dphi)) - endif - w=w*wstep - c4aa(i)=w*c4aa(i) - c4bb(i)=w*c4bb(i) - enddo - - return -end subroutine twkfreq +subroutine twkfreq(c3,c4,npts,fsample,a) + + complex c3(npts) + complex c4(npts) + complex w,wstep + real a(3) + data twopi/6.283185307/ + +! Mix the complex signal + w=1.0 + wstep=1.0 + x0=0.5*(npts+1) + s=2.0/npts + do i=1,npts + x=s*(i-x0) + p2=1.5*x*x - 0.5 +! p3=2.5*(x**3) - 1.5*x +! p4=4.375*(x**4) - 3.75*(x**2) + 0.375 + dphi=(a(1) + x*a(2) + p2*a(3)) * (twopi/fsample) + wstep=cmplx(cos(dphi),sin(dphi)) + w=w*wstep + c4(i)=w*c3(i) + enddo + + return +end subroutine twkfreq diff --git a/libm65/twkfreq2.f90 b/libm65/twkfreq2.f90 deleted file mode 100644 index 2333d9fb2..000000000 --- a/libm65/twkfreq2.f90 +++ /dev/null @@ -1,26 +0,0 @@ -subroutine twkfreq2(c3,c4,npts,fsample,a) - - complex c3(npts) - complex c4(npts) - complex w,wstep - real a(3) - data twopi/6.283185307/ - -! Mix the complex signal - w=1.0 - wstep=1.0 - x0=0.5*(npts+1) - s=2.0/npts - do i=1,npts - x=s*(i-x0) - p2=1.5*x*x - 0.5 -! p3=2.5*(x**3) - 1.5*x -! p4=4.375*(x**4) - 3.75*(x**2) + 0.375 - dphi=(a(1) + x*a(2) + p2*a(3)) * (twopi/fsample) - wstep=cmplx(cos(dphi),sin(dphi)) - w=w*wstep - c4(i)=w*c3(i) - enddo - - return -end subroutine twkfreq2 diff --git a/mainwindow.cpp b/mainwindow.cpp index cd50442a2..dbbd80f1d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,4 +1,4 @@ -//------------------------------------------------------------- MainWindow +//--------------------------------------------------------------- MainWindow #include "mainwindow.h" #include "ui_mainwindow.h" #include "devsetup.h"