From cd8ea16f4076b9adb6d95f04b122a1b20323696a Mon Sep 17 00:00:00 2001 From: Steve Franke Date: Fri, 12 Apr 2019 17:11:26 -0500 Subject: [PATCH] FT8: Use GFSK waveform with BT=4.0 as reference for subtraction, for now. May want to change to BT=2.0 before v2.1 release? --- lib/ft8/ft8sim_gfsk.f90 | 3 ++- lib/ft8/gen_ft8wave.f90 | 13 ++++++------- lib/ft8/subtractft8.f90 | 12 +++++++++--- widgets/mainwindow.cpp | 5 +++-- 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lib/ft8/ft8sim_gfsk.f90 b/lib/ft8/ft8sim_gfsk.f90 index aba046cef..4cca67e48 100644 --- a/lib/ft8/ft8sim_gfsk.f90 +++ b/lib/ft8/ft8sim_gfsk.f90 @@ -57,6 +57,7 @@ program ft8sim_gfsk baud=1.0/tt !Keying rate (baud) bw=8*baud !Occupied bandwidth (Hz) txt=NZ*dt !Transmission length (s) + bt=2.0 bandwidth_ratio=2500.0/(fs/2.0) sig=sqrt(2*bandwidth_ratio) * 10.0**(0.05*snrdb) if(snrdb.gt.90.0) sig=1.0 @@ -67,7 +68,7 @@ program ft8sim_gfsk n3=-1 call pack77(msg37,i3,n3,c77) call genft8(msg37,i3,n3,msgsent37,msgbits,itone) - call gen_ft8wave(itone,NN,NSPS,fs,f0,cwave,xjunk,1,NWAVE) !Generate complex cwave + call gen_ft8wave(itone,NN,NSPS,bt,fs,f0,cwave,xjunk,1,NWAVE) !Generate complex cwave write(*,*) write(*,'(a23,a37,3x,a7,i1,a1,i1)') 'New Style FT8 Message: ',msgsent37,'i3.n3: ',i3,'.',n3 diff --git a/lib/ft8/gen_ft8wave.f90 b/lib/ft8/gen_ft8wave.f90 index d4b58a426..9dc25812c 100644 --- a/lib/ft8/gen_ft8wave.f90 +++ b/lib/ft8/gen_ft8wave.f90 @@ -1,4 +1,4 @@ -subroutine gen_ft8wave(itone,nsym,nsps,fsample,f0,cwave,wave,icmplx,nwave) +subroutine gen_ft8wave(itone,nsym,nsps,bt,fsample,f0,cwave,wave,icmplx,nwave) ! ! generate ft8 waveform using Gaussian-filtered frequency pulses. ! @@ -9,21 +9,20 @@ subroutine gen_ft8wave(itone,nsym,nsps,fsample,f0,cwave,wave,icmplx,nwave) real pulse(23040) real dphi(0:(nsym+2)*nsps-1) integer itone(nsym) - logical first - data first/.true./ - save pulse,first,twopi,dt,hmod + data first/.true./,ibt0/0/ + save pulse,twopi,dt,hmod,ibt0 - if(first) then + ibt=nint(10*bt) + if(ibt0.ne.ibt) then twopi=8.0*atan(1.0) dt=1.0/fsample hmod=1.0 - bt=2.0 ! Compute the frequency-smoothing pulse do i=1,3*nsps tt=(i-1.5*nsps)/real(nsps) pulse(i)=gfsk_pulse(bt,tt) enddo - first=.false. + ibt0=nint(10*bt) endif ! Compute the smoothed frequency waveform. diff --git a/lib/ft8/subtractft8.f90 b/lib/ft8/subtractft8.f90 index 1031cf2b7..200139a2b 100644 --- a/lib/ft8/subtractft8.f90 +++ b/lib/ft8/subtractft8.f90 @@ -11,16 +11,22 @@ subroutine subtractft8(dd,itone,f0,dt) parameter (NMAX=15*12000,NFRAME=1920*79) parameter (NFFT=NMAX,NFILT=1400) - real*4 dd(NMAX), window(-NFILT/2:NFILT/2) + real*4 dd(NMAX), window(-NFILT/2:NFILT/2), xjunk complex cref,camp,cfilt,cw integer itone(79) logical first data first/.true./ - common/heap8/cref(NFRAME),camp(NMAX),cfilt(NMAX),cw(NMAX) + common/heap8/cref(NFRAME),camp(NMAX),cfilt(NMAX),cw(NMAX),xjunk(NFRAME) save first nstart=dt*12000+1 - call genft8refsig(itone,cref,f0) +! call genft8refsig(itone,cref,f0) + nsym=79 + nsps=1920 + fs=12000.0 + icmplx=1 + bt=4.0 ! Temporary compromise? + call gen_ft8wave(itone,nsym,nsps,bt,fs,f0,cref,xjunk,icmplx,NFRAME) camp=0. do i=1,nframe id=nstart-1+i diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index e9c0fa031..8aec20d19 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -102,7 +102,7 @@ extern "C" { void genft4_(char* msg, int* ichk, char* msgsent, int itone[], fortran_charlen_t, fortran_charlen_t); - void gen_ft8wave_(int itone[], int* nsym, int* nsps, float* fsample, float* f0, + void gen_ft8wave_(int itone[], int* nsym, int* nsps, float* bt, float* fsample, float* f0, float xjunk[], float wave[], int* icmplx, int* nwave); void gen_ft4wave_(int itone[], int* nsym, int* nsps, float* fsample, float* f0, @@ -3701,10 +3701,11 @@ void MainWindow::guiUpdate() int nsym=79; int nsps=4*1920; float fsample=48000.0; + float bt=2.0; float f0=ui->TxFreqSpinBox->value() - m_XIT; int icmplx=0; int nwave=nsym*nsps; - gen_ft8wave_(const_cast(itone),&nsym,&nsps,&fsample,&f0,foxcom_.wave, + gen_ft8wave_(const_cast(itone),&nsym,&nsps,&bt,&fsample,&f0,foxcom_.wave, foxcom_.wave,&icmplx,&nwave); if(SpecOp::FOX == m_config.special_op_id()) {