diff --git a/CMakeLists.txt b/CMakeLists.txt index 4235643cd..d4f630f47 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -423,6 +423,7 @@ set (wsjt_FSRCS lib/gen65.f90 lib/gen9.f90 lib/geniscat.f90 + lib/genwave.f90 lib/ft8/genft8.f90 lib/qra/q65/genq65.f90 lib/genmsk_128_90.f90 diff --git a/displayWidgets.txt b/displayWidgets.txt index e23cc5e5d..2f176ae00 100644 --- a/displayWidgets.txt +++ b/displayWidgets.txt @@ -11,7 +11,7 @@ JT9+JT65 111010000001111000010000000000001000 JT65 111010000000111000010000000000001000 JT65/VHF 111110010000110110101100010000000000 QRA64 111110010110110110000000001000000000 -QRA65 111111010110110100010000001100000000 +Q65 111111010110110100011000001100000000 ISCAT 100111000000000110000000000000000000 MSK144 101111110100000000010001000000000000 WSPR 000000000000000001010000000000000000 diff --git a/lib/genwave.f90 b/lib/genwave.f90 new file mode 100644 index 000000000..7db4cc7de --- /dev/null +++ b/lib/genwave.f90 @@ -0,0 +1,52 @@ +subroutine genwave(itone,nsym,nsps,nwave,fsample,hmod,f0,icmplx,cwave,wave) + + real wave(nwave) + complex cwave(nwave) + integer hmod + integer itone(nsym) + logical ex + real*8 dt,phi,dphi,twopi,freq,baud + + dt=1.d0/fsample + twopi=8.d0*atan(1.d0) + baud=fsample/nsps + +! Calculate the audio waveform + phi=0.d0 + if(icmplx.le.0) wave=0. + if(icmplx.eq.1) cwave=0. + k=0 + do j=1,nsym + freq=f0 + itone(j)*hmod*baud + dphi=twopi*freq*dt + do i=1,nsps + k=k+1 + if(icmplx.eq.1) then + cwave(k)=cmplx(cos(phi),sin(phi)) + else + wave(k)=sin(phi) + endif + phi=phi+dphi + if(phi.gt.twopi) phi=phi-twopi + enddo + enddo + +!### TEMPORARY code to allow transmitting both A and B submodes + inquire(file='Q65_Tx2',exist=ex) + if(ex) then + k=0 + do j=1,nsym + freq=f0 + itone(j)*2.d0*hmod*baud + 500.d0 + dphi=twopi*freq*dt + do i=1,nsps + k=k+1 + wave(k)=0.5*(wave(k)+sin(phi)) + phi=phi+dphi + if(phi.gt.twopi) phi=phi-twopi + enddo + enddo + endif +!### + + return +end subroutine genwave diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 94ca0fff4..6566924e2 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -38,7 +38,7 @@ contains ! nsubmode Tone-spacing indicator, 0-4 for A-E ! nfqso Target signal frequency (Hz) ! ntol Search range around nfqso (Hz) -! ndepth Optional decoding level (???) +! ndepth Optional decoding level ! Output: sent to the callback routine for display to user use timer_module, only: timer diff --git a/lib/qra/q65/q65_loops.f90 b/lib/qra/q65/q65_loops.f90 index 0460fb621..e72b38dbb 100644 --- a/lib/qra/q65/q65_loops.f90 +++ b/lib/qra/q65/q65_loops.f90 @@ -33,8 +33,10 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode64,nsubmode,nFadingModel, & NN=63 napmin=99 baud=6000.0/nsps - - do iavg=0,1 + + maxavg=0 + if(iand(ndepth,16).ne.0) maxavg=1 + do iavg=0,maxavg if(iavg.eq.1) then idfmax=1 idtmax=1 diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 7476ab9e3..9c76fbe51 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -117,6 +117,9 @@ extern "C" { void gen_fst4wave_(int itone[], int* nsym, int* nsps, int* nwave, float* fsample, int* hmod, float* f0, int* icmplx, float xjunk[], float wave[]); + void genwave_(int itone[], int* nsym, int* nsps, int* nwave, float* fsample, + int* hmod, float* f0, int* icmplx, float xjunk[], float wave[]); + void gen4_(char* msg, int* ichk, char* msgsent, int itone[], int* itext, fortran_charlen_t, fortran_charlen_t); @@ -3991,6 +3994,20 @@ void MainWindow::guiUpdate() int i3=-1; int n3=-1; genq65_(message,&ichk,msgsent,const_cast(itone),&i3,&n3,37,37); + int nsps=1800; + if(m_TRperiod==30) nsps=3600; + if(m_TRperiod==60) nsps=7200; + if(m_TRperiod==120) nsps=16000; + if(m_TRperiod==300) nsps=41472; + int nsps4=4*nsps; //48000 Hz sampling + int nsym=85; + float fsample=48000.0; + int nwave=(nsym+2)*nsps4; + int icmplx=0; + int hmod=1; + float f0=ui->TxFreqSpinBox->value()-m_XIT; + genwave_(const_cast(itone),&nsym,&nsps4,&nwave, + &fsample,&hmod,&f0,&icmplx,foxcom_.wave,foxcom_.wave); } if(m_modeTx=="WSPR") genwspr_(message, msgsent, const_cast (itone), 22, 22); @@ -6416,7 +6433,7 @@ void MainWindow::on_actionQ65_triggered() m_wideGraph->setTxFreq(ui->TxFreqSpinBox->value()); switch_mode (Modes::Q65); // 012345678901234567890123456789012345 - displayWidgets(nWidgets("111111010110110100010000001100000000")); + displayWidgets(nWidgets("111111010110110100011000000100000000")); statusChanged(); } @@ -6770,8 +6787,6 @@ void MainWindow::on_actionInclude_averaging_toggled (bool checked) m_ndepth ^= (-checked ^ m_ndepth) & 0x00000010; } - - void MainWindow::on_actionInclude_correlation_toggled (bool checked) { m_ndepth ^= (-checked ^ m_ndepth) & 0x00000020; @@ -7321,8 +7336,9 @@ void MainWindow::transmit (double snr) if(m_TRperiod==60) nsps=7200; if(m_TRperiod==120) nsps=16000; if(m_TRperiod==300) nsps=41472; - int mode65=pow(2.0,double(m_nSubMode)); - toneSpacing=mode65*12000.0/nsps; +// int mode65=pow(2.0,double(m_nSubMode)); +// toneSpacing=mode65*12000.0/nsps; + toneSpacing=-4.0; Q_EMIT sendMessage (m_mode, NUM_Q65_SYMBOLS, double(nsps), ui->TxFreqSpinBox->value () - m_XIT, toneSpacing, m_soundOutput, m_config.audio_output_channel (), @@ -7563,13 +7579,13 @@ void MainWindow::on_sbFtol_valueChanged(int value) void::MainWindow::VHF_features_enabled(bool b) { - if(m_mode!="JT4" and m_mode!="JT65") b=false; + if(m_mode!="JT4" and m_mode!="JT65" and m_mode!="Q65") b=false; if(b and (ui->actionInclude_averaging->isChecked() or ui->actionInclude_correlation->isChecked())) { ui->actionDeepestDecode->setChecked (true); } ui->actionInclude_averaging->setVisible (b); - ui->actionInclude_correlation->setVisible (b); + ui->actionInclude_correlation->setVisible (b && m_mode!="Q65"); ui->actionMessage_averaging->setEnabled(b); ui->actionEnable_AP_DXcall->setVisible (m_mode=="QRA64"); ui->actionEnable_AP_JT65->setVisible (b && m_mode=="JT65");