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

FreeDV demodulator: removed useless parameters

This commit is contained in:
f4exb 2019-02-25 01:15:10 +01:00
parent 23c7a9d359
commit 7ffe6da0d1
8 changed files with 224 additions and 744 deletions

View File

@ -61,6 +61,7 @@ FreeDVDemod::FreeDVDemod(DeviceSourceAPI *deviceAPI) :
m_audioActive(false),
m_sampleSink(0),
m_audioFifo(24000),
m_modemSampleRate(48000),
m_settingsMutex(QMutex::Recursive)
{
setObjectName(m_channelId);
@ -445,13 +446,8 @@ void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force)
{
qDebug() << "FreeDVDemod::applySettings:"
<< " m_inputFrequencyOffset: " << settings.m_inputFrequencyOffset
<< " m_rfBandwidth: " << settings.m_rfBandwidth
<< " m_lowCutoff: " << settings.m_lowCutoff
<< " m_volume: " << settings.m_volume
<< " m_spanLog2: " << settings.m_spanLog2
<< " m_audioBinaual: " << settings.m_audioBinaural
<< " m_audioFlipChannels: " << settings.m_audioFlipChannels
<< " m_dsb: " << settings.m_dsb
<< " m_audioMute: " << settings.m_audioMute
<< " m_agcActive: " << settings.m_agc
<< " m_agcClamping: " << settings.m_agcClamping
@ -466,46 +462,6 @@ void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force)
if((m_settings.m_inputFrequencyOffset != settings.m_inputFrequencyOffset) || force) {
reverseAPIKeys.append("inputFrequencyOffset");
}
if((m_settings.m_rfBandwidth != settings.m_rfBandwidth) || force) {
reverseAPIKeys.append("rfBandwidth");
}
if((m_settings.m_lowCutoff != settings.m_lowCutoff) || force) {
reverseAPIKeys.append("lowCutoff");
}
if((m_settings.m_rfBandwidth != settings.m_rfBandwidth) ||
(m_settings.m_lowCutoff != settings.m_lowCutoff) || force)
{
float band, lowCutoff;
band = settings.m_rfBandwidth;
lowCutoff = settings.m_lowCutoff;
if (band < 0) {
band = -band;
lowCutoff = -lowCutoff;
m_usb = false;
} else {
m_usb = true;
}
if (band < 100.0f)
{
band = 100.0f;
lowCutoff = 0;
}
m_Bandwidth = band;
m_LowCutoff = lowCutoff;
m_settingsMutex.lock();
m_interpolator.create(16, m_inputSampleRate, m_Bandwidth * 1.5f, 2.0f);
m_interpolatorDistanceRemain = 0;
m_interpolatorDistance = (Real) m_inputSampleRate / (Real) m_audioSampleRate;
SSBFilter->create_filter(m_LowCutoff / (float) m_audioSampleRate, m_Bandwidth / (float) m_audioSampleRate);
DSBFilter->create_dsb_filter((2.0f * m_Bandwidth) / (float) m_audioSampleRate);
m_settingsMutex.unlock();
}
if ((m_settings.m_volume != settings.m_volume) || force)
{
@ -588,15 +544,6 @@ void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force)
if ((m_settings.m_spanLog2 != settings.m_spanLog2) || force) {
reverseAPIKeys.append("spanLog2");
}
if ((m_settings.m_audioBinaural != settings.m_audioBinaural) || force) {
reverseAPIKeys.append("audioBinaural");
}
if ((m_settings.m_audioFlipChannels != settings.m_audioFlipChannels) || force) {
reverseAPIKeys.append("audioFlipChannels");
}
if ((m_settings.m_dsb != settings.m_dsb) || force) {
reverseAPIKeys.append("dsb");
}
if ((m_settings.m_audioMute != settings.m_audioMute) || force) {
reverseAPIKeys.append("audioMute");
}
@ -605,9 +552,6 @@ void FreeDVDemod::applySettings(const FreeDVDemodSettings& settings, bool force)
}
m_spanLog2 = settings.m_spanLog2;
m_audioBinaual = settings.m_audioBinaural;
m_audioFlipChannels = settings.m_audioFlipChannels;
m_dsb = settings.m_dsb;
m_audioMute = settings.m_audioMute;
m_agcActive = settings.m_agc;
@ -672,27 +616,12 @@ int FreeDVDemod::webapiSettingsPutPatch(
settings.m_inputFrequencyOffset = response.getSsbDemodSettings()->getInputFrequencyOffset();
frequencyOffsetChanged = true;
}
if (channelSettingsKeys.contains("rfBandwidth")) {
settings.m_rfBandwidth = response.getSsbDemodSettings()->getRfBandwidth();
}
if (channelSettingsKeys.contains("lowCutoff")) {
settings.m_lowCutoff = response.getSsbDemodSettings()->getLowCutoff();
}
if (channelSettingsKeys.contains("volume")) {
settings.m_volume = response.getSsbDemodSettings()->getVolume();
}
if (channelSettingsKeys.contains("spanLog2")) {
settings.m_spanLog2 = response.getSsbDemodSettings()->getSpanLog2();
}
if (channelSettingsKeys.contains("audioBinaural")) {
settings.m_audioBinaural = response.getSsbDemodSettings()->getAudioBinaural() != 0;
}
if (channelSettingsKeys.contains("audioFlipChannels")) {
settings.m_audioFlipChannels = response.getSsbDemodSettings()->getAudioFlipChannels() != 0;
}
if (channelSettingsKeys.contains("dsb")) {
settings.m_dsb = response.getSsbDemodSettings()->getDsb() != 0;
}
if (channelSettingsKeys.contains("audioMute")) {
settings.m_audioMute = response.getSsbDemodSettings()->getAudioMute() != 0;
}
@ -758,13 +687,8 @@ void FreeDVDemod::webapiFormatChannelSettings(SWGSDRangel::SWGChannelSettings& r
{
response.getSsbDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
response.getSsbDemodSettings()->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
response.getSsbDemodSettings()->setRfBandwidth(settings.m_rfBandwidth);
response.getSsbDemodSettings()->setLowCutoff(settings.m_lowCutoff);
response.getSsbDemodSettings()->setVolume(settings.m_volume);
response.getSsbDemodSettings()->setSpanLog2(settings.m_spanLog2);
response.getSsbDemodSettings()->setAudioBinaural(settings.m_audioBinaural ? 1 : 0);
response.getSsbDemodSettings()->setAudioFlipChannels(settings.m_audioFlipChannels ? 1 : 0);
response.getSsbDemodSettings()->setDsb(settings.m_dsb ? 1 : 0);
response.getSsbDemodSettings()->setAudioMute(settings.m_audioMute ? 1 : 0);
response.getSsbDemodSettings()->setAgc(settings.m_agc ? 1 : 0);
response.getSsbDemodSettings()->setAgcClamping(settings.m_agcClamping ? 1 : 0);
@ -811,27 +735,12 @@ void FreeDVDemod::webapiReverseSendSettings(QList<QString>& channelSettingsKeys,
if (channelSettingsKeys.contains("inputFrequencyOffset") || force) {
swgSSBDemodSettings->setInputFrequencyOffset(settings.m_inputFrequencyOffset);
}
if (channelSettingsKeys.contains("rfBandwidth") || force) {
swgSSBDemodSettings->setRfBandwidth(settings.m_rfBandwidth);
}
if (channelSettingsKeys.contains("lowCutoff") || force) {
swgSSBDemodSettings->setLowCutoff(settings.m_lowCutoff);
}
if (channelSettingsKeys.contains("volume") || force) {
swgSSBDemodSettings->setVolume(settings.m_volume);
}
if (channelSettingsKeys.contains("spanLog2") || force) {
swgSSBDemodSettings->setSpanLog2(settings.m_spanLog2);
}
if (channelSettingsKeys.contains("audioBinaural") || force) {
swgSSBDemodSettings->setAudioBinaural(settings.m_audioBinaural ? 1 : 0);
}
if (channelSettingsKeys.contains("audioFlipChannels") || force) {
swgSSBDemodSettings->setAudioFlipChannels(settings.m_audioFlipChannels ? 1 : 0);
}
if (channelSettingsKeys.contains("dsb") || force) {
swgSSBDemodSettings->setDsb(settings.m_dsb ? 1 : 0);
}
if (channelSettingsKeys.contains("audioMute") || force) {
swgSSBDemodSettings->setAudioMute(settings.m_audioMute ? 1 : 0);
}

View File

@ -125,6 +125,7 @@ public:
virtual bool deserialize(const QByteArray& data);
uint32_t getAudioSampleRate() const { return m_audioSampleRate; }
uint32_t getModemSampleRate() const { return m_modemSampleRate; }
double getMagSq() const { return m_magsq; }
bool getAudioActive() const { return m_audioActive; }
@ -313,6 +314,7 @@ private:
uint m_audioBufferFill;
AudioFifo m_audioFifo;
quint32 m_audioSampleRate;
quint32 m_modemSampleRate;
QNetworkAccessManager *m_networkManager;
QNetworkRequest m_networkRequest;

View File

@ -144,26 +144,6 @@ void FreeDVDemodGUI::channelMarkerHighlightedByCursor()
setHighlighted(m_channelMarker.getHighlighted());
}
void FreeDVDemodGUI::on_audioBinaural_toggled(bool binaural)
{
m_audioBinaural = binaural;
m_settings.m_audioBinaural = binaural;
applySettings();
}
void FreeDVDemodGUI::on_audioFlipChannels_toggled(bool flip)
{
m_audioFlipChannels = flip;
m_settings.m_audioFlipChannels = flip;
applySettings();
}
void FreeDVDemodGUI::on_dsb_toggled(bool dsb)
{
ui->flipSidebands->setEnabled(!dsb);
applyBandwidths(5 - ui->spanLog2->value());
}
void FreeDVDemodGUI::on_deltaFrequency_changed(qint64 value)
{
m_channelMarker.setCenterFrequency(value);
@ -171,16 +151,13 @@ void FreeDVDemodGUI::on_deltaFrequency_changed(qint64 value)
applySettings();
}
void FreeDVDemodGUI::on_BW_valueChanged(int value)
void FreeDVDemodGUI::on_freeDVMode_currentIndexChanged(int index)
{
(void) value;
applyBandwidths(5 - ui->spanLog2->value());
}
void FreeDVDemodGUI::on_lowCut_valueChanged(int value)
{
(void) value;
applyBandwidths(5 - ui->spanLog2->value());
m_settings.m_freeDVMode = (FreeDVDemodSettings::FreeDVMode) index;
m_channelMarker.setBandwidth(FreeDVDemodSettings::getHiCutoff(m_settings.m_freeDVMode) * 2);
m_channelMarker.setLowCutoff(FreeDVDemodSettings::getLowCutoff(m_settings.m_freeDVMode));
m_channelMarker.setSidebands(ChannelMarker::usb);
applySettings();
}
void FreeDVDemodGUI::on_volume_valueChanged(int value)
@ -241,15 +218,6 @@ void FreeDVDemodGUI::on_spanLog2_valueChanged(int value)
applyBandwidths(5 - ui->spanLog2->value());
}
void FreeDVDemodGUI::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 FreeDVDemodGUI::onMenuDialogCalled(const QPoint &p)
{
BasicChannelSettingsDialog dialog(&m_channelMarker, this);
@ -379,132 +347,138 @@ void FreeDVDemodGUI::applySettings(bool force)
void FreeDVDemodGUI::applyBandwidths(int spanLog2, bool force)
{
bool dsb = ui->dsb->isChecked();
//int spanLog2 = ui->spanLog2->value();
m_spectrumRate = m_freeDVDemod->getAudioSampleRate() / (1<<spanLog2);
int bw = ui->BW->value();
int lw = ui->lowCut->value();
int bwMax = m_freeDVDemod->getAudioSampleRate() / (100*(1<<spanLog2));
int tickInterval = m_spectrumRate / 1200;
tickInterval = tickInterval == 0 ? 1 : tickInterval;
m_spectrumRate = m_freeDVDemod->getModemSampleRate() / (1<<spanLog2);
int bwMax = m_freeDVDemod->getModemSampleRate() / (100*(1<<spanLog2));
qDebug() << "FreeDVDemodGUI::applyBandwidths:"
<< " dsb: " << dsb
<< " spanLog2: " << spanLog2
<< " m_spectrumRate: " << m_spectrumRate
<< " bw: " << bw
<< " lw: " << lw
<< " bwMax: " << bwMax
<< " tickInterval: " << tickInterval;
ui->BW->setTickInterval(tickInterval);
ui->lowCut->setTickInterval(tickInterval);
bw = bw < -bwMax ? -bwMax : bw > bwMax ? bwMax : bw;
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;
}
<< " bwMax: " << bwMax;
QString spanStr = QString::number(bwMax/10.0, 'f', 1);
QString bwStr = QString::number(bw/10.0, 'f', 1);
QString lwStr = QString::number(lw/10.0, 'f', 1);
if (dsb)
{
ui->BWText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(bwStr));
ui->spanText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(spanStr));
ui->scaleMinus->setText("0");
ui->scaleCenter->setText("");
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->spanText->setText(tr("%1k").arg(spanStr));
ui->glSpectrum->setCenterFrequency(m_spectrumRate/2);
ui->glSpectrum->setSampleRate(m_spectrumRate);
ui->glSpectrum->setSsbSpectrum(true);
ui->glSpectrum->setLsbDisplay(false);
ui->lowCutText->setText(tr("%1k").arg(lwStr));
ui->BW->blockSignals(true);
ui->lowCut->blockSignals(true);
ui->BW->setMaximum(bwMax);
ui->BW->setMinimum(dsb ? 0 : -bwMax);
ui->BW->setValue(bw);
ui->lowCut->setMaximum(dsb ? 0 : bwMax);
ui->lowCut->setMinimum(dsb ? 0 : -bwMax);
ui->lowCut->setValue(lw);
ui->lowCut->blockSignals(false);
ui->BW->blockSignals(false);
ui->channelPowerMeter->setRange(FreeDVDemodSettings::m_minPowerThresholdDB, 0);
m_settings.m_dsb = dsb;
m_settings.m_spanLog2 = spanLog2;
m_settings.m_rfBandwidth = bw * 100;
m_settings.m_lowCutoff = lw * 100;
applySettings(force);
bool wasBlocked = blockApplySettings(true);
m_channelMarker.setBandwidth(bw * 200);
m_channelMarker.setSidebands(dsb ? ChannelMarker::dsb : bw < 0 ? ChannelMarker::lsb : ChannelMarker::usb);
ui->dsb->setIcon(bw < 0 ? m_iconDSBLSB: m_iconDSBUSB);
if (!dsb) { m_channelMarker.setLowCutoff(lw * 100); }
blockApplySettings(wasBlocked);
// bool dsb = ui->dsb->isChecked();
// //int spanLog2 = ui->spanLog2->value();
// m_spectrumRate = m_freeDVDemod->getAudioSampleRate() / (1<<spanLog2);
// int bw = ui->BW->value();
// int lw = ui->lowCut->value();
// int bwMax = m_freeDVDemod->getAudioSampleRate() / (100*(1<<spanLog2));
// int tickInterval = m_spectrumRate / 1200;
// tickInterval = tickInterval == 0 ? 1 : tickInterval;
//
// qDebug() << "FreeDVDemodGUI::applyBandwidths:"
// << " dsb: " << dsb
// << " spanLog2: " << spanLog2
// << " m_spectrumRate: " << m_spectrumRate
// << " bw: " << bw
// << " lw: " << lw
// << " bwMax: " << bwMax
// << " tickInterval: " << tickInterval;
//
// ui->BW->setTickInterval(tickInterval);
// ui->lowCut->setTickInterval(tickInterval);
//
// bw = bw < -bwMax ? -bwMax : bw > bwMax ? bwMax : bw;
//
// 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;
// }
//
// QString spanStr = QString::number(bwMax/10.0, 'f', 1);
// QString bwStr = QString::number(bw/10.0, 'f', 1);
// QString lwStr = QString::number(lw/10.0, 'f', 1);
//
// if (dsb)
// {
// ui->BWText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(bwStr));
// ui->spanText->setText(tr("%1%2k").arg(QChar(0xB1, 0x00)).arg(spanStr));
// ui->scaleMinus->setText("0");
// ui->scaleCenter->setText("");
// 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->BW->blockSignals(true);
// ui->lowCut->blockSignals(true);
//
// ui->BW->setMaximum(bwMax);
// ui->BW->setMinimum(dsb ? 0 : -bwMax);
// ui->BW->setValue(bw);
//
// ui->lowCut->setMaximum(dsb ? 0 : bwMax);
// ui->lowCut->setMinimum(dsb ? 0 : -bwMax);
// ui->lowCut->setValue(lw);
//
// ui->lowCut->blockSignals(false);
// ui->BW->blockSignals(false);
//
// ui->channelPowerMeter->setRange(FreeDVDemodSettings::m_minPowerThresholdDB, 0);
//
// m_settings.m_dsb = dsb;
// m_settings.m_spanLog2 = spanLog2;
// m_settings.m_rfBandwidth = bw * 100;
// m_settings.m_lowCutoff = lw * 100;
//
// applySettings(force);
//
// bool wasBlocked = blockApplySettings(true);
// m_channelMarker.setBandwidth(bw * 200);
// m_channelMarker.setSidebands(dsb ? ChannelMarker::dsb : bw < 0 ? ChannelMarker::lsb : ChannelMarker::usb);
// ui->dsb->setIcon(bw < 0 ? m_iconDSBLSB: m_iconDSBUSB);
// if (!dsb) { m_channelMarker.setLowCutoff(lw * 100); }
// blockApplySettings(wasBlocked);
}
void FreeDVDemodGUI::displaySettings()
{
m_channelMarker.blockSignals(true);
m_channelMarker.setCenterFrequency(m_settings.m_inputFrequencyOffset);
m_channelMarker.setBandwidth(m_settings.m_rfBandwidth * 2);
m_channelMarker.setTitle(m_settings.m_title);
m_channelMarker.setLowCutoff(m_settings.m_lowCutoff);
ui->flipSidebands->setEnabled(!m_settings.m_dsb);
if (m_settings.m_dsb) {
m_channelMarker.setSidebands(ChannelMarker::dsb);
} else {
if (m_settings.m_rfBandwidth < 0) {
m_channelMarker.setSidebands(ChannelMarker::lsb);
ui->dsb->setIcon(m_iconDSBLSB);
} else {
m_channelMarker.setSidebands(ChannelMarker::usb);
ui->dsb->setIcon(m_iconDSBUSB);
}
}
m_channelMarker.setBandwidth(FreeDVDemodSettings::getHiCutoff(m_settings.m_freeDVMode) * 2);
m_channelMarker.setLowCutoff(FreeDVDemodSettings::getLowCutoff(m_settings.m_freeDVMode));
m_channelMarker.setSidebands(ChannelMarker::usb);
m_channelMarker.blockSignals(false);
m_channelMarker.setColor(m_settings.m_rgbColor); // activate signal on the last setting only
@ -517,45 +491,19 @@ void FreeDVDemodGUI::displaySettings()
ui->agc->setChecked(m_settings.m_agc);
ui->agcClamping->setChecked(m_settings.m_agcClamping);
ui->audioBinaural->setChecked(m_settings.m_audioBinaural);
ui->audioFlipChannels->setChecked(m_settings.m_audioFlipChannels);
ui->audioMute->setChecked(m_settings.m_audioMute);
ui->deltaFrequency->setValue(m_channelMarker.getCenterFrequency());
// Prevent uncontrolled triggering of applyBandwidths
ui->spanLog2->blockSignals(true);
ui->dsb->blockSignals(true);
ui->BW->blockSignals(true);
ui->dsb->setChecked(m_settings.m_dsb);
ui->spanLog2->setValue(5 - m_settings.m_spanLog2);
ui->BW->setValue(m_settings.m_rfBandwidth / 100.0);
QString s = QString::number(m_settings.m_rfBandwidth/1000.0, 'f', 1);
if (m_settings.m_dsb)
{
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->dsb->blockSignals(false);
ui->BW->blockSignals(false);
// The only one of the four signals triggering applyBandwidths will trigger it once only with all other values
// set correctly and therefore validate the settings and apply them to dependent widgets
ui->lowCut->setValue(m_settings.m_lowCutoff / 100.0);
ui->lowCutText->setText(tr("%1k").arg(m_settings.m_lowCutoff / 1000.0));
ui->volume->setValue(m_settings.m_volume * 10.0);
ui->volumeText->setText(QString("%1").arg(m_settings.m_volume, 0, 'f', 1));
ui->agcTimeLog2->setValue(m_settings.m_agcTimeLog2);
s = QString::number((1<<ui->agcTimeLog2->value()), 'f', 0);
QString s = QString::number((1<<ui->agcTimeLog2->value()), 'f', 0);
ui->agcTimeText->setText(s);
ui->agcPowerThreshold->setValue(m_settings.m_agcPowerThreshold);

View File

@ -96,11 +96,7 @@ private:
private slots:
void on_deltaFrequency_changed(qint64 value);
void on_audioBinaural_toggled(bool binaural);
void on_audioFlipChannels_toggled(bool flip);
void on_dsb_toggled(bool dsb);
void on_BW_valueChanged(int value);
void on_lowCut_valueChanged(int value);
void on_freeDVMode_currentIndexChanged(int index);
void on_volume_valueChanged(int value);
void on_agc_toggled(bool checked);
void on_agcClamping_toggled(bool checked);
@ -109,7 +105,6 @@ private slots:
void on_agcThresholdGate_valueChanged(int value);
void on_audioMute_toggled(bool checked);
void on_spanLog2_valueChanged(int value);
void on_flipSidebands_clicked(bool checked);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void handleInputMessages();

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>412</width>
<height>190</height>
<height>476</height>
</rect>
</property>
<property name="sizePolicy">
@ -29,7 +29,7 @@
</font>
</property>
<property name="windowTitle">
<string>SSB Demodulator</string>
<string>FreeDV Demodulator</string>
</property>
<widget class="QWidget" name="settingsContainer" native="true">
<property name="geometry">
@ -168,80 +168,35 @@
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="audioOptionsLayout">
<layout class="QHBoxLayout" name="freeDVOptionsLayout">
<property name="leftMargin">
<number>6</number>
</property>
<item>
<widget class="QToolButton" name="audioBinaural">
<widget class="QComboBox" name="freeDVMode">
<property name="toolTip">
<string>Toggle btw Mono and Binaural I/Q audio</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/mono.png</normaloff>
<normalon>:/stereo.png</normalon>:/mono.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="audioFlipChannels">
<property name="toolTip">
<string>Flip left/right audio channels</string>
</property>
<property name="text">
<string>...</string>
</property>
<property name="icon">
<iconset resource="../../../sdrgui/resources/res.qrc">
<normaloff>:/flip_lr.png</normaloff>
<normalon>:/flip_rl.png</normalon>:/flip_lr.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</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>
<string>FreeDV mode</string>
</property>
<item>
<property name="text">
<string>2400A</string>
</property>
</item>
<item>
<property name="text">
<string>1600</string>
</property>
</item>
<item>
<property name="text">
<string>800XA</string>
</property>
</item>
<item>
<property name="text">
<string>700D</string>
</property>
</item>
</widget>
</item>
</layout>
@ -260,7 +215,7 @@
<item>
<widget class="LevelMeterSignalDB" name="channelPowerMeter" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -281,377 +236,6 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="spanLayout">
<item>
<widget class="QLabel" name="spanLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Span</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="spanLog2">
<property name="toolTip">
<string>Demod frequency span</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>2</number>
</property>
<property name="sliderPosition">
<number>2</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="spanText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>6.0k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="lowCutLayout">
<item>
<widget class="QLabel" name="lowCutLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Low cut</string>
</property>
</widget>
</item>
<item>
<widget class="TickedSlider" name="lowCut">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Highpass filter cutoff frequency (SSB)</string>
</property>
<property name="minimum">
<number>-60</number>
</property>
<property name="maximum">
<number>60</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>3</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="invertedAppearance">
<bool>false</bool>
</property>
<property name="tickPosition">
<enum>QSlider::NoTicks</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lowCutText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>0.3k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="bqndwidthLayout">
<item>
<widget class="QLabel" name="BWLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Hi cut</string>
</property>
</widget>
</item>
<item>
<widget class="TickedSlider" name="BW">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16</height>
</size>
</property>
<property name="toolTip">
<string>Lowpass filter cutoff frequency</string>
</property>
<property name="minimum">
<number>-60</number>
</property>
<property name="maximum">
<number>60</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>30</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="BWText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>3.0k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</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>
<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>
<pointsize>8</pointsize>
</font>
</property>
<property name="text">
<string>-</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lsbLabel">
<property name="font">
<font>
<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>
<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>
<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>
<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>
<widget class="Line" name="line_3">
<property name="orientation">
@ -898,6 +482,76 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="spanLayout">
<item>
<widget class="QLabel" name="spanLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Span</string>
</property>
</widget>
</item>
<item>
<widget class="QSlider" name="spanLog2">
<property name="toolTip">
<string>Demod frequency span</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>2</number>
</property>
<property name="sliderPosition">
<number>2</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="spanText">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>6.0k</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="spectrumContainer" native="true">
@ -986,11 +640,6 @@
<extends>QToolButton</extends>
<header>gui/buttonswitch.h</header>
</customwidget>
<customwidget>
<class>TickedSlider</class>
<extends>QSlider</extends>
<header>gui/tickedslider.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../../../sdrgui/resources/res.qrc"/>

View File

@ -38,17 +38,12 @@ FreeDVDemodSettings::FreeDVDemodSettings() :
void FreeDVDemodSettings::resetToDefaults()
{
m_audioBinaural = false;
m_audioFlipChannels = false;
m_dsb = false;
m_audioMute = false;
m_agc = false;
m_agcClamping = false;
m_agcPowerThreshold = -40;
m_agcThresholdGate = 4;
m_agcTimeLog2 = 7;
m_rfBandwidth = 3000;
m_lowCutoff = 300;
m_volume = 3.0;
m_spanLog2 = 3;
m_inputFrequencyOffset = 0;
@ -67,7 +62,6 @@ QByteArray FreeDVDemodSettings::serialize() const
{
SimpleSerializer s(1);
s.writeS32(1, m_inputFrequencyOffset);
s.writeS32(2, m_rfBandwidth / 100.0);
s.writeS32(3, m_volume * 10.0);
if (m_spectrumGUI) {
@ -75,11 +69,7 @@ QByteArray FreeDVDemodSettings::serialize() const
}
s.writeU32(5, m_rgbColor);
s.writeS32(6, m_lowCutoff / 100.0);
s.writeS32(7, m_spanLog2);
s.writeBool(8, m_audioBinaural);
s.writeBool(9, m_audioFlipChannels);
s.writeBool(10, m_dsb);
s.writeBool(11, m_agc);
s.writeS32(12, m_agcTimeLog2);
s.writeS32(13, m_agcPowerThreshold);
@ -116,7 +106,6 @@ bool FreeDVDemodSettings::deserialize(const QByteArray& data)
d.readS32(1, &m_inputFrequencyOffset, 0);
d.readS32(2, &tmp, 30);
m_rfBandwidth = tmp * 100.0;
d.readS32(3, &tmp, 30);
m_volume = tmp / 10.0;
@ -127,11 +116,7 @@ bool FreeDVDemodSettings::deserialize(const QByteArray& data)
d.readU32(5, &m_rgbColor);
d.readS32(6, &tmp, 30);
m_lowCutoff = tmp * 100.0;
d.readS32(7, &m_spanLog2, 3);
d.readBool(8, &m_audioBinaural, false);
d.readBool(9, &m_audioFlipChannels, false);
d.readBool(10, &m_dsb, false);
d.readBool(11, &m_agc, false);
d.readS32(12, &m_agcTimeLog2, 7);
d.readS32(13, &m_agcPowerThreshold, -40);

View File

@ -34,13 +34,8 @@ struct FreeDVDemodSettings
} FreeDVMode;
qint32 m_inputFrequencyOffset;
Real m_rfBandwidth;
Real m_lowCutoff;
Real m_volume;
int m_spanLog2;
bool m_audioBinaural;
bool m_audioFlipChannels;
bool m_dsb;
bool m_audioMute;
bool m_agc;
bool m_agcClamping;

View File

@ -424,14 +424,11 @@ void FreeDVModGUI::applyBandwidths(int spanLog2, bool force)
{
m_spectrumRate = m_freeDVMod->getModemSampleRate() / (1<<spanLog2);
int bwMax = m_freeDVMod->getModemSampleRate() / (100*(1<<spanLog2));
int tickInterval = m_spectrumRate / 1200;
tickInterval = tickInterval == 0 ? 1 : tickInterval;
qDebug() << "FreeDVModGUI::applyBandwidths:"
<< " spanLog2: " << spanLog2
<< " m_spectrumRate: " << m_spectrumRate
<< " bwMax: " << bwMax
<< " tickInterval: " << tickInterval;
<< " bwMax: " << bwMax;
QString spanStr = QString::number(bwMax/10.0, 'f', 1);