1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-22 08:04:49 -05:00

FT8 demod: removed DSB option and set USB only

This commit is contained in:
f4exb 2023-01-15 11:56:16 +01:00
parent cd8990907d
commit 14f9989adb
14 changed files with 36 additions and 378 deletions

View File

@ -241,7 +241,6 @@ void FT8Demod::applySettings(const FT8DemodSettings& settings, bool force)
<< " m_lowCutoff: " << settings.m_filterBank[settings.m_filterIndex].m_lowCutoff << " m_lowCutoff: " << settings.m_filterBank[settings.m_filterIndex].m_lowCutoff
<< " m_fftWindow: " << settings.m_filterBank[settings.m_filterIndex].m_fftWindow << "]" << " m_fftWindow: " << settings.m_filterBank[settings.m_filterIndex].m_fftWindow << "]"
<< " m_volume: " << settings.m_volume << " m_volume: " << settings.m_volume
<< " m_dsb: " << settings.m_dsb
<< " m_agcActive: " << settings.m_agc << " m_agcActive: " << settings.m_agc
<< " m_agcClamping: " << settings.m_agcClamping << " m_agcClamping: " << settings.m_agcClamping
<< " m_agcTimeLog2: " << settings.m_agcTimeLog2 << " m_agcTimeLog2: " << settings.m_agcTimeLog2
@ -294,9 +293,6 @@ void FT8Demod::applySettings(const FT8DemodSettings& settings, bool force)
if ((settings.m_ft8SampleRate != m_settings.m_ft8SampleRate) || force) { if ((settings.m_ft8SampleRate != m_settings.m_ft8SampleRate) || force) {
reverseAPIKeys.append("ft8SampleRate"); reverseAPIKeys.append("ft8SampleRate");
} }
if ((m_settings.m_dsb != settings.m_dsb) || force) {
reverseAPIKeys.append("dsb");
}
if ((m_settings.m_agc != settings.m_agc) || force) { if ((m_settings.m_agc != settings.m_agc) || force) {
reverseAPIKeys.append("agc"); reverseAPIKeys.append("agc");
} }
@ -314,12 +310,10 @@ void FT8Demod::applySettings(const FT8DemodSettings& settings, bool force)
reverseAPIKeys.append("streamIndex"); reverseAPIKeys.append("streamIndex");
} }
if ((settings.m_dsb != m_settings.m_dsb) if ((settings.m_filterBank[settings.m_filterIndex].m_rfBandwidth != m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth)
|| (settings.m_filterBank[settings.m_filterIndex].m_rfBandwidth != m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth)
|| (settings.m_filterBank[settings.m_filterIndex].m_lowCutoff != m_settings.m_filterBank[m_settings.m_filterIndex].m_lowCutoff) || force) || (settings.m_filterBank[settings.m_filterIndex].m_lowCutoff != m_settings.m_filterBank[m_settings.m_filterIndex].m_lowCutoff) || force)
{ {
SpectrumSettings spectrumSettings = m_spectrumVis.getSettings(); SpectrumSettings spectrumSettings = m_spectrumVis.getSettings();
spectrumSettings.m_ssb = !settings.m_dsb;
spectrumSettings.m_usb = (settings.m_filterBank[settings.m_filterIndex].m_lowCutoff < settings.m_filterBank[settings.m_filterIndex].m_rfBandwidth); spectrumSettings.m_usb = (settings.m_filterBank[settings.m_filterIndex].m_lowCutoff < settings.m_filterBank[settings.m_filterIndex].m_rfBandwidth);
SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false); SpectrumVis::MsgConfigureSpectrumVis *msg = SpectrumVis::MsgConfigureSpectrumVis::create(spectrumSettings, false);
m_spectrumVis.getInputMessageQueue()->push(msg); m_spectrumVis.getInputMessageQueue()->push(msg);
@ -467,9 +461,6 @@ void FT8Demod::webapiUpdateChannelSettings(
if (channelSettingsKeys.contains("volume")) { if (channelSettingsKeys.contains("volume")) {
settings.m_volume = response.getFt8DemodSettings()->getVolume(); settings.m_volume = response.getFt8DemodSettings()->getVolume();
} }
if (channelSettingsKeys.contains("dsb")) {
settings.m_dsb = response.getFt8DemodSettings()->getDsb() != 0;
}
if (channelSettingsKeys.contains("agc")) { if (channelSettingsKeys.contains("agc")) {
settings.m_agc = response.getFt8DemodSettings()->getAgc() != 0; settings.m_agc = response.getFt8DemodSettings()->getAgc() != 0;
} }
@ -543,7 +534,6 @@ void FT8Demod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& resp
response.getFt8DemodSettings()->setLowCutoff(settings.m_filterBank[settings.m_filterIndex].m_lowCutoff); response.getFt8DemodSettings()->setLowCutoff(settings.m_filterBank[settings.m_filterIndex].m_lowCutoff);
response.getFt8DemodSettings()->setFftWindow((int) settings.m_filterBank[settings.m_filterIndex].m_fftWindow); response.getFt8DemodSettings()->setFftWindow((int) settings.m_filterBank[settings.m_filterIndex].m_fftWindow);
response.getFt8DemodSettings()->setVolume(settings.m_volume); response.getFt8DemodSettings()->setVolume(settings.m_volume);
response.getFt8DemodSettings()->setDsb(settings.m_dsb ? 1 : 0);
response.getFt8DemodSettings()->setAgc(settings.m_agc ? 1 : 0); response.getFt8DemodSettings()->setAgc(settings.m_agc ? 1 : 0);
response.getFt8DemodSettings()->setAgcClamping(settings.m_agcClamping ? 1 : 0); response.getFt8DemodSettings()->setAgcClamping(settings.m_agcClamping ? 1 : 0);
response.getFt8DemodSettings()->setAgcTimeLog2(settings.m_agcTimeLog2); response.getFt8DemodSettings()->setAgcTimeLog2(settings.m_agcTimeLog2);
@ -718,9 +708,6 @@ void FT8Demod::webapiFormatChannelSettings(
if (channelSettingsKeys.contains("volume") || force) { if (channelSettingsKeys.contains("volume") || force) {
swgFT8DemodSettings->setVolume(settings.m_volume); swgFT8DemodSettings->setVolume(settings.m_volume);
} }
if (channelSettingsKeys.contains("dsb") || force) {
swgFT8DemodSettings->setDsb(settings.m_dsb ? 1 : 0);
}
if (channelSettingsKeys.contains("agc") || force) { if (channelSettingsKeys.contains("agc") || force) {
swgFT8DemodSettings->setAgc(settings.m_agc ? 1 : 0); swgFT8DemodSettings->setAgc(settings.m_agc ? 1 : 0);
} }

View File

@ -137,12 +137,6 @@ void FT8DemodGUI::channelMarkerHighlightedByCursor()
setHighlighted(m_channelMarker.getHighlighted()); setHighlighted(m_channelMarker.getHighlighted());
} }
void FT8DemodGUI::on_dsb_toggled(bool dsb)
{
ui->flipSidebands->setEnabled(!dsb);
applyBandwidths(1 + ui->spanLog2->maximum() - ui->spanLog2->value());
}
void FT8DemodGUI::on_deltaFrequency_changed(qint64 value) void FT8DemodGUI::on_deltaFrequency_changed(qint64 value)
{ {
m_channelMarker.setCenterFrequency(value); m_channelMarker.setCenterFrequency(value);
@ -218,15 +212,6 @@ void FT8DemodGUI::on_spanLog2_valueChanged(int value)
applyBandwidths(s2max - ui->spanLog2->value()); applyBandwidths(s2max - ui->spanLog2->value());
} }
void FT8DemodGUI::on_flipSidebands_clicked(bool checked)
{
(void) checked;
int bwValue = ui->BW->value();
int lcValue = ui->lowCut->value();
ui->BW->setValue(-bwValue);
ui->lowCut->setValue(-lcValue);
}
void FT8DemodGUI::on_fftWindow_currentIndexChanged(int index) void FT8DemodGUI::on_fftWindow_currentIndexChanged(int index)
{ {
m_settings.m_filterBank[m_settings.m_filterIndex].m_fftWindow = (FFTWindow::Function) index; m_settings.m_filterBank[m_settings.m_filterIndex].m_fftWindow = (FFTWindow::Function) index;
@ -370,15 +355,10 @@ FT8DemodGUI::FT8DemodGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, Baseban
ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum); ui->spectrumGUI->setBuddies(m_spectrumVis, ui->glSpectrum);
m_iconDSBUSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On); ui->BW->setMaximum(60);
m_iconDSBUSB.addPixmap(QPixmap("://usb.png"), QIcon::Normal, QIcon::Off); ui->BW->setMinimum(10);
m_iconDSBLSB.addPixmap(QPixmap("://dsb.png"), QIcon::Normal, QIcon::On); ui->lowCut->setMaximum(50);
m_iconDSBLSB.addPixmap(QPixmap("://lsb.png"), QIcon::Normal, QIcon::Off); ui->lowCut->setMinimum(0);
ui->BW->setMaximum(480);
ui->BW->setMinimum(-480);
ui->lowCut->setMaximum(480);
ui->lowCut->setMinimum(-480);
displaySettings(); displaySettings();
makeUIConnections(); makeUIConnections();
@ -420,18 +400,16 @@ void FT8DemodGUI::applyBandwidths(unsigned int spanLog2, bool force)
spanLog2 = spanLog2 > s2max ? s2max : spanLog2; spanLog2 = spanLog2 > s2max ? s2max : spanLog2;
unsigned int limit = s2max < 1 ? 0 : s2max - 1; unsigned int limit = s2max < 1 ? 0 : s2max - 1;
ui->spanLog2->setMaximum(limit); ui->spanLog2->setMaximum(limit);
bool dsb = ui->dsb->isChecked();
//int spanLog2 = ui->spanLog2->value(); //int spanLog2 = ui->spanLog2->value();
m_spectrumRate = m_settings.m_ft8SampleRate / (1<<spanLog2); m_spectrumRate = m_settings.m_ft8SampleRate / (1<<spanLog2);
int bw = ui->BW->value(); int bw = ui->BW->value();
int lw = ui->lowCut->value(); int lw = ui->lowCut->value();
int bwMax = m_settings.m_ft8SampleRate / (100*(1<<spanLog2)); int bwMax = m_settings.m_ft8SampleRate / (100*(1<<spanLog2));
int tickInterval = m_spectrumRate / 1200; int tickInterval = m_spectrumRate / 2400;
tickInterval = tickInterval == 0 ? 1 : tickInterval; tickInterval = tickInterval == 0 ? 1 : tickInterval;
qDebug() << "FT8DemodGUI::applyBandwidths:" qDebug() << "FT8DemodGUI::applyBandwidths:"
<< " s2max:" << s2max << " s2max:" << s2max
<< " dsb: " << dsb
<< " spanLog2: " << spanLog2 << " spanLog2: " << spanLog2
<< " m_spectrumRate: " << m_spectrumRate << " m_spectrumRate: " << m_spectrumRate
<< " bw: " << bw << " bw: " << bw
@ -442,19 +420,10 @@ void FT8DemodGUI::applyBandwidths(unsigned int spanLog2, bool force)
ui->BW->setTickInterval(tickInterval); ui->BW->setTickInterval(tickInterval);
ui->lowCut->setTickInterval(tickInterval); ui->lowCut->setTickInterval(tickInterval);
bw = bw < -bwMax ? -bwMax : bw > bwMax ? bwMax : bw; bw = bw < 0 ? 0 : bw > bwMax ? bwMax : bw;
lw = lw > bw-1 ? bw-1 : lw < 0 ? 0 : lw;
if (bw < 0) { if (bw == 0) {
lw = lw < bw+1 ? bw+1 : lw < 0 ? lw : 0;
} else if (bw > 0) {
lw = lw > bw-1 ? bw-1 : lw < 0 ? 0 : lw;
} else {
lw = 0;
}
if (dsb)
{
bw = bw < 0 ? -bw : bw;
lw = 0; lw = 0;
} }
@ -462,34 +431,12 @@ void FT8DemodGUI::applyBandwidths(unsigned int spanLog2, bool force)
QString bwStr = QString::number(bw/10.0, 'f', 1); QString bwStr = QString::number(bw/10.0, 'f', 1);
QString lwStr = QString::number(lw/10.0, 'f', 1); QString lwStr = QString::number(lw/10.0, 'f', 1);
if (dsb) ui->BWText->setText(tr("%1k").arg(bwStr));
{ ui->spanText->setText(tr("%1k").arg(spanStr));
ui->BWText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(bwStr)); ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
ui->spanText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(spanStr)); ui->glSpectrum->setSampleRate(m_spectrumRate);
ui->scaleMinus->setText("0"); ui->glSpectrum->setSsbSpectrum(true);
ui->scaleCenter->setText(""); ui->glSpectrum->setLsbDisplay(bw < 0);
ui->scalePlus->setText(tr("%1").arg(QChar(0xB1, 0x00)));
ui->lsbLabel->setText("");
ui->usbLabel->setText("");
ui->glSpectrum->setCenterFrequency(0);
ui->glSpectrum->setSampleRate(2*m_spectrumRate);
ui->glSpectrum->setSsbSpectrum(false);
ui->glSpectrum->setLsbDisplay(false);
}
else
{
ui->BWText->setText(tr("%1k").arg(bwStr));
ui->spanText->setText(tr("%1k").arg(spanStr));
ui->scaleMinus->setText("-");
ui->scaleCenter->setText("0");
ui->scalePlus->setText("+");
ui->lsbLabel->setText("LSB");
ui->usbLabel->setText("USB");
ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
ui->glSpectrum->setSampleRate(m_spectrumRate);
ui->glSpectrum->setSsbSpectrum(true);
ui->glSpectrum->setLsbDisplay(bw < 0);
}
ui->lowCutText->setText(tr("%1k").arg(lwStr)); ui->lowCutText->setText(tr("%1k").arg(lwStr));
@ -497,11 +444,11 @@ void FT8DemodGUI::applyBandwidths(unsigned int spanLog2, bool force)
ui->lowCut->blockSignals(true); ui->lowCut->blockSignals(true);
ui->BW->setMaximum(bwMax); ui->BW->setMaximum(bwMax);
ui->BW->setMinimum(dsb ? 0 : -bwMax); ui->BW->setMinimum(0);
ui->BW->setValue(bw); ui->BW->setValue(bw);
ui->lowCut->setMaximum(dsb ? 0 : bwMax); ui->lowCut->setMaximum(bwMax);
ui->lowCut->setMinimum(dsb ? 0 : -bwMax); ui->lowCut->setMinimum(0);
ui->lowCut->setValue(lw); ui->lowCut->setValue(lw);
ui->lowCut->blockSignals(false); ui->lowCut->blockSignals(false);
@ -509,7 +456,6 @@ void FT8DemodGUI::applyBandwidths(unsigned int spanLog2, bool force)
ui->channelPowerMeter->setRange(FT8DemodSettings::m_minPowerThresholdDB, 0); ui->channelPowerMeter->setRange(FT8DemodSettings::m_minPowerThresholdDB, 0);
m_settings.m_dsb = dsb;
m_settings.m_filterBank[m_settings.m_filterIndex].m_spanLog2 = spanLog2; m_settings.m_filterBank[m_settings.m_filterIndex].m_spanLog2 = spanLog2;
m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth = bw * 100; m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth = bw * 100;
m_settings.m_filterBank[m_settings.m_filterIndex].m_lowCutoff = lw * 100; m_settings.m_filterBank[m_settings.m_filterIndex].m_lowCutoff = lw * 100;
@ -518,9 +464,8 @@ void FT8DemodGUI::applyBandwidths(unsigned int spanLog2, bool force)
bool wasBlocked = blockApplySettings(true); bool wasBlocked = blockApplySettings(true);
m_channelMarker.setBandwidth(bw * 200); m_channelMarker.setBandwidth(bw * 200);
m_channelMarker.setSidebands(dsb ? ChannelMarker::dsb : bw < 0 ? ChannelMarker::lsb : ChannelMarker::usb); m_channelMarker.setSidebands(bw < 0 ? ChannelMarker::lsb : ChannelMarker::usb);
ui->dsb->setIcon(bw < 0 ? m_iconDSBLSB: m_iconDSBUSB); m_channelMarker.setLowCutoff(lw * 100);
if (!dsb) { m_channelMarker.setLowCutoff(lw * 100); }
blockApplySettings(wasBlocked); blockApplySettings(wasBlocked);
} }
@ -532,24 +477,13 @@ void FT8DemodGUI::displaySettings()
m_channelMarker.setTitle(m_settings.m_title); m_channelMarker.setTitle(m_settings.m_title);
m_channelMarker.setLowCutoff(m_settings.m_filterBank[m_settings.m_filterIndex].m_lowCutoff); m_channelMarker.setLowCutoff(m_settings.m_filterBank[m_settings.m_filterIndex].m_lowCutoff);
ui->flipSidebands->setEnabled(!m_settings.m_dsb); if (m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth < 0)
if (m_settings.m_dsb)
{ {
m_channelMarker.setSidebands(ChannelMarker::dsb); m_channelMarker.setSidebands(ChannelMarker::lsb);
} }
else else
{ {
if (m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth < 0) m_channelMarker.setSidebands(ChannelMarker::usb);
{
m_channelMarker.setSidebands(ChannelMarker::lsb);
ui->dsb->setIcon(m_iconDSBLSB);
}
else
{
m_channelMarker.setSidebands(ChannelMarker::usb);
ui->dsb->setIcon(m_iconDSBUSB);
}
} }
m_channelMarker.blockSignals(false); m_channelMarker.blockSignals(false);
@ -570,27 +504,20 @@ void FT8DemodGUI::displaySettings()
// Prevent uncontrolled triggering of applyBandwidths // Prevent uncontrolled triggering of applyBandwidths
ui->spanLog2->blockSignals(true); ui->spanLog2->blockSignals(true);
ui->dsb->blockSignals(true);
ui->BW->blockSignals(true); ui->BW->blockSignals(true);
ui->filterIndex->blockSignals(true); ui->filterIndex->blockSignals(true);
ui->filterIndex->setValue(m_settings.m_filterIndex); ui->filterIndex->setValue(m_settings.m_filterIndex);
ui->filterIndexText->setText(tr("%1").arg(m_settings.m_filterIndex)); ui->filterIndexText->setText(tr("%1").arg(m_settings.m_filterIndex));
ui->dsb->setChecked(m_settings.m_dsb);
ui->spanLog2->setValue(1 + ui->spanLog2->maximum() - m_settings.m_filterBank[m_settings.m_filterIndex].m_spanLog2); ui->spanLog2->setValue(1 + ui->spanLog2->maximum() - m_settings.m_filterBank[m_settings.m_filterIndex].m_spanLog2);
ui->BW->setValue(m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth / 100.0); ui->BW->setValue(m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth / 100.0);
QString s = QString::number(m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth/1000.0, 'f', 1); QString s = QString::number(m_settings.m_filterBank[m_settings.m_filterIndex].m_rfBandwidth/1000.0, 'f', 1);
if (m_settings.m_dsb) { ui->BWText->setText(tr("%1k").arg(s));
ui->BWText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(s));
} else {
ui->BWText->setText(tr("%1k").arg(s));
}
ui->spanLog2->blockSignals(false); ui->spanLog2->blockSignals(false);
ui->dsb->blockSignals(false);
ui->BW->blockSignals(false); ui->BW->blockSignals(false);
ui->filterIndex->blockSignals(false); ui->filterIndex->blockSignals(false);
@ -679,7 +606,6 @@ void FT8DemodGUI::tick()
void FT8DemodGUI::makeUIConnections() void FT8DemodGUI::makeUIConnections()
{ {
QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &FT8DemodGUI::on_deltaFrequency_changed); QObject::connect(ui->deltaFrequency, &ValueDialZ::changed, this, &FT8DemodGUI::on_deltaFrequency_changed);
QObject::connect(ui->dsb, &QToolButton::toggled, this, &FT8DemodGUI::on_dsb_toggled);
QObject::connect(ui->BW, &TickedSlider::valueChanged, this, &FT8DemodGUI::on_BW_valueChanged); QObject::connect(ui->BW, &TickedSlider::valueChanged, this, &FT8DemodGUI::on_BW_valueChanged);
QObject::connect(ui->lowCut, &TickedSlider::valueChanged, this, &FT8DemodGUI::on_lowCut_valueChanged); QObject::connect(ui->lowCut, &TickedSlider::valueChanged, this, &FT8DemodGUI::on_lowCut_valueChanged);
QObject::connect(ui->volume, &QDial::valueChanged, this, &FT8DemodGUI::on_volume_valueChanged); QObject::connect(ui->volume, &QDial::valueChanged, this, &FT8DemodGUI::on_volume_valueChanged);
@ -689,7 +615,6 @@ void FT8DemodGUI::makeUIConnections()
QObject::connect(ui->agcPowerThreshold, &QDial::valueChanged, this, &FT8DemodGUI::on_agcPowerThreshold_valueChanged); QObject::connect(ui->agcPowerThreshold, &QDial::valueChanged, this, &FT8DemodGUI::on_agcPowerThreshold_valueChanged);
QObject::connect(ui->agcThresholdGate, &QDial::valueChanged, this, &FT8DemodGUI::on_agcThresholdGate_valueChanged); QObject::connect(ui->agcThresholdGate, &QDial::valueChanged, this, &FT8DemodGUI::on_agcThresholdGate_valueChanged);
QObject::connect(ui->spanLog2, &QSlider::valueChanged, this, &FT8DemodGUI::on_spanLog2_valueChanged); QObject::connect(ui->spanLog2, &QSlider::valueChanged, this, &FT8DemodGUI::on_spanLog2_valueChanged);
QObject::connect(ui->flipSidebands, &QPushButton::clicked, this, &FT8DemodGUI::on_flipSidebands_clicked);
QObject::connect(ui->fftWindow, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FT8DemodGUI::on_fftWindow_currentIndexChanged); QObject::connect(ui->fftWindow, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FT8DemodGUI::on_fftWindow_currentIndexChanged);
QObject::connect(ui->filterIndex, &QDial::valueChanged, this, &FT8DemodGUI::on_filterIndex_valueChanged); QObject::connect(ui->filterIndex, &QDial::valueChanged, this, &FT8DemodGUI::on_filterIndex_valueChanged);
} }

