summaryrefslogtreecommitdiff
path: root/lib/ft8/gen_ft8wave.f90
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2020-05-11 22:17:58 +0200
committerChristoph Berg <myon@debian.org>2020-05-11 22:17:58 +0200
commit32a41b1abe1a4aab0892c9c2051be6ba5b379f1e (patch)
treec6e107c1ee4d70610e43a7912e57c720334a08c7 /lib/ft8/gen_ft8wave.f90
parent08299e8b2bf50ba90daf570f57def529dd29d6e7 (diff)
New upstream version 2.2.0~rc1+repackupstream/2.2.0_rc1+repack
Diffstat (limited to 'lib/ft8/gen_ft8wave.f90')
-rw-r--r--lib/ft8/gen_ft8wave.f9024
1 files changed, 16 insertions, 8 deletions
diff --git a/lib/ft8/gen_ft8wave.f90 b/lib/ft8/gen_ft8wave.f90
index 10edc994..02e7fdbd 100644
--- a/lib/ft8/gen_ft8wave.f90
+++ b/lib/ft8/gen_ft8wave.f90
@@ -2,15 +2,15 @@ subroutine gen_ft8wave(itone,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave)
!
! generate ft8 waveform using Gaussian-filtered frequency pulses.
!
-
- parameter(MAX_SECONDS=20)
+ use timer_module, only: timer
+ parameter(MAX_SECONDS=20,NTAB=65536)
real wave(nwave)
- complex cwave(nwave)
+ complex cwave(nwave),ctab(0:NTAB-1)
real pulse(23040)
real dphi(0:(nsym+2)*nsps-1)
integer itone(nsym)
data ibt0/0/
- save pulse,twopi,dt,hmod,ibt0
+ save pulse,twopi,dt,hmod,ibt0,ctab
ibt=nint(10*bt)
if(ibt0.ne.ibt) then
@@ -23,6 +23,10 @@ subroutine gen_ft8wave(itone,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave)
pulse(i)=gfsk_pulse(bt,tt)
enddo
ibt0=nint(10*bt)
+ do i=0,NTAB-1
+ phi=i*twopi/NTAB
+ ctab(i)=cmplx(cos(phi),sin(phi))
+ enddo
endif
! Compute the smoothed frequency waveform.
@@ -40,19 +44,23 @@ subroutine gen_ft8wave(itone,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave)
! Calculate and insert the audio waveform
phi=0.0
- dphi = dphi + twopi*f0*dt !Shift frequency up by f0
+ dphi = dphi + twopi*f0*dt !Shift frequency up by f0
wave=0.
- if (icmplx .ne. 0) cwave=0. ! avoid writing to memory we may not have access to
+ if(icmplx .ne. 0) cwave=0. !Avoid writing to memory we may not have access to
+
+ call timer('gen_loop',0)
k=0
- do j=nsps,nsps+nwave-1 !Don't include dummy symbols
+ do j=nsps,nsps+nwave-1 !Don't include dummy symbols
k=k+1
if(icmplx.eq.0) then
wave(k)=sin(phi)
else
- cwave(k)=cmplx(cos(phi),sin(phi))
+ i=phi*float(NTAB)/twopi
+ cwave(k)=ctab(i)
endif
phi=mod(phi+dphi(j),twopi)
enddo
+ call timer('gen_loop',1)
! Apply envelope shaping to the first and last symbols
nramp=nint(nsps/8.0)