diff --git a/plugins/channeltx/modatv/atvmodgui.cpp b/plugins/channeltx/modatv/atvmodgui.cpp index dc71436b6..58e0eb1d8 100644 --- a/plugins/channeltx/modatv/atvmodgui.cpp +++ b/plugins/channeltx/modatv/atvmodgui.cpp @@ -265,8 +265,9 @@ void ATVModGUI::on_modulation_currentIndexChanged(int index) { ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000); ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000); - m_channelMarker.setBandwidth(ui->rfBW->value()*200000); // TODO: consider asymmetrical sidebands - m_channelMarker.setSidebands(ChannelMarker::usb); + m_channelMarker.setBandwidth(ui->rfBW->value()*100000); + m_channelMarker.setOppositeBandwidth(ui->rfOppBW->value()*200000); + m_channelMarker.setSidebands(ChannelMarker::vlsb); } else if (index == (int) ATVMod::ATVModulationUSB) { @@ -279,8 +280,9 @@ void ATVModGUI::on_modulation_currentIndexChanged(int index) { ui->rfBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000); ui->rfOppBW->setMaximum(m_channelizer->getOutputSampleRate() / 200000); - m_channelMarker.setBandwidth(ui->rfBW->value()*200000); // TODO: consider asymmetrical sidebands - m_channelMarker.setSidebands(ChannelMarker::usb); + m_channelMarker.setBandwidth(ui->rfBW->value()*100000); + m_channelMarker.setOppositeBandwidth(ui->rfOppBW->value()*200000); + m_channelMarker.setSidebands(ChannelMarker::vusb); } else { @@ -297,16 +299,22 @@ void ATVModGUI::on_rfBW_valueChanged(int value) { ui->rfBWText->setText(QString("%1 MHz").arg(value / 10.0, 0, 'f', 1)); - if ((ui->modulation->currentIndex() == (int) ATVMod::ATVModulationLSB) || - (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB)) + if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationLSB) { m_channelMarker.setBandwidth(-ui->rfBW->value()*200000); } - else if ((ui->modulation->currentIndex() == (int) ATVMod::ATVModulationUSB) || - (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB)) + else if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationUSB) { m_channelMarker.setBandwidth(ui->rfBW->value()*200000); } + else if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB) + { + m_channelMarker.setBandwidth(-ui->rfBW->value()*100000); + } + else if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB) + { + m_channelMarker.setBandwidth(ui->rfBW->value()*100000); + } else { m_channelMarker.setBandwidth(ui->rfBW->value()*100000); @@ -321,11 +329,11 @@ void ATVModGUI::on_rfOppBW_valueChanged(int value) if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialLSB) { - m_channelMarker.setBandwidth(-ui->rfBW->value()*200000); // TODO + m_channelMarker.setOppositeBandwidth(-ui->rfOppBW->value()*200000); } else if (ui->modulation->currentIndex() == (int) ATVMod::ATVModulationVestigialUSB) { - m_channelMarker.setBandwidth(ui->rfBW->value()*200000); // TODO + m_channelMarker.setOppositeBandwidth(ui->rfOppBW->value()*200000); } else { diff --git a/sdrbase/dsp/channelmarker.cpp b/sdrbase/dsp/channelmarker.cpp index a4909cb11..ae18b3c57 100644 --- a/sdrbase/dsp/channelmarker.cpp +++ b/sdrbase/dsp/channelmarker.cpp @@ -29,6 +29,7 @@ ChannelMarker::ChannelMarker(QObject* parent) : QObject(parent), m_centerFrequency(0), m_bandwidth(0), + m_oppositeBandwidth(0), m_lowCutoff(0), m_sidebands(dsb), m_visible(false), @@ -59,6 +60,12 @@ void ChannelMarker::setBandwidth(int bandwidth) emit changed(); } +void ChannelMarker::setOppositeBandwidth(int bandwidth) +{ + m_oppositeBandwidth = bandwidth; + emit changed(); +} + void ChannelMarker::setLowCutoff(int lowCutoff) { m_lowCutoff = lowCutoff; diff --git a/sdrbase/dsp/channelmarker.h b/sdrbase/dsp/channelmarker.h index 22ea51bf1..f20fa2522 100644 --- a/sdrbase/dsp/channelmarker.h +++ b/sdrbase/dsp/channelmarker.h @@ -13,7 +13,9 @@ public: { dsb, lsb, - usb + usb, + vusb, //!< USB with vestigial LSB + vlsb //!< LSB with vestigial USB } sidebands_t; ChannelMarker(QObject* parent = NULL); @@ -27,6 +29,9 @@ public: void setBandwidth(int bandwidth); int getBandwidth() const { return m_bandwidth; } + void setOppositeBandwidth(int bandwidth); + int getOppositeBandwidth() const { return m_oppositeBandwidth; } + void setLowCutoff(int lowCutoff); int getLowCutoff() const { return m_lowCutoff; } @@ -52,6 +57,7 @@ protected: QString m_title; int m_centerFrequency; int m_bandwidth; + int m_oppositeBandwidth; int m_lowCutoff; sidebands_t m_sidebands; bool m_visible; diff --git a/sdrbase/gui/glspectrum.cpp b/sdrbase/gui/glspectrum.cpp index 5d9b14ed0..da2008f65 100644 --- a/sdrbase/gui/glspectrum.cpp +++ b/sdrbase/gui/glspectrum.cpp @@ -1269,6 +1269,12 @@ void GLSpectrum::applyChanges() } else if (sidebands == ChannelMarker::lsb) { pw = dv->m_channelMarker->getLowCutoff(); nw = dv->m_channelMarker->getBandwidth() / 2; + } else if (sidebands == ChannelMarker::vusb) { + nw = -dv->m_channelMarker->getOppositeBandwidth() / 2; // negative bandwidth + pw = dv->m_channelMarker->getBandwidth(); // positive bandwidth + } else if (sidebands == ChannelMarker::vlsb) { + pw = dv->m_channelMarker->getOppositeBandwidth() / 2; // positive bandwidth + nw = -dv->m_channelMarker->getBandwidth(); // negative bandwidth } else { pw = dsbw / 2; nw = -pw;