View File

@ -17,8 +17,6 @@
#ifndef INCLUDE_SSBDEMODGUI_H #ifndef INCLUDE_SSBDEMODGUI_H
#define INCLUDE_SSBDEMODGUI_H #define INCLUDE_SSBDEMODGUI_H
#include <QIcon>
#include "channel/channelgui.h" #include "channel/channelgui.h"
#include "dsp/channelmarker.h" #include "dsp/channelmarker.h"
#include "dsp/movingaverage.h" #include "dsp/movingaverage.h"
@ -87,9 +85,6 @@ private:
SpectrumVis* m_spectrumVis; SpectrumVis* m_spectrumVis;
MessageQueue m_inputMessageQueue; MessageQueue m_inputMessageQueue;
QIcon m_iconDSBUSB;
QIcon m_iconDSBLSB;
explicit FT8DemodGUI(PluginAPI* pluginAPI, DeviceUISet* deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0); explicit FT8DemodGUI(PluginAPI* pluginAPI, DeviceUISet* deviceUISet, BasebandSampleSink *rxChannel, QWidget* parent = 0);
virtual ~FT8DemodGUI(); virtual ~FT8DemodGUI();
@ -109,7 +104,6 @@ private:
private slots: private slots:
void on_deltaFrequency_changed(qint64 value); void on_deltaFrequency_changed(qint64 value);
void on_dsb_toggled(bool dsb);
void on_BW_valueChanged(int value); void on_BW_valueChanged(int value);
void on_lowCut_valueChanged(int value); void on_lowCut_valueChanged(int value);
void on_volume_valueChanged(int value); void on_volume_valueChanged(int value);
@ -119,7 +113,6 @@ private slots:
void on_agcPowerThreshold_valueChanged(int value); void on_agcPowerThreshold_valueChanged(int value);
void on_agcThresholdGate_valueChanged(int value); void on_agcThresholdGate_valueChanged(int value);
void on_spanLog2_valueChanged(int value); void on_spanLog2_valueChanged(int value);
void on_flipSidebands_clicked(bool checked);
void on_fftWindow_currentIndexChanged(int index); void on_fftWindow_currentIndexChanged(int index);
void on_filterIndex_valueChanged(int value); void on_filterIndex_valueChanged(int value);
void onWidgetRolled(QWidget* widget, bool rollDown); void onWidgetRolled(QWidget* widget, bool rollDown);

