mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-04 05:50:31 -05:00 
			
		
		
		
	FT4 now transmits a waveform generated from Gaussian-filtered frequency changes.
This commit is contained in:
		
							parent
							
								
									57a20f838f
								
							
						
					
					
						commit
						aeddaeab9e
					
				@ -51,6 +51,9 @@ void Modulator::start (unsigned symbolsLength, double framesPerSymbol,
 | 
				
			|||||||
// Time according to this computer which becomes our base time
 | 
					// Time according to this computer which becomes our base time
 | 
				
			||||||
  qint64 ms0 = QDateTime::currentMSecsSinceEpoch() % 86400000;
 | 
					  qint64 ms0 = QDateTime::currentMSecsSinceEpoch() % 86400000;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					//  qDebug() << "ModStart" << symbolsLength << framesPerSymbol
 | 
				
			||||||
 | 
					//           << frequency << toneSpacing;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if(m_state != Idle) stop ();
 | 
					  if(m_state != Idle) stop ();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  m_quickClose = false;
 | 
					  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));
 | 
					    m_silentFrames = m_ic + m_frameRate / (1000 / delay_ms) - (mstr * (m_frameRate / 1000));
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  if((symbolsLength==103 or symbolsLength==105) and framesPerSymbol==512
 | 
					  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
 | 
					//### FT4 parameters
 | 
				
			||||||
    delay_ms=100;
 | 
					    delay_ms=100;
 | 
				
			||||||
    mstr=5000;
 | 
					    mstr=5000;
 | 
				
			||||||
@ -300,8 +303,9 @@ qint64 Modulator::readData (char * data, qint64 maxSize)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
//Here's where we transmit from a precomputed wave[] array:
 | 
					//Here's where we transmit from a precomputed wave[] array:
 | 
				
			||||||
          if(m_toneSpacing < 0) sample=qRound(m_amp*foxcom_.wave[m_ic]);
 | 
					          if(m_toneSpacing < 0) sample=qRound(m_amp*foxcom_.wave[m_ic]);
 | 
				
			||||||
 | 
					//          if(m_ic < 10) qDebug() << "Mod Tx" << m_ic << m_amp
 | 
				
			||||||
//          if(m_ic < 100) qDebug() << "Mod C" << m_ic << m_amp << foxcom_.wave[m_ic] << sample;
 | 
					//                                  << foxcom_.wave[m_ic] << sample
 | 
				
			||||||
 | 
					//                                  << m_toneSpacing;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
          samples = load(postProcessSample(sample), samples);
 | 
					          samples = load(postProcessSample(sample), samples);
 | 
				
			||||||
          ++framesGenerated;
 | 
					          ++framesGenerated;
 | 
				
			||||||
 | 
				
			|||||||
@ -102,6 +102,9 @@ extern "C" {
 | 
				
			|||||||
  void genft4_(char* msg, int* ichk, char* msgsent, int itone[],
 | 
					  void genft4_(char* msg, int* ichk, char* msgsent, int itone[],
 | 
				
			||||||
               fortran_charlen_t, fortran_charlen_t);
 | 
					               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[],
 | 
					  void gen4_(char* msg, int* ichk, char* msgsent, int itone[],
 | 
				
			||||||
               int* itext, fortran_charlen_t, fortran_charlen_t);
 | 
					               int* itext, fortran_charlen_t, fortran_charlen_t);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -6869,8 +6872,8 @@ void MainWindow::transmit (double snr)
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (m_modeTx == "FT4") {
 | 
					  if (m_modeTx == "FT4") {
 | 
				
			||||||
    toneSpacing=12000.0/512.0;
 | 
					//    toneSpacing=12000.0/512.0;        //Generate Tx waveform from itone[] array
 | 
				
			||||||
//    if(SpecOp::FOX==m_config.special_op_id() and !m_tune) toneSpacing=-1;
 | 
					    toneSpacing=-2.0;                     //Transmit a pre-computed, filtered waveform.
 | 
				
			||||||
    Q_EMIT sendMessage (NUM_FT4_SYMBOLS,
 | 
					    Q_EMIT sendMessage (NUM_FT4_SYMBOLS,
 | 
				
			||||||
           512.0, ui->TxFreqSpinBox->value() - m_XIT,
 | 
					           512.0, ui->TxFreqSpinBox->value() - m_XIT,
 | 
				
			||||||
           toneSpacing, m_soundOutput, m_config.audio_output_channel (),
 | 
					           toneSpacing, m_soundOutput, m_config.audio_output_channel (),
 | 
				
			||||||
@ -8757,6 +8760,14 @@ void MainWindow::ft4_tx(int ntx)
 | 
				
			|||||||
  g_iptt = 1;
 | 
					  g_iptt = 1;
 | 
				
			||||||
  setRig ();
 | 
					  setRig ();
 | 
				
			||||||
  setXIT (ui->TxFreqSpinBox->value ());
 | 
					  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<int *>(itone),&nsym,&nsps,&fsample,&f0,foxcom_.wave,&nwave);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Q_EMIT m_config.transceiver_ptt (true);            //Assert the PTT
 | 
					  Q_EMIT m_config.transceiver_ptt (true);            //Assert the PTT
 | 
				
			||||||
  m_tx_when_ready = true;
 | 
					  m_tx_when_ready = true;
 | 
				
			||||||
  qint64 ms=QDateTime::currentMSecsSinceEpoch();
 | 
					  qint64 ms=QDateTime::currentMSecsSinceEpoch();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user