summaryrefslogtreecommitdiff
path: root/lib/ft8/twkfreq1.f90
diff options
context:
space:
mode:
authorEnrico Rossi <e.rossi@tecnobrain.com>2018-11-03 17:52:26 +0100
committerEnrico Rossi <e.rossi@tecnobrain.com>2018-11-03 17:52:26 +0100
commitb4aebf2d137b892f53503b13785ecae900062ff7 (patch)
tree3ba99b2baec2292f2e13bfe90a5e401a5f4c47a5 /lib/ft8/twkfreq1.f90
parent37f727ac0746fd85504aa46c1f023c09b3eff33a (diff)
New upstream version 1.9.1+repackupstream/1.9.1+repack
* Drop local hamlib copy (commit d1b545be). * Drop local boost copy (1.63.0).
Diffstat (limited to 'lib/ft8/twkfreq1.f90')
-rw-r--r--lib/ft8/twkfreq1.f9026
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/ft8/twkfreq1.f90 b/lib/ft8/twkfreq1.f90
new file mode 100644
index 00000000..e6aa8f8b
--- /dev/null
+++ b/lib/ft8/twkfreq1.f90
@@ -0,0 +1,26 @@
+subroutine twkfreq1(ca,npts,fsample,a,cb)
+
+ complex ca(npts)
+ complex cb(npts)
+ complex w,wstep
+ real a(5)
+ 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) + p3*a(4) + p4*a(5)) * (twopi/fsample)
+ wstep=cmplx(cos(dphi),sin(dphi))
+ w=w*wstep
+ cb(i)=w*ca(i)
+ enddo
+
+ return
+end subroutine twkfreq1