View File

@ -176,38 +176,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item>
<widget class="QPushButton" name="flipSidebands">
<property name="toolTip">
<string>Flip sideband in SSB mode (LSB-&gt;USB or USB-&gt;LSB)</string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/flip_sidebands.png</normaloff>:/flip_sidebands.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="dsb">
<property name="toolTip">
<string>DSB/SSB toggle</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/usb.png</normaloff>
<normalon>:/dsb.png</normalon>:/usb.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</item> </item>
</layout> </layout>
@ -275,16 +243,16 @@
<number>0</number> <number>0</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>4</number> <number>2</number>
</property> </property>
<property name="pageStep"> <property name="pageStep">
<number>1</number> <number>1</number>
</property> </property>
<property name="value"> <property name="value">
<number>2</number> <number>1</number>
</property> </property>
<property name="sliderPosition"> <property name="sliderPosition">
<number>2</number> <number>1</number>
</property> </property>
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -468,7 +436,7 @@
<string>Highpass filter cutoff frequency (SSB)</string> <string>Highpass filter cutoff frequency (SSB)</string>
</property> </property>
<property name="minimum"> <property name="minimum">
<number>-60</number> <number>0</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>60</number> <number>60</number>
@ -550,7 +518,7 @@
<string>Lowpass filter cutoff frequency</string> <string>Lowpass filter cutoff frequency</string>
</property> </property>
<property name="minimum"> <property name="minimum">
<number>-60</number> <number>0</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>60</number> <number>60</number>
@ -596,152 +564,6 @@
</item> </item>
</layout> </layout>
</item> </item>
<item>
<layout class="QHBoxLayout" name="scaleLayout">
<item>
<widget class="QLabel" name="scalePadLeft">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>10</height>
</size>
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>f: </string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="scaleMinus">
<property name="maximumSize">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lsbLabel">
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>LSB</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="scaleCenter">
<property name="maximumSize">
<size>
<width>12</width>
<height>10</height>
</size>
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="usbLabel">
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>USB</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="scalePlus">
<property name="maximumSize">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
<property name="font">
<font>
<family>Liberation Sans</family>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>+</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="scalePadRight">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>10</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<widget class="Line" name="line_3"> <widget class="Line" name="line_3">
<property name="orientation"> <property name="orientation">

