mirror of
				https://github.com/saitohirga/WSJT-X.git
				synced 2025-11-03 21:40:52 -05:00 
			
		
		
		
	Add facility to degrade S/N of data from .wav files.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6165 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
		
							parent
							
								
									65013559ed
								
							
						
					
					
						commit
						6fe67b1ddf
					
				@ -278,6 +278,7 @@ set (wsjt_FSRCS
 | 
				
			|||||||
  lib/decjt9.f90
 | 
					  lib/decjt9.f90
 | 
				
			||||||
  lib/deep4.f90
 | 
					  lib/deep4.f90
 | 
				
			||||||
  lib/deg2grid.f90
 | 
					  lib/deg2grid.f90
 | 
				
			||||||
 | 
					  lib/degrade_snr.f90
 | 
				
			||||||
  lib/demod64a.f90
 | 
					  lib/demod64a.f90
 | 
				
			||||||
  lib/determ.f90
 | 
					  lib/determ.f90
 | 
				
			||||||
  lib/downsam9.f90
 | 
					  lib/downsam9.f90
 | 
				
			||||||
 | 
				
			|||||||
@ -357,7 +357,6 @@ public:
 | 
				
			|||||||
  Q_SLOT void reject () override;
 | 
					  Q_SLOT void reject () override;
 | 
				
			||||||
  Q_SLOT void done (int) override;
 | 
					  Q_SLOT void done (int) override;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
  typedef QList<QAudioDeviceInfo> AudioDevices;
 | 
					  typedef QList<QAudioDeviceInfo> AudioDevices;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -521,6 +520,7 @@ private:
 | 
				
			|||||||
  qint32 id_interval_;
 | 
					  qint32 id_interval_;
 | 
				
			||||||
  qint32 ntrials_;
 | 
					  qint32 ntrials_;
 | 
				
			||||||
  qint32 aggressive_;
 | 
					  qint32 aggressive_;
 | 
				
			||||||
 | 
					  double degrade_;
 | 
				
			||||||
  bool id_after_73_;
 | 
					  bool id_after_73_;
 | 
				
			||||||
  bool tx_QSY_allowed_;
 | 
					  bool tx_QSY_allowed_;
 | 
				
			||||||
  bool spot_to_psk_reporter_;
 | 
					  bool spot_to_psk_reporter_;
 | 
				
			||||||
@ -601,6 +601,7 @@ QFont Configuration::decoded_text_font () const {return m_->decoded_text_font_;}
 | 
				
			|||||||
qint32 Configuration::id_interval () const {return m_->id_interval_;}
 | 
					qint32 Configuration::id_interval () const {return m_->id_interval_;}
 | 
				
			||||||
qint32 Configuration::ntrials() const {return m_->ntrials_;}
 | 
					qint32 Configuration::ntrials() const {return m_->ntrials_;}
 | 
				
			||||||
qint32 Configuration::aggressive() const {return m_->aggressive_;}
 | 
					qint32 Configuration::aggressive() const {return m_->aggressive_;}
 | 
				
			||||||
 | 
					double Configuration::degrade() const {return m_->degrade_;}
 | 
				
			||||||
bool Configuration::id_after_73 () const {return m_->id_after_73_;}
 | 
					bool Configuration::id_after_73 () const {return m_->id_after_73_;}
 | 
				
			||||||
bool Configuration::tx_QSY_allowed () const {return m_->tx_QSY_allowed_;}
 | 
					bool Configuration::tx_QSY_allowed () const {return m_->tx_QSY_allowed_;}
 | 
				
			||||||
bool Configuration::spot_to_psk_reporter () const {return m_->spot_to_psk_reporter_;}
 | 
					bool Configuration::spot_to_psk_reporter () const {return m_->spot_to_psk_reporter_;}
 | 
				
			||||||
@ -1026,6 +1027,7 @@ void Configuration::impl::initialize_models ()
 | 
				
			|||||||
  ui_->CW_id_interval_spin_box->setValue (id_interval_);  
 | 
					  ui_->CW_id_interval_spin_box->setValue (id_interval_);  
 | 
				
			||||||
  ui_->sbNtrials->setValue (ntrials_);
 | 
					  ui_->sbNtrials->setValue (ntrials_);
 | 
				
			||||||
  ui_->sbAggressive->setValue (aggressive_);
 | 
					  ui_->sbAggressive->setValue (aggressive_);
 | 
				
			||||||
 | 
					  ui_->sbDegrade->setValue (degrade_);
 | 
				
			||||||
  ui_->PTT_method_button_group->button (rig_params_.ptt_type)->setChecked (true);
 | 
					  ui_->PTT_method_button_group->button (rig_params_.ptt_type)->setChecked (true);
 | 
				
			||||||
  ui_->save_path_display_label->setText (save_directory_.absolutePath ());
 | 
					  ui_->save_path_display_label->setText (save_directory_.absolutePath ());
 | 
				
			||||||
  ui_->azel_path_display_label->setText (azel_directory_.absolutePath ());
 | 
					  ui_->azel_path_display_label->setText (azel_directory_.absolutePath ());
 | 
				
			||||||
@ -1158,7 +1160,6 @@ void Configuration::impl::read_settings ()
 | 
				
			|||||||
  id_interval_ = settings_->value ("IDint", 0).toInt ();
 | 
					  id_interval_ = settings_->value ("IDint", 0).toInt ();
 | 
				
			||||||
  ntrials_ = settings_->value ("nTrials", 6).toInt ();
 | 
					  ntrials_ = settings_->value ("nTrials", 6).toInt ();
 | 
				
			||||||
  aggressive_ = settings_->value ("Aggressive", 0).toInt ();
 | 
					  aggressive_ = settings_->value ("Aggressive", 0).toInt ();
 | 
				
			||||||
 | 
					 | 
				
			||||||
  save_directory_ = settings_->value ("SaveDir", default_save_directory_.absolutePath ()).toString ();
 | 
					  save_directory_ = settings_->value ("SaveDir", default_save_directory_.absolutePath ()).toString ();
 | 
				
			||||||
  azel_directory_ = settings_->value ("AzElDir", default_azel_directory_.absolutePath ()).toString ();
 | 
					  azel_directory_ = settings_->value ("AzElDir", default_azel_directory_.absolutePath ()).toString ();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -1741,6 +1742,7 @@ void Configuration::impl::accept ()
 | 
				
			|||||||
  id_interval_ = ui_->CW_id_interval_spin_box->value ();
 | 
					  id_interval_ = ui_->CW_id_interval_spin_box->value ();
 | 
				
			||||||
  ntrials_ = ui_->sbNtrials->value ();
 | 
					  ntrials_ = ui_->sbNtrials->value ();
 | 
				
			||||||
  aggressive_ = ui_->sbAggressive->value ();
 | 
					  aggressive_ = ui_->sbAggressive->value ();
 | 
				
			||||||
 | 
					  degrade_ = ui_->sbDegrade->value ();
 | 
				
			||||||
  id_after_73_ = ui_->CW_id_after_73_check_box->isChecked ();
 | 
					  id_after_73_ = ui_->CW_id_after_73_check_box->isChecked ();
 | 
				
			||||||
  tx_QSY_allowed_ = ui_->tx_QSY_check_box->isChecked ();
 | 
					  tx_QSY_allowed_ = ui_->tx_QSY_check_box->isChecked ();
 | 
				
			||||||
  monitor_off_at_startup_ = ui_->monitor_off_check_box->isChecked ();
 | 
					  monitor_off_at_startup_ = ui_->monitor_off_check_box->isChecked ();
 | 
				
			||||||
 | 
				
			|||||||
@ -93,6 +93,7 @@ public:
 | 
				
			|||||||
  qint32 id_interval () const;
 | 
					  qint32 id_interval () const;
 | 
				
			||||||
  qint32 ntrials() const;
 | 
					  qint32 ntrials() const;
 | 
				
			||||||
  qint32 aggressive() const;
 | 
					  qint32 aggressive() const;
 | 
				
			||||||
 | 
					  double degrade() const;
 | 
				
			||||||
  bool id_after_73 () const;
 | 
					  bool id_after_73 () const;
 | 
				
			||||||
  bool tx_QSY_allowed () const;
 | 
					  bool tx_QSY_allowed () const;
 | 
				
			||||||
  bool spot_to_psk_reporter () const;
 | 
					  bool spot_to_psk_reporter () const;
 | 
				
			||||||
 | 
				
			|||||||
@ -20,7 +20,7 @@
 | 
				
			|||||||
      <string>Select tab to change configuration parameters.</string>
 | 
					      <string>Select tab to change configuration parameters.</string>
 | 
				
			||||||
     </property>
 | 
					     </property>
 | 
				
			||||||
     <property name="currentIndex">
 | 
					     <property name="currentIndex">
 | 
				
			||||||
      <number>0</number>
 | 
					      <number>7</number>
 | 
				
			||||||
     </property>
 | 
					     </property>
 | 
				
			||||||
     <widget class="QWidget" name="general_tab">
 | 
					     <widget class="QWidget" name="general_tab">
 | 
				
			||||||
      <attribute name="title">
 | 
					      <attribute name="title">
 | 
				
			||||||
@ -2127,7 +2127,7 @@ Right click for insert and delete options.</string>
 | 
				
			|||||||
      <attribute name="title">
 | 
					      <attribute name="title">
 | 
				
			||||||
       <string>Advanced</string>
 | 
					       <string>Advanced</string>
 | 
				
			||||||
      </attribute>
 | 
					      </attribute>
 | 
				
			||||||
      <layout class="QGridLayout" name="gridLayout_15">
 | 
					      <layout class="QGridLayout" name="gridLayout_9">
 | 
				
			||||||
       <item row="0" column="0">
 | 
					       <item row="0" column="0">
 | 
				
			||||||
        <widget class="QGroupBox" name="groupBox_5">
 | 
					        <widget class="QGroupBox" name="groupBox_5">
 | 
				
			||||||
         <property name="toolTip">
 | 
					         <property name="toolTip">
 | 
				
			||||||
@ -2268,6 +2268,33 @@ Right click for insert and delete options.</string>
 | 
				
			|||||||
              </property>
 | 
					              </property>
 | 
				
			||||||
             </widget>
 | 
					             </widget>
 | 
				
			||||||
            </item>
 | 
					            </item>
 | 
				
			||||||
 | 
					            <item row="1" column="0" colspan="2">
 | 
				
			||||||
 | 
					             <layout class="QHBoxLayout" name="horizontalLayout_12">
 | 
				
			||||||
 | 
					              <item>
 | 
				
			||||||
 | 
					               <widget class="QLabel" name="label_3">
 | 
				
			||||||
 | 
					                <property name="text">
 | 
				
			||||||
 | 
					                 <string>Degrade S/N of .wav file: </string>
 | 
				
			||||||
 | 
					                </property>
 | 
				
			||||||
 | 
					                <property name="buddy">
 | 
				
			||||||
 | 
					                 <cstring>sbDegrade</cstring>
 | 
				
			||||||
 | 
					                </property>
 | 
				
			||||||
 | 
					               </widget>
 | 
				
			||||||
 | 
					              </item>
 | 
				
			||||||
 | 
					              <item>
 | 
				
			||||||
 | 
					               <widget class="QDoubleSpinBox" name="sbDegrade">
 | 
				
			||||||
 | 
					                <property name="suffix">
 | 
				
			||||||
 | 
					                 <string> dB</string>
 | 
				
			||||||
 | 
					                </property>
 | 
				
			||||||
 | 
					                <property name="decimals">
 | 
				
			||||||
 | 
					                 <number>1</number>
 | 
				
			||||||
 | 
					                </property>
 | 
				
			||||||
 | 
					                <property name="singleStep">
 | 
				
			||||||
 | 
					                 <double>0.100000000000000</double>
 | 
				
			||||||
 | 
					                </property>
 | 
				
			||||||
 | 
					               </widget>
 | 
				
			||||||
 | 
					              </item>
 | 
				
			||||||
 | 
					             </layout>
 | 
				
			||||||
 | 
					            </item>
 | 
				
			||||||
           </layout>
 | 
					           </layout>
 | 
				
			||||||
          </item>
 | 
					          </item>
 | 
				
			||||||
         </layout>
 | 
					         </layout>
 | 
				
			||||||
@ -2286,7 +2313,7 @@ Right click for insert and delete options.</string>
 | 
				
			|||||||
         </property>
 | 
					         </property>
 | 
				
			||||||
        </spacer>
 | 
					        </spacer>
 | 
				
			||||||
       </item>
 | 
					       </item>
 | 
				
			||||||
       <item row="1" column="0" colspan="2">
 | 
					       <item row="1" column="0">
 | 
				
			||||||
        <spacer name="verticalSpacer_8">
 | 
					        <spacer name="verticalSpacer_8">
 | 
				
			||||||
         <property name="orientation">
 | 
					         <property name="orientation">
 | 
				
			||||||
          <enum>Qt::Vertical</enum>
 | 
					          <enum>Qt::Vertical</enum>
 | 
				
			||||||
@ -2468,12 +2495,12 @@ soundcard changes</string>
 | 
				
			|||||||
  </connection>
 | 
					  </connection>
 | 
				
			||||||
 </connections>
 | 
					 </connections>
 | 
				
			||||||
 <buttongroups>
 | 
					 <buttongroups>
 | 
				
			||||||
  <buttongroup name="CAT_handshake_button_group"/>
 | 
					 | 
				
			||||||
  <buttongroup name="split_mode_button_group"/>
 | 
					  <buttongroup name="split_mode_button_group"/>
 | 
				
			||||||
  <buttongroup name="CAT_data_bits_button_group"/>
 | 
					 | 
				
			||||||
  <buttongroup name="TX_audio_source_button_group"/>
 | 
					 | 
				
			||||||
  <buttongroup name="TX_mode_button_group"/>
 | 
					  <buttongroup name="TX_mode_button_group"/>
 | 
				
			||||||
  <buttongroup name="CAT_stop_bits_button_group"/>
 | 
					 | 
				
			||||||
  <buttongroup name="PTT_method_button_group"/>
 | 
					  <buttongroup name="PTT_method_button_group"/>
 | 
				
			||||||
 | 
					  <buttongroup name="TX_audio_source_button_group"/>
 | 
				
			||||||
 | 
					  <buttongroup name="CAT_stop_bits_button_group"/>
 | 
				
			||||||
 | 
					  <buttongroup name="CAT_handshake_button_group"/>
 | 
				
			||||||
 | 
					  <buttongroup name="CAT_data_bits_button_group"/>
 | 
				
			||||||
 </buttongroups>
 | 
					 </buttongroups>
 | 
				
			||||||
</ui>
 | 
					</ui>
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										31
									
								
								lib/fqso_first.f90
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								lib/fqso_first.f90
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,31 @@
 | 
				
			|||||||
 | 
					subroutine fqso_first(nfqso,ntol,ca,ncand)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					! If a candidate was found within +/- ntol of nfqso, move it into ca(1).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  type candidate
 | 
				
			||||||
 | 
					     real freq
 | 
				
			||||||
 | 
					     real dt
 | 
				
			||||||
 | 
					     real sync
 | 
				
			||||||
 | 
					  end type candidate
 | 
				
			||||||
 | 
					  type(candidate) ca(300),cb
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  dmin=1.e30
 | 
				
			||||||
 | 
					  i0=0
 | 
				
			||||||
 | 
					  do i=1,ncand
 | 
				
			||||||
 | 
					     d=abs(ca(i)%freq-nfqso)
 | 
				
			||||||
 | 
					     if(d.lt.dmin) then
 | 
				
			||||||
 | 
					        i0=i
 | 
				
			||||||
 | 
					        dmin=d
 | 
				
			||||||
 | 
					     endif
 | 
				
			||||||
 | 
					  enddo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if(dmin.lt.float(ntol)) then
 | 
				
			||||||
 | 
					     cb=ca(i0)
 | 
				
			||||||
 | 
					     do i=i0,2,-1
 | 
				
			||||||
 | 
					        ca(i)=ca(i-1)
 | 
				
			||||||
 | 
					     enddo
 | 
				
			||||||
 | 
					     ca(1)=cb
 | 
				
			||||||
 | 
					  endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return
 | 
				
			||||||
 | 
					end subroutine fqso_first
 | 
				
			||||||
@ -1531,6 +1531,9 @@ void MainWindow::diskDat()                                   //diskDat()
 | 
				
			|||||||
  int kstep=3456;
 | 
					  int kstep=3456;
 | 
				
			||||||
  m_diskData=true;
 | 
					  m_diskData=true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  float db=m_config.degrade();
 | 
				
			||||||
 | 
					  if(db > 0.0) degrade_snr_(jt9com_.d2,&jt9com_.kin,&db);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  for(int n=1; n<=m_hsymStop; n++) {                      // Do the waterfall spectra
 | 
					  for(int n=1; n<=m_hsymStop; n++) {                      // Do the waterfall spectra
 | 
				
			||||||
    k=(n+1)*kstep;
 | 
					    k=(n+1)*kstep;
 | 
				
			||||||
    if(k > jt9com_.kin) break;
 | 
					    if(k > jt9com_.kin) break;
 | 
				
			||||||
 | 
				
			|||||||
@ -604,6 +604,7 @@ extern "C" {
 | 
				
			|||||||
                float* width);
 | 
					                float* width);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  void fast_decode_(short id2[], int narg[], char msg[], int len);
 | 
					  void fast_decode_(short id2[], int narg[], char msg[], int len);
 | 
				
			||||||
 | 
					  void degrade_snr_(short d2[], int* n, float* db);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif // MAINWINDOW_H
 | 
					#endif // MAINWINDOW_H
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user