mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-03 13:11:20 -05:00 
			
		
		
		
	ATV Modulator: adjustable vestigial sideband ratio
This commit is contained in:
		
							parent
							
								
									df88215798
								
							
						
					
					
						commit
						d513b222e6
					
				@ -105,7 +105,8 @@ void ATVMod::configure(MessageQueue* messageQueue,
 | 
			
		||||
            bool videoPlayLoop,
 | 
			
		||||
            bool videoPlay,
 | 
			
		||||
            bool cameraPlay,
 | 
			
		||||
            bool channelMute)
 | 
			
		||||
            bool channelMute,
 | 
			
		||||
            Real vestigialRatio)
 | 
			
		||||
{
 | 
			
		||||
    Message* cmd = MsgConfigureATVMod::create(
 | 
			
		||||
            rfBandwidth,
 | 
			
		||||
@ -116,7 +117,8 @@ void ATVMod::configure(MessageQueue* messageQueue,
 | 
			
		||||
            videoPlayLoop,
 | 
			
		||||
            videoPlay,
 | 
			
		||||
            cameraPlay,
 | 
			
		||||
            channelMute);
 | 
			
		||||
            channelMute,
 | 
			
		||||
            vestigialRatio);
 | 
			
		||||
    messageQueue->push(cmd);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -238,7 +240,7 @@ Complex& ATVMod::modulateVestigialSSB(Real& sample)
 | 
			
		||||
    Complex ci(sample, 0.0f);
 | 
			
		||||
    fftfilt::cmplx *filtered;
 | 
			
		||||
 | 
			
		||||
    n_out = m_DSBFilter->runVestigial(ci, &filtered, m_running.m_atvModulation == ATVModulationVestigialUSB, 0.15f);
 | 
			
		||||
    n_out = m_DSBFilter->runVestigial(ci, &filtered, m_running.m_atvModulation == ATVModulationVestigialUSB, m_running.m_vestigialRatio);
 | 
			
		||||
 | 
			
		||||
    if (n_out > 0)
 | 
			
		||||
    {
 | 
			
		||||
@ -518,6 +520,7 @@ bool ATVMod::handleMessage(const Message& cmd)
 | 
			
		||||
        m_config.m_videoPlay = cfg.getVideoPlay();
 | 
			
		||||
        m_config.m_cameraPlay = cfg.getCameraPlay();
 | 
			
		||||
        m_config.m_channelMute = cfg.getChannelMute();
 | 
			
		||||
        m_config.m_vestigialRatio = cfg.getVestigialRatio();
 | 
			
		||||
 | 
			
		||||
        apply();
 | 
			
		||||
 | 
			
		||||
@ -530,7 +533,8 @@ bool ATVMod::handleMessage(const Message& cmd)
 | 
			
		||||
				<< " m_videoPlayLoop: " << m_config.m_videoPlayLoop
 | 
			
		||||
				<< " m_videoPlay: " << m_config.m_videoPlay
 | 
			
		||||
				<< " m_cameraPlay: " << m_config.m_cameraPlay
 | 
			
		||||
				<< " m_channelMute: " << m_config.m_channelMute;
 | 
			
		||||
				<< " m_channelMute: " << m_config.m_channelMute
 | 
			
		||||
				<< " m_vestigialRatio: " << m_config.m_vestigialRatio;
 | 
			
		||||
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
@ -677,6 +681,7 @@ void ATVMod::apply(bool force)
 | 
			
		||||
    m_running.m_videoPlay = m_config.m_videoPlay;
 | 
			
		||||
    m_running.m_cameraPlay = m_config.m_cameraPlay;
 | 
			
		||||
    m_running.m_channelMute = m_config.m_channelMute;
 | 
			
		||||
    m_running.m_vestigialRatio = m_config.m_vestigialRatio;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int ATVMod::getSampleRateUnits(ATVStd std)
 | 
			
		||||
 | 
			
		||||
@ -315,7 +315,8 @@ public:
 | 
			
		||||
			bool videoPlayLoop,
 | 
			
		||||
			bool videoPlay,
 | 
			
		||||
			bool cameraPLay,
 | 
			
		||||
            bool channelMute);
 | 
			
		||||
            bool channelMute,
 | 
			
		||||
            Real vestigialRatio);
 | 
			
		||||
 | 
			
		||||
    virtual void pull(Sample& sample);
 | 
			
		||||
    virtual void pullAudio(int nbSamples); // this is used for video signal actually
 | 
			
		||||