View File

@ -41,7 +41,6 @@ FT8DemodSettings::FT8DemodSettings() :
void FT8DemodSettings::resetToDefaults() void FT8DemodSettings::resetToDefaults()
{ {
m_dsb = false;
m_agc = false; m_agc = false;
m_agcClamping = false; m_agcClamping = false;
m_agcPowerThreshold = -100; m_agcPowerThreshold = -100;
@ -74,7 +73,6 @@ QByteArray FT8DemodSettings::serialize() const
} }
s.writeU32(5, m_rgbColor); s.writeU32(5, m_rgbColor);
s.writeBool(10, m_dsb);
s.writeBool(11, m_agc); s.writeBool(11, m_agc);
s.writeS32(12, m_agcTimeLog2); s.writeS32(12, m_agcTimeLog2);
s.writeS32(13, m_agcPowerThreshold); s.writeS32(13, m_agcPowerThreshold);
@ -137,7 +135,6 @@ bool FT8DemodSettings::deserialize(const QByteArray& data)
} }
d.readU32(5, &m_rgbColor); d.readU32(5, &m_rgbColor);
d.readBool(10, &m_dsb, false);
d.readBool(11, &m_agc, false); d.readBool(11, &m_agc, false);
d.readS32(12, &m_agcTimeLog2, 7); d.readS32(12, &m_agcTimeLog2, 7);
d.readS32(13, &m_agcPowerThreshold, -40); d.readS32(13, &m_agcPowerThreshold, -40);

