1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-14 07:23:38 -04:00

WDSP Receiver: added squelch support plus corrections

This commit is contained in:
f4exb
2024-07-06 03:25:41 +02:00
parent ffef9ab48f
commit 043d9da47e
22 changed files with 1099 additions and 283 deletions
+3
View File
@@ -38,6 +38,8 @@ if(NOT SERVER_MODE)
wdsprxdnrdialog.ui
wdsprxfmdialog.cpp
wdsprxfmdialog.ui
wdsprxsquelchdialog.cpp
wdsprxsquelchdialog.ui
wdsprxgui.cpp
wdsprxgui.ui
)
@@ -50,6 +52,7 @@ if(NOT SERVER_MODE)
wdsprxdnbdialog.h
wdsprxdnrdialog.h
wdsprxfmdialog.h
wdsprxsquelchdialog.h
)
set(TARGET_NAME wdsprx)
set(TARGET_LIB "Qt::Widgets")
+2 -2
View File
@@ -262,7 +262,7 @@
<string>AF volume limter gain (dB)</string>
</property>
<property name="minimum">
<number>0</number>
<number>-30</number>
</property>
<property name="maximum">
<number>30</number>
@@ -271,7 +271,7 @@
<number>1</number>
</property>
<property name="value">
<number>10</number>
<number>0</number>
</property>
</widget>
</item>
+88 -7
View File
@@ -43,6 +43,7 @@
#include "wdsprxamdialog.h"
#include "wdsprxfmdialog.h"
#include "wdsprxcwpeakdialog.h"
#include "wdsprxsquelchdialog.h"
WDSPRxGUI* WDSPRxGUI::create(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSampleSink *rxChannel)
{
@@ -211,6 +212,15 @@ void WDSPRxGUI::on_agc_toggled(bool checked)
applySettings();
}
void WDSPRxGUI::on_agcGain_valueChanged(int value)
{
QString s = QString::number(value, 'f', 0);
ui->agcGainText->setText(s);
m_settings.m_agcGain = value;
m_settings.m_profiles[m_settings.m_profileIndex].m_agcGain = m_settings.m_agcGain;
applySettings();
}
void WDSPRxGUI::on_dnr_toggled(bool checked)
{
m_settings.m_dnr = checked;
@@ -232,12 +242,18 @@ void WDSPRxGUI::on_cwPeaking_toggled(bool checked)
applySettings();
}
void WDSPRxGUI::on_agcGain_valueChanged(int value)
void WDSPRxGUI::on_squelch_toggled(bool checked)
{
QString s = QString::number(value, 'f', 0);
ui->agcGainText->setText(s);
m_settings.m_agcGain = value;
m_settings.m_profiles[m_settings.m_profileIndex].m_agcGain = m_settings.m_agcGain;
m_settings.m_squelch = checked;
m_settings.m_profiles[m_settings.m_profileIndex].m_squelch = m_settings.m_squelch;
applySettings();
}
void WDSPRxGUI::on_squelchThreshold_valueChanged(int value)
{
m_settings.m_squelchThreshold = value;
m_settings.m_profiles[m_settings.m_profileIndex].m_squelchThreshold = m_settings.m_squelchThreshold;
ui->squelchThresholdText->setText(tr("%1").arg(m_settings.m_squelchThreshold));
applySettings();
}
@@ -322,6 +338,12 @@ void WDSPRxGUI::on_profileIndex_valueChanged(int value)
m_settings.m_fmAFLimiterGain = m_settings.m_profiles[m_settings.m_profileIndex].m_fmAFLimiterGain;
m_settings.m_fmCTCSSNotch = m_settings.m_profiles[m_settings.m_profileIndex].m_fmCTCSSNotch;
m_settings.m_fmCTCSSNotchFrequency = m_settings.m_profiles[m_settings.m_profileIndex].m_fmCTCSSNotchFrequency;
// Squelch
m_settings.m_squelch = m_settings.m_profiles[m_settings.m_profileIndex].m_squelch;
m_settings.m_squelchMode = m_settings.m_profiles[m_settings.m_profileIndex].m_squelchMode;
m_settings.m_ssqlTauMute = m_settings.m_profiles[m_settings.m_profileIndex].m_ssqlTauMute;
m_settings.m_ssqlTauUnmute = m_settings.m_profiles[m_settings.m_profileIndex].m_ssqlTauUnmute;
m_settings.m_amsqMaxTail = m_settings.m_profiles[m_settings.m_profileIndex].m_amsqMaxTail;
displaySettings();
applyBandwidths(m_settings.m_profiles[m_settings.m_profileIndex].m_spanLog2, true); // does applySettings(true)
}
@@ -344,7 +366,7 @@ void WDSPRxGUI::on_demod_currentIndexChanged(int index)
break;
}
displaySettings();
applySettings();
applyBandwidths(m_settings.m_profiles[m_settings.m_profileIndex].m_spanLog2, true); // does applySettings(true)
}
void WDSPRxGUI::onMenuDialogCalled(const QPoint &p)
@@ -424,7 +446,8 @@ WDSPRxGUI::WDSPRxGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
m_dnrDialog(nullptr),
m_amDialog(nullptr),
m_fmDialog(nullptr),
m_cwPeakDialog(nullptr)
m_cwPeakDialog(nullptr),
m_squelchDialog(nullptr)
{
setAttribute(Qt::WA_DeleteOnClose, true);
m_helpURL = "plugins/channelrx/demodssb/readme.md";
@@ -455,6 +478,9 @@ WDSPRxGUI::WDSPRxGUI(PluginAPI* pluginAPI, DeviceUISet *deviceUISet, BasebandSam
CRightClickEnabler *cwPeakRightClickEnabler = new CRightClickEnabler(ui->cwPeaking);
connect(cwPeakRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(cwPeakSetupDialog(const QPoint &)));
CRightClickEnabler *squelchRightClickEnabler = new CRightClickEnabler(ui->squelch);
connect(squelchRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(squelchSetupDialog(const QPoint &)));
CRightClickEnabler *demodRightClickEnabler = new CRightClickEnabler(ui->demod);
connect(demodRightClickEnabler, SIGNAL(rightClick(const QPoint &)), this, SLOT(demodSetupDialog(const QPoint &)));
@@ -727,6 +753,9 @@ void WDSPRxGUI::displaySettings()
ui->dnr->setChecked(m_settings.m_dnr);
ui->dnb->setChecked(m_settings.m_dnb);
ui->cwPeaking->setChecked(m_settings.m_cwPeaking);
ui->squelch->setChecked(m_settings.m_squelch);
ui->squelchThreshold->setValue(m_settings.m_squelchThreshold);
ui->squelchThresholdText->setText(tr("%1").arg(m_settings.m_squelchThreshold));
ui->audioBinaural->setChecked(m_settings.m_audioBinaural);
ui->audioFlipChannels->setChecked(m_settings.m_audioFlipChannels);
ui->audioMute->setChecked(m_settings.m_audioMute);
@@ -1122,6 +1151,56 @@ void WDSPRxGUI::fmSetup(int iValueChanged)
}
}
void WDSPRxGUI::squelchSetupDialog(const QPoint& p)
{
m_squelchDialog = new WDSPRxSquelchDialog();
m_squelchDialog->move(p);
m_squelchDialog->setMode(m_settings.m_squelchMode);
m_squelchDialog->setSSQLTauMute(m_settings.m_ssqlTauMute);
m_squelchDialog->setSSQLTauUnmute(m_settings.m_ssqlTauUnmute);
m_squelchDialog->setAMSQMaxTail(m_settings.m_amsqMaxTail);
QObject::connect(m_squelchDialog, &WDSPRxSquelchDialog::valueChanged, this, &WDSPRxGUI::squelchSetup);
m_squelchDialog->exec();
QObject::disconnect(m_squelchDialog, &WDSPRxSquelchDialog::valueChanged, this, &WDSPRxGUI::squelchSetup);
m_squelchDialog->deleteLater();
m_squelchDialog = nullptr;
}
void WDSPRxGUI::squelchSetup(int iValueChanged)
{
if (!m_squelchDialog) {
return;
}
WDSPRxSquelchDialog::ValueChanged valueChanged = (WDSPRxSquelchDialog::ValueChanged) iValueChanged;
switch (valueChanged)
{
case WDSPRxSquelchDialog::ChangedMode:
m_settings.m_squelchMode = m_squelchDialog->getMode();
m_settings.m_profiles[m_settings.m_profileIndex].m_squelchMode = m_settings.m_squelchMode;
applySettings();
break;
case WDSPRxSquelchDialog::ChangedSSQLTauMute:
m_settings.m_ssqlTauMute = m_squelchDialog->getSSQLTauMute();
m_settings.m_profiles[m_settings.m_profileIndex].m_ssqlTauMute = m_settings.m_ssqlTauMute;
applySettings();
break;
case WDSPRxSquelchDialog::ChangedSSQLTauUnmute:
m_settings.m_ssqlTauUnmute = m_squelchDialog->getSSQLTauUnmute();
m_settings.m_profiles[m_settings.m_profileIndex].m_ssqlTauUnmute = m_settings.m_ssqlTauUnmute;
applySettings();
break;
case WDSPRxSquelchDialog::ChangedAMSQMaxTail:
m_settings.m_amsqMaxTail = m_squelchDialog->getAMSQMaxTail();
m_settings.m_profiles[m_settings.m_profileIndex].m_amsqMaxTail = m_settings.m_amsqMaxTail;
applySettings();
break;
default:
break;
}
}
void WDSPRxGUI::tick()
{
double powDbAvg, powDbPeak;
@@ -1176,6 +1255,8 @@ void WDSPRxGUI::makeUIConnections()
QObject::connect(ui->filterIndex, &QDial::valueChanged, this, &WDSPRxGUI::on_profileIndex_valueChanged);
QObject::connect(ui->demod, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &WDSPRxGUI::on_demod_currentIndexChanged);
QObject::connect(ui->cwPeaking, &ButtonSwitch::toggled, this, &WDSPRxGUI::on_cwPeaking_toggled);
QObject::connect(ui->squelch, &ButtonSwitch::toggled, this, &WDSPRxGUI::on_squelch_toggled);
QObject::connect(ui->squelchThreshold, &QDial::valueChanged, this, &WDSPRxGUI::on_squelchThreshold_valueChanged);
}
void WDSPRxGUI::updateAbsoluteCenterFrequency()
+6
View File
@@ -40,6 +40,7 @@ class WDSPRxDNRDialog;
class WDSPRxAMDialog;
class WDSPRxFMDialog;
class WDSPRxCWPeakDialog;
class WDSPRxSquelchDialog;
class SpectrumVis;
class BasebandSampleSink;
@@ -101,6 +102,7 @@ private:
WDSPRxAMDialog* m_amDialog;
WDSPRxFMDialog* m_fmDialog;
WDSPRxCWPeakDialog* m_cwPeakDialog;
WDSPRxSquelchDialog* m_squelchDialog;
QIcon m_iconDSBUSB;
QIcon m_iconDSBLSB;
@@ -140,6 +142,8 @@ private slots:
void on_profileIndex_valueChanged(int value);
void on_demod_currentIndexChanged(int index);
void on_cwPeaking_toggled(bool checked);
void on_squelch_toggled(bool checked);
void on_squelchThreshold_valueChanged(int value);
void onWidgetRolled(QWidget* widget, bool rollDown);
void onMenuDialogCalled(const QPoint& p);
void handleInputMessages();
@@ -155,6 +159,8 @@ private slots:
void demodSetupDialog(const QPoint& p);
void amSetup(int valueChanged);
void fmSetup(int valueChanged);
void squelchSetupDialog(const QPoint& p);
void squelchSetup(int valueChanged);
void tick();
};
+58 -1
View File
@@ -429,7 +429,7 @@
</size>
</property>
<property name="toolTip">
<string>Select filter in filter bank</string>
<string>Select profile in profile bank</string>
</property>
<property name="minimum">
<number>0</number>
@@ -936,6 +936,63 @@
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="squelch">
<property name="toolTip">
<string>Toggle squelch (righ-click for options)</string>
</property>
<property name="text">
<string>SQ</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QDial" name="squelchThreshold">
<property name="maximumSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolTip">
<string>Squelch threshold (%)</string>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>100</number>
</property>
<property name="pageStep">
<number>1</number>
</property>
<property name="value">
<number>3</number>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="squelchThresholdText">
<property name="minimumSize">
<size>
<width>22</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Power threshold gate (ms)</string>
</property>
<property name="text">
<string>000</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
+69 -29
View File
@@ -82,10 +82,17 @@ void WDSPRxSettings::resetToDefaults()
m_fmAFLimiterGain = 10.0;
m_fmCTCSSNotch = false;
m_fmCTCSSNotchFrequency = 67.0;
// Squelch
m_squelch = false;
m_squelchThreshold = 3;
m_squelchMode = WDSPRxProfile::SquelchModeVoice;
m_ssqlTauMute = 0.1;
m_ssqlTauUnmute = 0.1;
m_amsqMaxTail = 1.5;
//
m_volume = 1.0;
m_inputFrequencyOffset = 0;
m_rgbColor = QColor(0, 255, 0).rgb();
m_rgbColor = QColor(0, 255, 196).rgb();
m_title = "WDSP Receiver";
m_audioDeviceName = AudioDeviceManager::m_defaultDeviceName;
m_streamIndex = 0;
@@ -150,6 +157,12 @@ QByteArray WDSPRxSettings::serialize() const
s.writeDouble(49, m_fmAFLimiterGain);
s.writeBool( 50, m_fmCTCSSNotch);
s.writeDouble(51, m_fmCTCSSNotchFrequency);
// Squelch
s.writeBool( 60, m_squelch);
s.writeS32( 61, m_squelchThreshold);
s.writeDouble(62, m_ssqlTauMute);
s.writeDouble(63, m_ssqlTauUnmute);
s.writeDouble(64, m_amsqMaxTail);
//
s.writeString(70, m_title);
s.writeString(71, m_audioDeviceName);
@@ -213,6 +226,12 @@ QByteArray WDSPRxSettings::serialize() const
s.writeDouble(149 + 100*i, m_profiles[i].m_fmAFLimiterGain);
s.writeBool( 150 + 100*i, m_profiles[i].m_fmCTCSSNotch);
s.writeDouble(151 + 100*i, m_profiles[i].m_fmCTCSSNotchFrequency);
// Squelch
s.writeBool( 160 + 100*i, m_profiles[i].m_squelch);
s.writeS32( 161 + 100*i, m_profiles[i].m_squelchThreshold);
s.writeDouble(162 + 100*i, m_profiles[i].m_ssqlTauMute);
s.writeDouble(163 + 100*i, m_profiles[i].m_ssqlTauUnmute);
s.writeDouble(164 + 100*i, m_profiles[i].m_amsqMaxTail);
}
return s.final();
@@ -294,6 +313,12 @@ bool WDSPRxSettings::deserialize(const QByteArray& data)
d.readDouble(49, &m_fmAFLimiterGain, 10.0);
d.readBool( 50, &m_fmCTCSSNotch, false);
d.readDouble(51, &m_fmCTCSSNotchFrequency, 67.0);
// Squelch
d.readBool( 60, &m_squelch, false);
d.readS32( 61, &m_squelchThreshold, 3);
d.readDouble(62, &m_ssqlTauMute, 0.1);
d.readDouble(63, &m_ssqlTauUnmute, 0.1);
d.readDouble(64, &m_amsqMaxTail, 1.5);
//
d.readString(70, &m_title, "WDSP Receiver");
d.readString(71, &m_audioDeviceName, AudioDeviceManager::m_defaultDeviceName);
@@ -327,49 +352,64 @@ bool WDSPRxSettings::deserialize(const QByteArray& data)
for (unsigned int i = 0; (i < 10); i++)
{
d.readS32 (104 + 50*i, &tmp, 9);
d.readS32 (104 + 100*i, &tmp, 9);
m_profiles[i].m_demod = (WDSPRxProfile::WDSPRxDemod) tmp;
// Filter
d.readS32 (100 + 50*i, &m_profiles[i].m_spanLog2, 3);
d.readS32 (101 + 50*i, &tmp, 30);
d.readS32 (100 + 100*i, &m_profiles[i].m_spanLog2, 3);
d.readS32 (101 + 100*i, &tmp, 30);
m_profiles[i].m_highCutoff = tmp * 100.0;
d.readS32 (102 + 50*i, &tmp, 3);
d.readS32 (102 + 100*i, &tmp, 3);
m_profiles[i].m_lowCutoff = tmp * 100.0;
d.readS32 (103 + 50*i, &m_profiles[i].m_fftWindow, 0);
d.readS32 (103 + 100*i, &m_profiles[i].m_fftWindow, 0);
// AGC
d.readBool( 110, &m_profiles[i].m_agc, true);
d.readS32( 111, &tmp, 2);
d.readBool( 110 + 100*i, &m_profiles[i].m_agc, true);
d.readS32( 111 + 100*i, &tmp, 2);
m_profiles[i].m_agcMode = (WDSPRxProfile::WDSPRxAGCMode) tmp;
d.readS32( 112, &m_profiles[i].m_agcGain, 80);
d.readS32( 113, &m_profiles[i].m_agcSlope, 35);
d.readS32( 114, &m_profiles[i].m_agcHangThreshold, 0);
d.readS32( 112 + 100*i, &m_profiles[i].m_agcGain, 80);
d.readS32( 113 + 100*i, &m_profiles[i].m_agcSlope, 35);
d.readS32( 114 + 100*i, &m_profiles[i].m_agcHangThreshold, 0);
// Noise blanker
d.readBool (120 + 50*i, &m_profiles[i].m_dnb, false);
d.readS32 (121 + 50*i, &tmp);
d.readBool (120 + 100*i, &m_profiles[i].m_dnb, false);
d.readS32 (121 + 100*i, &tmp);
m_profiles[i].m_nbScheme = (WDSPRxProfile::WDSPRxNBScheme) tmp;
d.readS32 (122 + 50*i, &tmp);
d.readS32 (122 + 100*i, &tmp);
m_profiles[i].m_nb2Mode = (WDSPRxProfile::WDSPRxNB2Mode) tmp;
d.readDouble(123 + 50*i, &m_profiles[i].m_nbSlewTime, 0.1);
d.readDouble(124 + 50*i, &m_profiles[i].m_nbLeadTime, 0.1);
d.readDouble(125 + 50*i, &m_profiles[i].m_nbLagTime, 0.1);
d.readS32 (126 + 50*i, &m_profiles[i].m_nbThreshold, 30);
d.readDouble(127 + 50*i, &m_profiles[i].m_nbAvgTime, 50.0);
d.readDouble(123 + 100*i, &m_profiles[i].m_nbSlewTime, 0.1);
d.readDouble(124 + 100*i, &m_profiles[i].m_nbLeadTime, 0.1);
d.readDouble(125 + 100*i, &m_profiles[i].m_nbLagTime, 0.1);
d.readS32 (126 + 100*i, &m_profiles[i].m_nbThreshold, 30);
d.readDouble(127 + 100*i, &m_profiles[i].m_nbAvgTime, 50.0);
// Noise reduction
d.readBool (130 + 50*i, &m_profiles[i].m_dnr, false);
d.readBool (132 + 50*i, &m_profiles[i].m_anf, false);
d.readS32 (133 + 50*i, &tmp);
d.readBool (130 + 100*i, &m_profiles[i].m_dnr, false);
d.readBool (132 + 100*i, &m_profiles[i].m_anf, false);
d.readS32 (133 + 100*i, &tmp);
m_profiles[i].m_nrScheme = (WDSPRxProfile::WDSPRxNRScheme) tmp;
d.readS32 (134 + 50*i, &tmp);
d.readS32 (134 + 100*i, &tmp);
m_profiles[i].m_nr2Gain = (WDSPRxProfile::WDSPRxNR2Gain) tmp;
d.readS32 (135 + 50*i, &tmp);
d.readS32 (135 + 100*i, &tmp);
m_profiles[i].m_nr2NPE = (WDSPRxProfile::WDSPRxNR2NPE) tmp;
d.readS32 (136 + 50*i, &tmp);
d.readS32 (136 + 100*i, &tmp);
m_profiles[i].m_nrPosition = (WDSPRxProfile::WDSPRxNRPosition) tmp;
d.readBool (137 + 50*i, &m_profiles[i].m_nr2ArtifactReduction);
d.readBool (137 + 100*i, &m_profiles[i].m_nr2ArtifactReduction);
// Demods
d.readBool (140 + 50*i, &m_amFadeLevel, false);
d.readBool (141 + 50*i, &m_cwPeaking, false);
d.readDouble(142 + 50*i, &m_profiles[i].m_cwPeakFrequency, 600.0);
d.readBool (140 + 100*i, &m_amFadeLevel, false);
d.readBool (141 + 100*i, &m_cwPeaking, false);
d.readDouble(142 + 100*i, &m_profiles[i].m_cwPeakFrequency, 600.0);
d.readDouble(143 + 100*i, &m_profiles[i].m_cwBandwidth, 100.0);
d.readDouble(144 + 100*i, &m_profiles[i].m_cwGain, 2.0);
d.readDouble(145 + 100*i, &m_profiles[i].m_fmDeviation, 2500.0);
d.readDouble(146 + 100*i, &m_profiles[i].m_fmAFLow, 300.0);
d.readDouble(147 + 100*i, &m_profiles[i].m_fmAFHigh, 3000.0);
d.readBool( 148 + 100*i, &m_profiles[i].m_fmAFLimiter, false);
d.readDouble(149 + 100*i, &m_profiles[i].m_fmAFLimiterGain, 10.0);
d.readBool( 150 + 100*i, &m_profiles[i].m_fmCTCSSNotch, false);
d.readDouble(151 + 100*i, &m_profiles[i].m_fmCTCSSNotchFrequency, 67.0);
// Squelch
d.readBool( 160 + 100*i, &m_profiles[i].m_squelch, false);
d.readS32( 161 + 100*i, &m_profiles[i].m_squelchThreshold, 3);
d.readDouble(161 + 100*i, &m_profiles[i].m_ssqlTauMute, 0.1);
d.readDouble(162 + 100*i, &m_profiles[i].m_ssqlTauUnmute, 0.1);
d.readDouble(163 + 100*i, &m_profiles[i].m_amsqMaxTail, 1.5);
}
return true;
+27 -1
View File
@@ -76,6 +76,12 @@ struct WDSPRxProfile
NB2ModeHoldSample,
NB2ModeInterpolate,
};
enum WDSPRxSquelchMode
{
SquelchModeVoice,
SquelchModeAM,
SquelchModeFM,
};
WDSPRxDemod m_demod;
// Filter
@@ -119,6 +125,13 @@ struct WDSPRxProfile
double m_fmAFLimiterGain;
bool m_fmCTCSSNotch;
double m_fmCTCSSNotchFrequency;
// Squelch
bool m_squelch;
int m_squelchThreshold;
WDSPRxSquelchMode m_squelchMode;
double m_ssqlTauMute; //!< Voice squelch tau mute
double m_ssqlTauUnmute; //!< Voice squelch tau unmute
double m_amsqMaxTail;
WDSPRxProfile() :
m_demod(DemodSSB),
@@ -157,7 +170,13 @@ struct WDSPRxProfile
m_fmAFLimiter(false),
m_fmAFLimiterGain(10.0),
m_fmCTCSSNotch(false),
m_fmCTCSSNotchFrequency(67.0)
m_fmCTCSSNotchFrequency(67.0),
m_squelch(false),
m_squelchThreshold(3),
m_squelchMode(SquelchModeVoice),
m_ssqlTauMute(0.1),
m_ssqlTauUnmute(0.1),
m_amsqMaxTail(1.5)
{}
};
@@ -209,6 +228,13 @@ struct WDSPRxSettings
double m_fmAFLimiterGain;
bool m_fmCTCSSNotch;
double m_fmCTCSSNotchFrequency;
// Squelch
bool m_squelch;
int m_squelchThreshold;
WDSPRxProfile::WDSPRxSquelchMode m_squelchMode;
double m_ssqlTauMute; //!< Voice squelch tau mute
double m_ssqlTauUnmute; //!< Voice squelch tau unmute
double m_amsqMaxTail;
quint32 m_rgbColor;
QString m_title;
+57
View File
@@ -39,6 +39,9 @@
#include "amd.hpp"
#include "fmd.hpp"
#include "iir.cpp"
#include "ssql.hpp"
#include "amsq.hpp"
#include "fmsq.hpp"
#include "wdsprxsink.h"
@@ -656,6 +659,60 @@ void WDSPRxSink::applySettings(const WDSPRxSettings& settings, bool force)
WDSP::FMD::SetCTCSSFreq(*m_rxa, settings.m_fmCTCSSNotchFrequency);
}
// Squelch
if ((m_settings.m_squelch != settings.m_squelch)
|| (m_settings.m_squelchThreshold != settings.m_squelchThreshold)
|| (m_settings.m_squelchMode != settings.m_squelchMode) || force)
{
WDSP::SSQL::SetSSQLRun(*m_rxa, 0);
WDSP::AMSQ::SetAMSQRun(*m_rxa, 0);
WDSP::FMSQ::SetFMSQRun(*m_rxa, 0);
if (settings.m_squelch)
{
switch(settings.m_squelchMode)
{
case WDSPRxProfile::SquelchModeVoice:
{
WDSP::SSQL::SetSSQLRun(*m_rxa, 1);
double threshold = 0.0075 * settings.m_squelchThreshold;
WDSP::SSQL::SetSSQLThreshold(*m_rxa, threshold);
}
break;
case WDSPRxProfile::SquelchModeAM:
{
WDSP::AMSQ::SetAMSQRun(*m_rxa, 1);
double threshold = ((settings.m_squelchThreshold / 100.0) * 160.0) - 160.0;
WDSP::AMSQ::SetAMSQThreshold(*m_rxa, threshold);
}
break;
case WDSPRxProfile::SquelchModeFM:
{
WDSP::FMSQ::SetFMSQRun(*m_rxa, 1);
double threshold = pow(10.0, -2.0 * ((double) settings.m_squelchThreshold) / 100.0);
qDebug("WDSPRxSink::applySettings: FM squelch %lf", threshold);
WDSP::FMSQ::SetFMSQThreshold(*m_rxa, threshold);
}
break;
default:
break;
}
}
}
if ((m_settings.m_ssqlTauMute != settings.m_ssqlTauMute) || force) {
WDSP::SSQL::SetSSQLTauMute(*m_rxa, settings.m_ssqlTauMute);
}
if ((m_settings.m_ssqlTauUnmute != settings.m_ssqlTauUnmute) || force) {
WDSP::SSQL::SetSSQLTauUnMute(*m_rxa, settings.m_ssqlTauUnmute);
}
if ((m_settings.m_amsqMaxTail != settings.m_amsqMaxTail) || force) {
WDSP::AMSQ::SetAMSQMaxTail(*m_rxa, settings.m_amsqMaxTail);
}
// Audio panel
if ((m_settings.m_volume != settings.m_volume) || force) {
@@ -0,0 +1,172 @@
///////////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2024 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////////
#include "wdsprxsquelchdialog.h"
#include "ui_wdsprxsquelchdialog.h"
WDSPRxSquelchDialog::WDSPRxSquelchDialog(QWidget* parent) :
QDialog(parent),
ui(new Ui::WDSPRxSquelchDialog)
{
ui->setupUi(this);
}
WDSPRxSquelchDialog::~WDSPRxSquelchDialog()
{
delete ui;
}
void WDSPRxSquelchDialog::setMode(WDSPRxProfile::WDSPRxSquelchMode mode)
{
ui->voiceSquelchGroup->blockSignals(true);
ui->amSquelchGroup->blockSignals(true);
ui->fmSquelchGroup->blockSignals(true);
ui->voiceSquelchGroup->setChecked(false);
ui->amSquelchGroup->setChecked(false);
ui->fmSquelchGroup->setChecked(false);
switch(mode)
{
case WDSPRxProfile::SquelchModeVoice:
ui->voiceSquelchGroup->setChecked(true);
break;
case WDSPRxProfile::SquelchModeAM:
ui->amSquelchGroup->setChecked(true);
break;
case WDSPRxProfile::SquelchModeFM:
ui->fmSquelchGroup->setChecked(true);
break;
default:
break;
}
ui->voiceSquelchGroup->blockSignals(false);
ui->amSquelchGroup->blockSignals(false);
ui->fmSquelchGroup->blockSignals(false);
}
void WDSPRxSquelchDialog::setSSQLTauMute(double value)
{
ui->ssqlTauMute->blockSignals(true);
ui->ssqlTauMute->setValue(value);
ui->ssqlTauMute->blockSignals(false);
}
void WDSPRxSquelchDialog::setSSQLTauUnmute(double value)
{
ui->ssqlTauUnmute->blockSignals(true);
ui->ssqlTauUnmute->setValue(value);
ui->ssqlTauUnmute->blockSignals(false);
}
void WDSPRxSquelchDialog::setAMSQMaxTail(double value)
{
ui->amsqMaxTail->blockSignals(true);
ui->amsqMaxTail->setValue(value);
ui->amsqMaxTail->blockSignals(false);
}
void WDSPRxSquelchDialog::on_voiceSquelchGroup_clicked(bool checked)
{
if (checked)
{
ui->amSquelchGroup->blockSignals(true);
ui->fmSquelchGroup->blockSignals(true);
ui->amSquelchGroup->setChecked(false);
ui->fmSquelchGroup->setChecked(false);
m_mode = WDSPRxProfile::SquelchModeVoice;
ui->amSquelchGroup->blockSignals(false);
ui->fmSquelchGroup->blockSignals(false);
emit valueChanged(ChangedMode);
}
else
{
ui->voiceSquelchGroup->blockSignals(true);
ui->voiceSquelchGroup->setChecked(true);
ui->voiceSquelchGroup->blockSignals(false);
}
}
void WDSPRxSquelchDialog::on_amSquelchGroup_clicked(bool checked)
{
if (checked)
{
ui->voiceSquelchGroup->blockSignals(true);
ui->fmSquelchGroup->blockSignals(true);
ui->voiceSquelchGroup->setChecked(false);
ui->fmSquelchGroup->setChecked(false);
m_mode = WDSPRxProfile::SquelchModeAM;
ui->voiceSquelchGroup->blockSignals(false);
ui->fmSquelchGroup->blockSignals(false);
emit valueChanged(ChangedMode);
}
else
{
ui->amSquelchGroup->blockSignals(true);
ui->amSquelchGroup->setChecked(true);
ui->amSquelchGroup->blockSignals(false);
}
}
void WDSPRxSquelchDialog::on_fmSquelchGroup_clicked(bool checked)
{
if (checked)
{
ui->voiceSquelchGroup->blockSignals(true);
ui->amSquelchGroup->blockSignals(true);
ui->voiceSquelchGroup->setChecked(false);
ui->amSquelchGroup->setChecked(false);
m_mode = WDSPRxProfile::SquelchModeFM;
ui->voiceSquelchGroup->blockSignals(false);
ui->amSquelchGroup->blockSignals(false);
emit valueChanged(ChangedMode);
}
else
{
ui->fmSquelchGroup->blockSignals(true);
ui->fmSquelchGroup->setChecked(true);
ui->fmSquelchGroup->blockSignals(false);
}
}
void WDSPRxSquelchDialog::on_ssqlTauMute_valueChanged(double value)
{
m_ssqlTauMute = value;
emit valueChanged(ChangedSSQLTauMute);
}
void WDSPRxSquelchDialog::on_ssqlTauUnmute_valueChanged(double value)
{
m_ssqlTauUnmute = value;
emit valueChanged(ChangedSSQLTauUnmute);
}
void WDSPRxSquelchDialog::on_amsqMaxTail_valueChanged(double value)
{
m_amsqMaxTail = value;
emit valueChanged(ChangedAMSQMaxTail);
}
@@ -0,0 +1,71 @@
///////////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2024 Edouard Griffiths, F4EXB <f4exb06@gmail.com> //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////////
#ifndef INCLUDE_WDSPRXSQUELCHDIALOG_H
#define INCLUDE_WDSPRXSQUELCHDIALOG_H
#include <QDialog>
#include "export.h"
#include "wdsprxsettings.h"
namespace Ui {
class WDSPRxSquelchDialog;
}
class SDRGUI_API WDSPRxSquelchDialog : public QDialog {
Q_OBJECT
public:
enum ValueChanged {
ChangedMode,
ChangedSSQLTauMute,
ChangedSSQLTauUnmute,
ChangedAMSQMaxTail,
};
explicit WDSPRxSquelchDialog(QWidget* parent = nullptr);
~WDSPRxSquelchDialog();
void setMode(WDSPRxProfile::WDSPRxSquelchMode mode);
void setSSQLTauMute(double value);
void setSSQLTauUnmute(double value);
void setAMSQMaxTail(double value);
WDSPRxProfile::WDSPRxSquelchMode getMode() const { return m_mode; }
double getSSQLTauMute() const { return m_ssqlTauMute; }
double getSSQLTauUnmute() const { return m_ssqlTauUnmute; }
double getAMSQMaxTail() const { return m_amsqMaxTail; }
signals:
void valueChanged(int valueChanged);
private:
Ui::WDSPRxSquelchDialog *ui;
WDSPRxProfile::WDSPRxSquelchMode m_mode;
double m_ssqlTauMute; //!< Voice squelch tau mute
double m_ssqlTauUnmute; //!< Voice squelch tau unmute
double m_amsqMaxTail;
private slots:
void on_voiceSquelchGroup_clicked(bool checked);
void on_amSquelchGroup_clicked(bool checked);
void on_fmSquelchGroup_clicked(bool checked);
void on_ssqlTauMute_valueChanged(double value);
void on_ssqlTauUnmute_valueChanged(double value);
void on_amsqMaxTail_valueChanged(double value);
};
#endif
@@ -0,0 +1,268 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>WDSPRxSquelchDialog</class>
<widget class="QDialog" name="WDSPRxSquelchDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>382</width>
<height>238</height>
</rect>
</property>
<property name="windowTitle">
<string>Squelch Settings</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="voiceSquelchGroup">
<property name="minimumSize">
<size>
<width>370</width>
<height>70</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QGroupBox {
border: 1px solid gray;
} </string>
</property>
<property name="title">
<string>Voice Squelch (SSB)</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<widget class="QLabel" name="ssqlTauMuteLabel">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>91</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Tau mute (s)</string>
</property>
</widget>
<widget class="QDoubleSpinBox" name="ssqlTauMute">
<property name="geometry">
<rect>
<x>100</x>
<y>30</y>
<width>70</width>
<height>29</height>
</rect>
</property>
<property name="toolTip">
<string>Add yaw offset to help with aligning images on the map.</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>2.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.100000000000000</double>
</property>
</widget>
<widget class="QLabel" name="ssqlTauUnmuteLabel">
<property name="geometry">
<rect>
<x>180</x>
<y>30</y>
<width>111</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Tau unmute (s)</string>
</property>
</widget>
<widget class="QDoubleSpinBox" name="ssqlTauUnmute">
<property name="geometry">
<rect>
<x>290</x>
<y>30</y>
<width>70</width>
<height>29</height>
</rect>
</property>
<property name="toolTip">
<string>Add yaw offset to help with aligning images on the map.</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.100000000000000</double>
</property>
</widget>
</widget>
</item>
<item>
<widget class="QGroupBox" name="amSquelchGroup">
<property name="minimumSize">
<size>
<width>370</width>
<height>70</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QGroupBox {
border: 1px solid gray;
} </string>
</property>
<property name="title">
<string>AM Squelch (AM, SAM, CW)</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
<widget class="QLabel" name="amsqMaxTailLabel">
<property name="geometry">
<rect>
<x>10</x>
<y>30</y>
<width>81</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>Max Tail (s)</string>
</property>
</widget>
<widget class="QDoubleSpinBox" name="amsqMaxTail">
<property name="geometry">
<rect>
<x>100</x>
<y>30</y>
<width>70</width>
<height>29</height>
</rect>
</property>
<property name="toolTip">
<string>Add yaw offset to help with aligning images on the map.</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>0.100000000000000</double>
</property>
<property name="maximum">
<double>3.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="value">
<double>1.500000000000000</double>
</property>
</widget>
</widget>
</item>
<item>
<widget class="QGroupBox" name="fmSquelchGroup">
<property name="minimumSize">
<size>
<width>370</width>
<height>35</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">QGroupBox {
border: 1px solid gray;
} </string>
</property>
<property name="title">
<string>FM Squelch (FM)</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="checked">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Close</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>WDSPRxSquelchDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>WDSPRxSquelchDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>