From aeddaeab9eae660ff53e28a562cb94f0b9e1e94e Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 21 Feb 2019 12:10:27 -0500 Subject: [PATCH] FT4 now transmits a waveform generated from Gaussian-filtered frequency changes. --- Modulator.cpp | 10 +++++++--- widgets/mainwindow.cpp | 15 +++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Modulator.cpp b/Modulator.cpp index c80889a7d..0b1b9a929 100644 --- a/Modulator.cpp +++ b/Modulator.cpp @@ -51,6 +51,9 @@ void Modulator::start (unsigned symbolsLength, double framesPerSymbol, // Time according to this computer which becomes our base time qint64 ms0 = QDateTime::currentMSecsSinceEpoch() % 86400000; +// qDebug() << "ModStart" << symbolsLength << framesPerSymbol +// << frequency << toneSpacing; + if(m_state != Idle) stop (); m_quickClose = false; @@ -90,7 +93,7 @@ void Modulator::start (unsigned symbolsLength, double framesPerSymbol, m_silentFrames = m_ic + m_frameRate / (1000 / delay_ms) - (mstr * (m_frameRate / 1000)); } if((symbolsLength==103 or symbolsLength==105) and framesPerSymbol==512 - and toneSpacing==12000.0/512.0) { + and (toneSpacing==12000.0/512.0 or toneSpacing==-2.0)) { //### FT4 parameters delay_ms=100; mstr=5000; @@ -300,8 +303,9 @@ qint64 Modulator::readData (char * data, qint64 maxSize) //Here's where we transmit from a precomputed wave[] array: if(m_toneSpacing < 0) sample=qRound(m_amp*foxcom_.wave[m_ic]); - -// if(m_ic < 100) qDebug() << "Mod C" << m_ic << m_amp << foxcom_.wave[m_ic] << sample; +// if(m_ic < 10) qDebug() << "Mod Tx" << m_ic << m_amp +// << foxcom_.wave[m_ic] << sample +// << m_toneSpacing; samples = load(postProcessSample(sample), samples); ++framesGenerated; diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index eb3fc2f82..616c8d257 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -102,6 +102,9 @@ extern "C" { void genft4_(char* msg, int* ichk, char* msgsent, int itone[], fortran_charlen_t, fortran_charlen_t); + void gen_ft4wave_(int itone[], int* nsym, int* nsps, float* fsample, float* f0, + float wave[], int* nwave); + void gen4_(char* msg, int* ichk, char* msgsent, int itone[], int* itext, fortran_charlen_t, fortran_charlen_t); @@ -6869,8 +6872,8 @@ void MainWindow::transmit (double snr) } if (m_modeTx == "FT4") { - toneSpacing=12000.0/512.0; -// if(SpecOp::FOX==m_config.special_op_id() and !m_tune) toneSpacing=-1; +// toneSpacing=12000.0/512.0; //Generate Tx waveform from itone[] array + toneSpacing=-2.0; //Transmit a pre-computed, filtered waveform. Q_EMIT sendMessage (NUM_FT4_SYMBOLS, 512.0, ui->TxFreqSpinBox->value() - m_XIT, toneSpacing, m_soundOutput, m_config.audio_output_channel (), @@ -8757,6 +8760,14 @@ void MainWindow::ft4_tx(int ntx) g_iptt = 1; setRig (); setXIT (ui->TxFreqSpinBox->value ()); + + int nsym=103; + int nsps=4*512; + float fsample=48000.0; + float f0=ui->TxFreqSpinBox->value() - m_XIT; + int nwave=(nsym+2)*nsps; + gen_ft4wave_(const_cast(itone),&nsym,&nsps,&fsample,&f0,foxcom_.wave,&nwave); + Q_EMIT m_config.transceiver_ptt (true); //Assert the PTT m_tx_when_ready = true; qint64 ms=QDateTime::currentMSecsSinceEpoch();