@ -353,6 +354,7 @@ private:
 | 
			
		||||
        bool getVideoPlay() const { return m_videoPlay; }
 | 
			
		||||
        bool getCameraPlay() const { return m_cameraPlay; }
 | 
			
		||||
        bool getChannelMute() const { return m_channelMute; }
 | 
			
		||||
        Real getVestigialRatio() const { return m_vestigialRatio; }
 | 
			
		||||
 | 
			
		||||
        static MsgConfigureATVMod* create(
 | 
			
		||||
            Real rfBandwidth,
 | 
			
		||||
@ -363,7 +365,8 @@ private:
 | 
			
		||||
			bool videoPlayLoop,
 | 
			
		||||
			bool videoPlay,
 | 
			
		||||
			bool cameraPlay,
 | 
			
		||||
			bool channelMute)
 | 
			
		||||
			bool channelMute,
 | 
			
		||||
			Real vestigialRatio)
 | 
			
		||||
        {
 | 
			
		||||
            return new MsgConfigureATVMod(
 | 
			
		||||
                    rfBandwidth,
 | 
			
		||||
@ -374,7 +377,8 @@ private:
 | 
			
		||||
                    videoPlayLoop,
 | 
			
		||||
                    videoPlay,
 | 
			
		||||
                    cameraPlay,
 | 
			
		||||
					channelMute);
 | 
			
		||||
					channelMute,
 | 
			
		||||
					vestigialRatio);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    private:
 | 
			
		||||
@ -387,6 +391,7 @@ private:
 | 
			
		||||
        bool          m_videoPlay;
 | 
			
		||||
        bool          m_cameraPlay;
 | 
			
		||||
        bool          m_channelMute;
 | 
			
		||||
        Real          m_vestigialRatio;
 | 
			
		||||
 | 
			
		||||
        MsgConfigureATVMod(
 | 
			
		||||
                Real rfBandwidth,
 | 
			
		||||
@ -397,7 +402,8 @@ private:
 | 
			
		||||
				bool videoPlayLoop,
 | 
			
		||||
				bool videoPlay,
 | 
			
		||||
				bool cameraPlay,
 | 
			
		||||
				bool channelMute) :
 | 
			
		||||
				bool channelMute,
 | 
			
		||||
				Real vestigialRatio) :
 | 
			
		||||
            Message(),
 | 
			
		||||
            m_rfBandwidth(rfBandwidth),
 | 
			
		||||
            m_atvStd(atvStd),
 | 
			
		||||
@ -407,7 +413,8 @@ private:
 | 
			
		||||
			m_videoPlayLoop(videoPlayLoop),
 | 
			
		||||
			m_videoPlay(videoPlay),
 | 
			
		||||
			m_cameraPlay(cameraPlay),
 | 
			
		||||
			m_channelMute(channelMute)
 | 
			
		||||
			m_channelMute(channelMute),
 | 
			
		||||
			m_vestigialRatio(vestigialRatio)
 | 
			
		||||
        { }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
@ -452,6 +459,7 @@ private:
 | 
			
		||||
        bool          m_videoPlay;            //!< True to play video and false to pause
 | 
			
		||||
        bool          m_cameraPlay;           //!< True to play camera video and false to pause
 | 
			
		||||
        bool          m_channelMute;          //!< Mute channel baseband output
 | 
			
		||||
        Real          m_vestigialRatio;       //!< Vestigial sideband ratio to half bandwidth
 | 
			
		||||
 | 
			
		||||
        Config() :
 | 
			
		||||
            m_outputSampleRate(-1),
 | 
			
		||||
@ -464,7 +472,8 @@ private:
 | 
			
		||||
			m_videoPlayLoop(false),
 | 
			
		||||
			m_videoPlay(false),
 | 
			
		||||
			m_cameraPlay(false),
 | 
			
		||||
			m_channelMute(false)
 | 
			
		||||
			m_channelMute(false),
 | 
			
		||||
			m_vestigialRatio(0.1f)
 | 
			
		||||
        { }
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -76,6 +76,7 @@ void ATVModGUI::resetToDefaults()
 | 
			
		||||
	ui->inputSelect->setCurrentIndex(0);
 | 
			
		||||
	ui->deltaFrequency->setValue(0);
 | 
			
		||||
	ui->modulation->setCurrentIndex(0);
 | 
			
		||||
	ui->vestigial->setValue(10);
 | 
			
		||||
 | 
			
		||||
	blockApplySettings(false);
 | 
			
		||||
	applySettings();
 | 
			
		||||
