From 8b10dd05ff433220292017e9e30be973054729a1 Mon Sep 17 00:00:00 2001 From: f4exb Date: Wed, 3 Jul 2024 19:25:28 +0200 Subject: [PATCH] WDSP receiver: Removed SNB --- .../channelmimo/interferometer/interferometer.h | 3 ++- plugins/channelrx/wdsprx/wdsprxdnrdialog.cpp | 14 -------------- plugins/channelrx/wdsprx/wdsprxdnrdialog.h | 5 ----- plugins/channelrx/wdsprx/wdsprxdnrdialog.ui | 10 ---------- plugins/channelrx/wdsprx/wdsprxgui.cpp | 7 ------- plugins/channelrx/wdsprx/wdsprxsettings.cpp | 5 ----- plugins/channelrx/wdsprx/wdsprxsettings.h | 3 --- plugins/channelrx/wdsprx/wdsprxsink.cpp | 7 ++----- 8 files changed, 4 insertions(+), 50 deletions(-) diff --git a/plugins/channelmimo/interferometer/interferometer.h b/plugins/channelmimo/interferometer/interferometer.h index 927282675..d600cb77f 100644 --- a/plugins/channelmimo/interferometer/interferometer.h +++ b/plugins/channelmimo/interferometer/interferometer.h @@ -21,6 +21,7 @@ #include #include +#include #include "dsp/mimochannel.h" #include "dsp/spectrumvis.h" @@ -185,7 +186,7 @@ private: ScopeVis m_scopeSink; QThread *m_thread; InterferometerBaseband* m_basebandSink; - QMutex m_mutex; + QRecursiveMutex m_mutex; bool m_running; InterferometerSettings m_settings; MessageQueue *m_guiMessageQueue; //!< Input message queue to the GUI diff --git a/plugins/channelrx/wdsprx/wdsprxdnrdialog.cpp b/plugins/channelrx/wdsprx/wdsprxdnrdialog.cpp index d48ad9143..96d7285a4 100644 --- a/plugins/channelrx/wdsprx/wdsprxdnrdialog.cpp +++ b/plugins/channelrx/wdsprx/wdsprxdnrdialog.cpp @@ -29,14 +29,6 @@ WDSPRxDNRDialog::~WDSPRxDNRDialog() delete ui; } -void WDSPRxDNRDialog::setSNB(bool snb) -{ - ui->snb->blockSignals(true); - ui->snb->setChecked(snb); - ui->snb->blockSignals(false); - m_snb = snb; -} - void WDSPRxDNRDialog::setANF(bool anf) { ui->anf->blockSignals(true); @@ -85,12 +77,6 @@ void WDSPRxDNRDialog::setNR2ArtifactReduction(bool nr2ArtifactReducion) m_nr2ArtifactReduction = nr2ArtifactReducion; } -void WDSPRxDNRDialog::on_snb_clicked(bool checked) -{ - m_snb = checked; - emit valueChanged(ChangedSNB); -} - void WDSPRxDNRDialog::on_anf_clicked(bool checked) { m_anf = checked; diff --git a/plugins/channelrx/wdsprx/wdsprxdnrdialog.h b/plugins/channelrx/wdsprx/wdsprxdnrdialog.h index 24d4aa129..622479d1f 100644 --- a/plugins/channelrx/wdsprx/wdsprxdnrdialog.h +++ b/plugins/channelrx/wdsprx/wdsprxdnrdialog.h @@ -30,7 +30,6 @@ class SDRGUI_API WDSPRxDNRDialog : public QDialog { Q_OBJECT public: enum ValueChanged { - ChangedSNB, ChangedANF, ChangedNR, ChangedNR2Gain, @@ -42,7 +41,6 @@ public: explicit WDSPRxDNRDialog(QWidget* parent = nullptr); ~WDSPRxDNRDialog(); - void setSNB(bool snb); void setANF(bool anf); void setNRScheme(WDSPRxProfile::WDSPRxNRScheme scheme); void setNR2Gain(WDSPRxProfile::WDSPRxNR2Gain gain); @@ -50,7 +48,6 @@ public: void setNRPosition(WDSPRxProfile::WDSPRxNRPosition position); void setNR2ArtifactReduction(bool nr2ArtifactReducion); - bool getSNB() const { return m_snb; } bool getANF() const { return m_anf; } WDSPRxProfile::WDSPRxNRScheme getNRScheme() const { return m_nrScheme; } WDSPRxProfile::WDSPRxNR2Gain getNR2Gain() const { return m_nr2Gain; } @@ -63,7 +60,6 @@ signals: private: Ui::WDSPRxDNRDialog *ui; - bool m_snb; bool m_anf; WDSPRxProfile::WDSPRxNRScheme m_nrScheme; WDSPRxProfile::WDSPRxNR2Gain m_nr2Gain; @@ -72,7 +68,6 @@ private: bool m_nr2ArtifactReduction; private slots: - void on_snb_clicked(bool checked); void on_anf_clicked(bool checked); void on_nr_currentIndexChanged(int index); void on_nr2Gain_currentIndexChanged(int index); diff --git a/plugins/channelrx/wdsprx/wdsprxdnrdialog.ui b/plugins/channelrx/wdsprx/wdsprxdnrdialog.ui index bc55ab5d5..8c5508c81 100644 --- a/plugins/channelrx/wdsprx/wdsprxdnrdialog.ui +++ b/plugins/channelrx/wdsprx/wdsprxdnrdialog.ui @@ -40,16 +40,6 @@ - - - - Spectral Noise Blanker - - - SNB - - - diff --git a/plugins/channelrx/wdsprx/wdsprxgui.cpp b/plugins/channelrx/wdsprx/wdsprxgui.cpp index 270753c9c..9bc7c030b 100644 --- a/plugins/channelrx/wdsprx/wdsprxgui.cpp +++ b/plugins/channelrx/wdsprx/wdsprxgui.cpp @@ -301,7 +301,6 @@ void WDSPRxGUI::on_profileIndex_valueChanged(int value) m_settings.m_nbAvgTime = m_settings.m_profiles[m_settings.m_profileIndex].m_nbAvgTime; // Noise reduction m_settings.m_dnr = m_settings.m_profiles[m_settings.m_profileIndex].m_dnr; - m_settings.m_snb = m_settings.m_profiles[m_settings.m_profileIndex].m_snb; m_settings.m_anf = m_settings.m_profiles[m_settings.m_profileIndex].m_anf; m_settings.m_nrScheme = m_settings.m_profiles[m_settings.m_profileIndex].m_nrScheme; m_settings.m_nr2Gain = m_settings.m_profiles[m_settings.m_profileIndex].m_nr2Gain; @@ -908,7 +907,6 @@ void WDSPRxGUI::dnrSetupDialog(const QPoint& p) { m_dnrDialog = new WDSPRxDNRDialog(); m_dnrDialog->move(p); - m_dnrDialog->setSNB(m_settings.m_snb); m_dnrDialog->setANF(m_settings.m_anf); m_dnrDialog->setNRScheme(m_settings.m_nrScheme); m_dnrDialog->setNR2Gain(m_settings.m_nr2Gain); @@ -932,11 +930,6 @@ void WDSPRxGUI::dnrSetup(int32_t iValueChanged) switch (valueChanged) { - case WDSPRxDNRDialog::ValueChanged::ChangedSNB: - m_settings.m_snb = m_dnrDialog->getSNB(); - m_settings.m_profiles[m_settings.m_profileIndex].m_snb = m_settings.m_snb; - applySettings(); - break; case WDSPRxDNRDialog::ValueChanged::ChangedANF: m_settings.m_anf = m_dnrDialog->getANF(); m_settings.m_profiles[m_settings.m_profileIndex].m_anf = m_settings.m_anf; diff --git a/plugins/channelrx/wdsprx/wdsprxsettings.cpp b/plugins/channelrx/wdsprx/wdsprxsettings.cpp index 7450db2f1..3d58f3430 100644 --- a/plugins/channelrx/wdsprx/wdsprxsettings.cpp +++ b/plugins/channelrx/wdsprx/wdsprxsettings.cpp @@ -63,7 +63,6 @@ void WDSPRxSettings::resetToDefaults() m_nbAvgTime = 50.0; // Noise reduction m_dnr = false; - m_snb = false; m_anf = false; m_nrScheme = WDSPRxProfile::NRSchemeNR; m_nr2Gain = WDSPRxProfile::NR2GainGamma; @@ -125,7 +124,6 @@ QByteArray WDSPRxSettings::serialize() const s.writeDouble(27, m_nbAvgTime); // Noise reduction s.writeBool( 30, m_dnr); - s.writeBool( 31, m_snb); s.writeBool( 32, m_anf); s.writeS32( 33, (int) m_nrScheme); s.writeS32( 34, (int) m_nr2Gain); @@ -182,7 +180,6 @@ QByteArray WDSPRxSettings::serialize() const s.writeDouble(127 + 50*i, m_profiles[i].m_nbAvgTime); // Noise reduction s.writeBool (130 + 50*i, m_profiles[i].m_dnr); - s.writeBool (131 + 50*i, m_profiles[i].m_snb); s.writeBool (132 + 50*i, m_profiles[i].m_anf); s.writeS32 (133 + 50*i, (int) m_profiles[i].m_nrScheme); s.writeS32 (134 + 50*i, (int) m_profiles[i].m_nr2Gain); @@ -253,7 +250,6 @@ bool WDSPRxSettings::deserialize(const QByteArray& data) d.readDouble(27, &m_nbAvgTime, 50.0); // Nosie reduction d.readBool( 30, &m_dnr, false); - d.readBool( 31, &m_snb, false); d.readBool( 32, &m_anf, false); d.readS32( 33, &tmp, 2); m_nrScheme = (WDSPRxProfile::WDSPRxNRScheme) tmp; @@ -330,7 +326,6 @@ bool WDSPRxSettings::deserialize(const QByteArray& data) d.readDouble(127 + 50*i, &m_profiles[i].m_nbAvgTime, 50.0); // Noise reduction d.readBool (130 + 50*i, &m_profiles[i].m_dnr, false); - d.readBool (131 + 50*i, &m_profiles[i].m_snb, false); d.readBool (132 + 50*i, &m_profiles[i].m_anf, false); d.readS32 (133 + 50*i, &tmp); m_profiles[i].m_nrScheme = (WDSPRxProfile::WDSPRxNRScheme) tmp; diff --git a/plugins/channelrx/wdsprx/wdsprxsettings.h b/plugins/channelrx/wdsprx/wdsprxsettings.h index abd38c961..9b77855a1 100644 --- a/plugins/channelrx/wdsprx/wdsprxsettings.h +++ b/plugins/channelrx/wdsprx/wdsprxsettings.h @@ -100,7 +100,6 @@ struct WDSPRxProfile double m_nbAvgTime; // a.k.a back tau // Noise rediction bool m_dnr; - bool m_snb; bool m_anf; WDSPRxNRScheme m_nrScheme; WDSPRxNR2Gain m_nr2Gain; @@ -134,7 +133,6 @@ struct WDSPRxProfile m_nbThreshold(30), m_nbAvgTime(50.0), m_dnr(false), - m_snb(false), m_anf(false), m_nrScheme(NRSchemeNR), m_nr2Gain(NR2GainGamma), @@ -178,7 +176,6 @@ struct WDSPRxSettings double m_nbAvgTime; // Noise reduction bool m_dnr; - bool m_snb; bool m_anf; WDSPRxProfile::WDSPRxNRScheme m_nrScheme; WDSPRxProfile::WDSPRxNR2Gain m_nr2Gain; diff --git a/plugins/channelrx/wdsprx/wdsprxsink.cpp b/plugins/channelrx/wdsprx/wdsprxsink.cpp index 1fcf9f6fb..7c9108763 100644 --- a/plugins/channelrx/wdsprx/wdsprxsink.cpp +++ b/plugins/channelrx/wdsprx/wdsprxsink.cpp @@ -127,6 +127,7 @@ WDSPRxSink::WDSPRxSink() : ); m_rxa->setSpectrumProbe(&m_spectrumProbe); WDSP::RXA::SetPassband(*m_rxa, 0, m_Bandwidth); + WDSP::ANR::SetANRVals(*m_rxa, 64, 16, 16e-4, 10e-7); applyChannelSettings(m_channelSampleRate, m_channelFrequencyOffset, true); applySettings(m_settings, true); @@ -346,6 +347,7 @@ void WDSPRxSink::applySettings(const WDSPRxSettings& settings, bool force) << " m_agcSlope: " << settings.m_agcSlope << " m_agcHangThreshold: " << settings.m_agcHangThreshold << " m_audioDeviceName: " << settings.m_audioDeviceName + << " m_anf: "<< settings.m_anf << " m_dnr: " << settings.m_dnr << " m_nrScheme: " << settings.m_nrScheme << " m_nrPosition: "<< settings.m_nrPosition @@ -547,11 +549,6 @@ void WDSPRxSink::applySettings(const WDSPRxSettings& settings, bool force) WDSP::ANF::SetANFRun(*m_rxa, settings.m_anf ? 1 : 0); } - // Caution: Causes corruption - if ((m_settings.m_snb != settings.m_snb) || force) { - WDSP::SNBA::SetSNBARun(*m_rxa, settings.m_snb ? 1 : 0); - } - // CW Peaking if ((m_settings.m_cwPeaking != settings.m_cwPeaking) || force) {