1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 09:48:45 -05:00

ATV Modulator: vestigial sidebands chammel marker update (color overlay)

This commit is contained in:
f4exb 2017-03-16 11:49:14 +01:00
parent 1e46578aad
commit b76c246bcd
4 changed files with 38 additions and 11 deletions

View File

@ -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
{

View File

@ -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;

View File

@ -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;

View File

@ -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;