@ -91,6 +92,7 @@ QByteArray ATVModGUI::serialize() const
 | 
			
		||||
	s.writeS32(4, ui->standard->currentIndex());
 | 
			
		||||
    s.writeS32(5, ui->inputSelect->currentIndex());
 | 
			
		||||
	s.writeU32(6, m_channelMarker.getColor().rgb());
 | 
			
		||||
	s.writeS32(7, ui->vestigial->value());
 | 
			
		||||
    s.writeS32(8, ui->modulation->currentIndex());
 | 
			
		||||
 | 
			
		||||
	return s.final();
 | 
			
		||||
@ -131,6 +133,8 @@ bool ATVModGUI::deserialize(const QByteArray& data)
 | 
			
		||||
			m_channelMarker.setColor(u32tmp);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        d.readS32(7, &tmp, 10);
 | 
			
		||||
        ui->vestigial->setValue(tmp);
 | 
			
		||||
        d.readS32(8, &tmp, 0);
 | 
			
		||||
        ui->modulation->setCurrentIndex(tmp);
 | 
			
		||||
 | 
			
		||||
@ -273,6 +277,12 @@ void ATVModGUI::on_modulation_currentIndexChanged(int index)
 | 
			
		||||
    applySettings();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ATVModGUI::on_vestigial_valueChanged(int value)
 | 
			
		||||
{
 | 
			
		||||
    ui->vestigialText->setText(QString("%1").arg(value));
 | 
			
		||||
    applySettings();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ATVModGUI::on_rfBW_valueChanged(int value)
 | 
			
		||||
{
 | 
			
		||||
	ui->rfBWText->setText(QString("%1 MHz").arg(value / 10.0, 0, 'f', 1));
 | 
			
		||||
@ -509,7 +519,8 @@ void ATVModGUI::applySettings()
 | 
			
		||||
			ui->playLoop->isChecked(),
 | 
			
		||||
			ui->playVideo->isChecked(),
 | 
			
		||||
			ui->playCamera->isChecked(),
 | 
			
		||||
			ui->channelMute->isChecked());
 | 
			
		||||
			ui->channelMute->isChecked(),
 | 
			
		||||
			ui->vestigial->value() / 100.0f);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -64,6 +64,7 @@ private slots:
 | 
			
		||||
    void on_deltaMinus_toggled(bool minus);
 | 
			
		||||
    void on_channelMute_toggled(bool checked);
 | 
			
		||||
    void on_modulation_currentIndexChanged(int index);
 | 
			
		||||
    void on_vestigial_valueChanged(int value);
 | 
			
		||||
    void on_rfBW_valueChanged(int value);
 | 
			
		||||
    void on_standard_currentIndexChanged(int index);
 | 
			
		||||
    void on_uniformLevel_valueChanged(int value);
 | 
			
		||||
 | 
			
		||||
@ -233,10 +233,50 @@
 | 
			
		||||
        </item>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QLabel" name="vestiigialLabel">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>V</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QDial" name="vestigial">
 | 
			
		||||
        <property name="maximumSize">
 | 
			
		||||
         <size>
 | 
			
		||||
          <width>24</width>
 | 
			
		||||
          <height>24</height>
 | 
			
		||||
         </size>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="toolTip">
 | 
			
		||||
         <string>Vestigial sideband percentage</string>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="pageStep">
 | 
			
		||||
         <number>1</number>
 | 
			
		||||
        </property>
 | 
			
		||||
        <property name="value">
 | 
			
		||||
         <number>10</number>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QLabel" name="vestigialText">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>99</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="Line" name="line_7">
 | 
			
		||||
        <property name="orientation">
 | 
			
		||||
         <enum>Qt::Vertical</enum>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
      <item>
 | 
			
		||||
       <widget class="QLabel" name="rfBWLabel">
 | 
			
		||||
        <property name="text">
 | 
			
		||||
         <string>RFBW</string>
 | 
			
		||||
         <string>BW</string>
 | 
			
		||||
        </property>
 | 
			
		||||
       </widget>
 | 
			
		||||
      </item>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user