View File

@ -33,9 +33,9 @@ struct FT8DemodFilterSettings
FFTWindow::Function m_fftWindow; FFTWindow::Function m_fftWindow;
FT8DemodFilterSettings() : FT8DemodFilterSettings() :
m_spanLog2(3), m_spanLog2(2),
m_rfBandwidth(3000), m_rfBandwidth(3000),
m_lowCutoff(300), m_lowCutoff(200),
m_fftWindow(FFTWindow::Blackman) m_fftWindow(FFTWindow::Blackman)
{} {}
}; };
@ -47,7 +47,6 @@ struct FT8DemodSettings
// Real m_lowCutoff; // Real m_lowCutoff;
Real m_volume; Real m_volume;
// int m_spanLog2; // int m_spanLog2;
bool m_dsb;
bool m_agc; bool m_agc;
bool m_agcClamping; bool m_agcClamping;
int m_agcTimeLog2; int m_agcTimeLog2;

View File

@ -37,7 +37,6 @@ const int FT8DemodSink::m_ssbFftLen = 1024;
const int FT8DemodSink::m_agcTarget = 3276; // 32768/10 -10 dB amplitude => -20 dB power: center of normal signal const int FT8DemodSink::m_agcTarget = 3276; // 32768/10 -10 dB amplitude => -20 dB power: center of normal signal
FT8DemodSink::FT8DemodSink() : FT8DemodSink::FT8DemodSink() :
m_dsb(false),
m_agc(12000, m_agcTarget, 1e-2), m_agc(12000, m_agcTarget, 1e-2),
m_agcActive(false), m_agcActive(false),
m_agcClamping(false), m_agcClamping(false),
@ -75,7 +74,6 @@ FT8DemodSink::FT8DemodSink() :
m_agc.setClamping(m_agcClamping); m_agc.setClamping(m_agcClamping);
SSBFilter = new fftfilt(m_LowCutoff / m_ft8SampleRate, m_Bandwidth / m_ft8SampleRate, m_ssbFftLen); SSBFilter = new fftfilt(m_LowCutoff / m_ft8SampleRate, m_Bandwidth / m_ft8SampleRate, m_ssbFftLen);
DSBFilter = new fftfilt((2.0f * m_Bandwidth) / m_ft8SampleRate, 2 * m_ssbFftLen);
applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true); applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true);
applySettings(m_settings, true); applySettings(m_settings, true);
@ -84,7 +82,6 @@ FT8DemodSink::FT8DemodSink() :
FT8DemodSink::~FT8DemodSink() FT8DemodSink::~FT8DemodSink()
{ {
delete SSBFilter; delete SSBFilter;
delete DSBFilter;
} }
void FT8DemodSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end) void FT8DemodSink::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end)
@ -126,11 +123,7 @@ void FT8DemodSink::processOneSample(Complex &ci)
int decim = 1<<(m_spanLog2 - 1); int decim = 1<<(m_spanLog2 - 1);
unsigned char decim_mask = decim - 1; // counter LSB bit mask for decimation by 2^(m_scaleLog2 - 1) unsigned char decim_mask = decim - 1; // counter LSB bit mask for decimation by 2^(m_scaleLog2 - 1)
if (m_dsb) { n_out = SSBFilter->runSSB(ci, &sideband, m_usb);
n_out = DSBFilter->runDSB(ci, &sideband);
} else {
n_out = SSBFilter->runSSB(ci, &sideband, m_usb);
}
for (int i = 0; i < n_out; i++) for (int i = 0; i < n_out; i++)
{ {
@ -153,16 +146,7 @@ void FT8DemodSink::processOneSample(Complex &ci)
} }
m_magsqCount++; m_magsqCount++;
m_sampleBuffer.push_back(Sample(avgr, avgi));
if (!m_dsb & !m_usb)
{ // invert spectrum for LSB
m_sampleBuffer.push_back(Sample(avgi, avgr));
}
else
{
m_sampleBuffer.push_back(Sample(avgr, avgi));
}
m_sum.real(0.0); m_sum.real(0.0);
m_sum.imag(0.0); m_sum.imag(0.0);
} }
@ -223,7 +207,7 @@ void FT8DemodSink::processOneSample(Complex &ci)
if (m_spectrumSink && (m_sampleBuffer.size() != 0)) if (m_spectrumSink && (m_sampleBuffer.size() != 0))
{ {
m_spectrumSink->feed(m_sampleBuffer.begin(), m_sampleBuffer.end(), !m_dsb); m_spectrumSink->feed(m_sampleBuffer.begin(), m_sampleBuffer.end(), true);
m_sampleBuffer.clear(); m_sampleBuffer.clear();
} }
} }
@ -262,7 +246,6 @@ void FT8DemodSink::applyFT8SampleRate(int sampleRate)
m_interpolatorDistance = (Real) m_channelSampleRate / (Real) sampleRate; m_interpolatorDistance = (Real) m_channelSampleRate / (Real) sampleRate;
SSBFilter->create_filter(m_LowCutoff / (float) sampleRate, m_Bandwidth / (float) sampleRate, m_settings.m_filterBank[m_settings.m_filterIndex].m_fftWindow); SSBFilter->create_filter(m_LowCutoff / (float) sampleRate, m_Bandwidth / (float) sampleRate, m_settings.m_filterBank[m_settings.m_filterIndex].m_fftWindow);
DSBFilter->create_dsb_filter(m_Bandwidth / (float) sampleRate, m_settings.m_filterBank[m_settings.m_filterIndex].m_fftWindow);
int agcNbSamples = (sampleRate / 1000) * (1<<m_settings.m_agcTimeLog2); int agcNbSamples = (sampleRate / 1000) * (1<<m_settings.m_agcTimeLog2);
int agcThresholdGate = (sampleRate / 1000) * m_settings.m_agcThresholdGate; // ms int agcThresholdGate = (sampleRate / 1000) * m_settings.m_agcThresholdGate; // ms
@ -312,7 +295,6 @@ void FT8DemodSink::applySettings(const FT8DemodSettings& settings, bool force)
<< " m_lowCutoff: " << settings.m_filterBank[settings.m_filterIndex].m_lowCutoff << " m_lowCutoff: " << settings.m_filterBank[settings.m_filterIndex].m_lowCutoff
<< " m_fftWindow: " << settings.m_filterBank[settings.m_filterIndex].m_fftWindow << "]" << " m_fftWindow: " << settings.m_filterBank[settings.m_filterIndex].m_fftWindow << "]"
<< " m_volume: " << settings.m_volume << " m_volume: " << settings.m_volume
<< " m_dsb: " << settings.m_dsb
<< " m_agcActive: " << settings.m_agc << " m_agcActive: " << settings.m_agc
<< " m_agcClamping: " << settings.m_agcClamping << " m_agcClamping: " << settings.m_agcClamping
<< " m_agcTimeLog2: " << settings.m_agcTimeLog2 << " m_agcTimeLog2: " << settings.m_agcTimeLog2
@ -358,7 +340,6 @@ void FT8DemodSink::applySettings(const FT8DemodSettings& settings, bool force)
m_interpolatorDistanceRemain = 0; m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) m_channelSampleRate / (Real) m_ft8SampleRate; m_interpolatorDistance = (Real) m_channelSampleRate / (Real) m_ft8SampleRate;
SSBFilter->create_filter(m_LowCutoff / (float) m_ft8SampleRate, m_Bandwidth / (float) m_ft8SampleRate, settings.m_filterBank[settings.m_filterIndex].m_fftWindow); SSBFilter->create_filter(m_LowCutoff / (float) m_ft8SampleRate, m_Bandwidth / (float) m_ft8SampleRate, settings.m_filterBank[settings.m_filterIndex].m_fftWindow);
DSBFilter->create_dsb_filter(m_Bandwidth / (float) m_ft8SampleRate, settings.m_filterBank[settings.m_filterIndex].m_fftWindow);
} }
if ((m_settings.m_volume != settings.m_volume) || force) if ((m_settings.m_volume != settings.m_volume) || force)
@ -411,7 +392,6 @@ void FT8DemodSink::applySettings(const FT8DemodSettings& settings, bool force)
} }
m_spanLog2 = settings.m_filterBank[settings.m_filterIndex].m_spanLog2; m_spanLog2 = settings.m_filterBank[settings.m_filterIndex].m_spanLog2;
m_dsb = settings.m_dsb;
m_agcActive = settings.m_agc; m_agcActive = settings.m_agc;
m_settings = settings; m_settings = settings;
} }

