diff --git a/plugins/channeltx/modatv/atvmod.cpp b/plugins/channeltx/modatv/atvmod.cpp index cd420c5ee..2082ccc07 100644 --- a/plugins/channeltx/modatv/atvmod.cpp +++ b/plugins/channeltx/modatv/atvmod.cpp @@ -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) diff --git a/plugins/channeltx/modatv/atvmod.h b/plugins/channeltx/modatv/atvmod.h index 058b41416..1b61fde6d 100644 --- a/plugins/channeltx/modatv/atvmod.h +++ b/plugins/channeltx/modatv/atvmod.h @@ -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) { } }; diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp index 83eccf627..81ed69083 100644 --- a/plugins/channeltx/modatv/atvmodgui.cpp +++ b/plugins/channeltx/modatv/atvmodgui.cpp @@ -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); } } diff --git a/plugins/channeltx/modatv/atvmodgui.h b/plugins/channeltx/modatv/atvmodgui.h index 4357ea191..657e77319 100644 --- a/plugins/channeltx/modatv/atvmodgui.h +++ b/plugins/channeltx/modatv/atvmodgui.h @@ -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); diff --git a/plugins/channeltx/modatv/atvmodgui.ui b/plugins/channeltx/modatv/atvmodgui.ui index 34df2be66..d45f78e93 100644 --- a/plugins/channeltx/modatv/atvmodgui.ui +++ b/plugins/channeltx/modatv/atvmodgui.ui @@ -233,10 +233,50 @@ + + + + V + + + + + + + + 24 + 24 + + + + Vestigial sideband percentage + + + 1 + + + 10 + + + + + + + 99 + + + + + + + Qt::Vertical + + + - RFBW + BW