View File

@ -92,7 +92,6 @@ private:
int m_channelSampleRate; int m_channelSampleRate;
int m_channelFrequencyOffset; int m_channelFrequencyOffset;
bool m_usb; bool m_usb;
bool m_dsb;
double m_magsq; double m_magsq;
double m_magsqSum; double m_magsqSum;
double m_magsqPeak; double m_magsqPeak;
@ -112,7 +111,6 @@ private:
Real m_interpolatorDistance; Real m_interpolatorDistance;
Real m_interpolatorDistanceRemain; Real m_interpolatorDistanceRemain;
fftfilt* SSBFilter; fftfilt* SSBFilter;
fftfilt* DSBFilter;
SpectrumVis* m_spectrumSink; SpectrumVis* m_spectrumSink;
SampleVector m_sampleBuffer; SampleVector m_sampleBuffer;

View File

@ -5607,10 +5607,6 @@ margin-bottom: 20px;
"type" : "number", "type" : "number",
"format" : "float" "format" : "float"
}, },
"dsb" : {
"type" : "integer",
"description" : "Double sidebands mode (1 if DSB else 0)"
},
"agc" : { "agc" : {
"type" : "integer", "type" : "integer",
"description" : "AGC (1 if AGC active else 0)" "description" : "AGC (1 if AGC active else 0)"
@ -56896,7 +56892,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2023-01-15T03:28:53.541+01:00 Generated 2023-01-15T07:29:18.682+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -30,9 +30,6 @@ FT8DemodSettings:
volume: volume:
type: number type: number
format: float format: float
dsb:
description: Double sidebands mode (1 if DSB else 0)
type: integer
agc: agc:
description: AGC (1 if AGC active else 0) description: AGC (1 if AGC active else 0)
type: integer type: integer

View File

@ -30,9 +30,6 @@ FT8DemodSettings:
volume: volume:
type: number type: number
format: float format: float
dsb:
description: Double sidebands mode (1 if DSB else 0)
type: integer
agc: agc:
description: AGC (1 if AGC active else 0) description: AGC (1 if AGC active else 0)
type: integer type: integer

View File

@ -5607,10 +5607,6 @@ margin-bottom: 20px;
"type" : "number", "type" : "number",
"format" : "float" "format" : "float"
}, },
"dsb" : {
"type" : "integer",
"description" : "Double sidebands mode (1 if DSB else 0)"
},
"agc" : { "agc" : {
"type" : "integer", "type" : "integer",
"description" : "AGC (1 if AGC active else 0)" "description" : "AGC (1 if AGC active else 0)"
@ -56896,7 +56892,7 @@ except ApiException as e:
</div> </div>
<div id="generator"> <div id="generator">
<div class="content"> <div class="content">
Generated 2023-01-15T03:28:53.541+01:00 Generated 2023-01-15T07:29:18.682+01:00
</div> </div>
</div> </div>
</div> </div>

View File

@ -42,8 +42,6 @@ SWGFT8DemodSettings::SWGFT8DemodSettings() {
m_fft_window_isSet = false; m_fft_window_isSet = false;
volume = 0.0f; volume = 0.0f;
m_volume_isSet = false; m_volume_isSet = false;
dsb = 0;
m_dsb_isSet = false;
agc = 0; agc = 0;
m_agc_isSet = false; m_agc_isSet = false;
agc_clamping = 0; agc_clamping = 0;
@ -100,8 +98,6 @@ SWGFT8DemodSettings::init() {
m_fft_window_isSet = false; m_fft_window_isSet = false;
volume = 0.0f; volume = 0.0f;
m_volume_isSet = false; m_volume_isSet = false;
dsb = 0;
m_dsb_isSet = false;
agc = 0; agc = 0;
m_agc_isSet = false; m_agc_isSet = false;
agc_clamping = 0; agc_clamping = 0;
@ -153,7 +149,6 @@ SWGFT8DemodSettings::cleanup() {
if(title != nullptr) { if(title != nullptr) {
delete title; delete title;
} }
@ -202,8 +197,6 @@ SWGFT8DemodSettings::fromJsonObject(QJsonObject &pJson) {
::SWGSDRangel::setValue(&volume, pJson["volume"], "float", ""); ::SWGSDRangel::setValue(&volume, pJson["volume"], "float", "");
::SWGSDRangel::setValue(&dsb, pJson["dsb"], "qint32", "");
::SWGSDRangel::setValue(&agc, pJson["agc"], "qint32", ""); ::SWGSDRangel::setValue(&agc, pJson["agc"], "qint32", "");
::SWGSDRangel::setValue(&agc_clamping, pJson["agcClamping"], "qint32", ""); ::SWGSDRangel::setValue(&agc_clamping, pJson["agcClamping"], "qint32", "");
@ -275,9 +268,6 @@ SWGFT8DemodSettings::asJsonObject() {
if(m_volume_isSet){ if(m_volume_isSet){
obj->insert("volume", QJsonValue(volume)); obj->insert("volume", QJsonValue(volume));
} }
if(m_dsb_isSet){
obj->insert("dsb", QJsonValue(dsb));
}
if(m_agc_isSet){ if(m_agc_isSet){
obj->insert("agc", QJsonValue(agc)); obj->insert("agc", QJsonValue(agc));
} }
@ -403,16 +393,6 @@ SWGFT8DemodSettings::setVolume(float volume) {
this->m_volume_isSet = true; this->m_volume_isSet = true;
} }
qint32
SWGFT8DemodSettings::getDsb() {
return dsb;
}
void
SWGFT8DemodSettings::setDsb(qint32 dsb) {
this->dsb = dsb;
this->m_dsb_isSet = true;
}
qint32 qint32
SWGFT8DemodSettings::getAgc() { SWGFT8DemodSettings::getAgc() {
return agc; return agc;
@ -609,9 +589,6 @@ SWGFT8DemodSettings::isSet(){
if(m_volume_isSet){ if(m_volume_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }
if(m_dsb_isSet){
isObjectUpdated = true; break;
}
if(m_agc_isSet){ if(m_agc_isSet){
isObjectUpdated = true; break; isObjectUpdated = true; break;
} }

View File

@ -66,9 +66,6 @@ public:
float getVolume(); float getVolume();
void setVolume(float volume); void setVolume(float volume);
qint32 getDsb();
void setDsb(qint32 dsb);
qint32 getAgc(); qint32 getAgc();
void setAgc(qint32 agc); void setAgc(qint32 agc);
@ -145,9 +142,6 @@ private:
float volume; float volume;
bool m_volume_isSet; bool m_volume_isSet;
qint32 dsb;
bool m_dsb_isSet;
qint32 agc; qint32 agc;
bool m_agc_isSet; bool m_agc_isSet;