diff --git a/plugins/channelrx/demodssb/ssbdemodgui.cpp b/plugins/channelrx/demodssb/ssbdemodgui.cpp index 3990ae2ad1..e61de963f7 100644 --- a/plugins/channelrx/demodssb/ssbdemodgui.cpp +++ b/plugins/channelrx/demodssb/ssbdemodgui.cpp @@ -196,6 +196,7 @@ void SSBDemodGUI::on_agcClamping_toggled(bool checked) void SSBDemodGUI::on_dnr_toggled(bool checked) { m_settings.m_dnr = checked; + m_settings.m_filterBank[m_settings.m_filterIndex].m_dnr = m_settings.m_dnr; applySettings(); } @@ -268,6 +269,12 @@ void SSBDemodGUI::on_filterIndex_valueChanged(int value) ui->BW->setMinimum(-480); ui->lowCut->setMaximum(480); ui->lowCut->setMinimum(-480); + m_settings.m_dnr = m_settings.m_filterBank[m_settings.m_filterIndex].m_dnr; + m_settings.m_dnrScheme = m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrScheme; + m_settings.m_dnrAboveAvgFactor = m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrAboveAvgFactor; + m_settings.m_dnrSigmaFactor = m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrSigmaFactor; + m_settings.m_dnrNbPeaks = m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrNbPeaks; + m_settings.m_dnrAlpha = m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrAlpha; displaySettings(); applyBandwidths(m_settings.m_filterBank[m_settings.m_filterIndex].m_spanLog2, true); // does applySettings(true) } @@ -748,22 +755,27 @@ void SSBDemodGUI::dnrSetup(int32_t iValueChanged) { case FFTNRDialog::ValueChanged::ChangedScheme: m_settings.m_dnrScheme = m_fftNRDialog->getScheme(); + m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrScheme = m_settings.m_dnrScheme; applySettings(); break; case FFTNRDialog::ValueChanged::ChangedAboveAvgFactor: m_settings.m_dnrAboveAvgFactor = m_fftNRDialog->getAboveAvgFactor(); + m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrAboveAvgFactor = m_settings.m_dnrAboveAvgFactor; applySettings(); break; case FFTNRDialog::ValueChanged::ChangedSigmaFactor: m_settings.m_dnrSigmaFactor = m_fftNRDialog->getSigmaFactor(); + m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrSigmaFactor = m_settings.m_dnrSigmaFactor; applySettings(); break; case FFTNRDialog::ValueChanged::ChangedNbPeaks: m_settings.m_dnrNbPeaks = m_fftNRDialog->getNbPeaks(); + m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrNbPeaks = m_settings.m_dnrNbPeaks; applySettings(); break; case FFTNRDialog::ValueChanged::ChangedAlpha: m_settings.m_dnrAlpha = m_fftNRDialog->getAlpha(); + m_settings.m_filterBank[m_settings.m_filterIndex].m_dnrAlpha = m_settings.m_dnrAlpha; applySettings(); break; default: diff --git a/plugins/channelrx/demodssb/ssbdemodsettings.cpp b/plugins/channelrx/demodssb/ssbdemodsettings.cpp index 0244b88018..a19bd47596 100644 --- a/plugins/channelrx/demodssb/ssbdemodsettings.cpp +++ b/plugins/channelrx/demodssb/ssbdemodsettings.cpp @@ -121,6 +121,12 @@ QByteArray SSBDemodSettings::serialize() const s.writeS32(101 + 10*i, m_filterBank[i].m_rfBandwidth / 100.0); s.writeS32(102 + 10*i, m_filterBank[i].m_lowCutoff / 100.0); s.writeS32(103 + 10*i, (int) m_filterBank[i].m_fftWindow); + s.writeBool(104 + 10*i, m_filterBank[i].m_dnr); + s.writeS32(105 + 10*i, m_filterBank[i].m_dnrScheme); + s.writeFloat(106 + 10*i, m_filterBank[i].m_dnrAboveAvgFactor); + s.writeFloat(107 + 10*i, m_filterBank[i].m_dnrSigmaFactor); + s.writeS32(108 + 10*i, m_filterBank[i].m_dnrNbPeaks); + s.writeFloat(109 + 10*i, m_filterBank[i].m_dnrAlpha); } return s.final(); @@ -208,6 +214,12 @@ bool SSBDemodSettings::deserialize(const QByteArray& data) d.readS32(103 + 10*i, &tmp, (int) FFTWindow::Blackman); m_filterBank[i].m_fftWindow = (FFTWindow::Function) (tmp < 0 ? 0 : tmp > (int) FFTWindow::BlackmanHarris7 ? (int) FFTWindow::BlackmanHarris7 : tmp); + d.readBool(104 + 10*i, &m_filterBank[i].m_dnr, false); + d.readS32(105 + 10*i, &m_filterBank[i].m_dnrScheme, 0); + d.readFloat(106 + 10*i, &m_filterBank[i].m_dnrAboveAvgFactor, 20.0f); + d.readFloat(107 + 10*i, &m_filterBank[i].m_dnrSigmaFactor, 4.0f); + d.readS32(108 + 10*i, &m_filterBank[i].m_dnrNbPeaks, 10); + d.readFloat(109 + 10*i, &m_filterBank[i].m_dnrAlpha, 0.95f); } return true; diff --git a/plugins/channelrx/demodssb/ssbdemodsettings.h b/plugins/channelrx/demodssb/ssbdemodsettings.h index bcfff838e0..ec0f653654 100644 --- a/plugins/channelrx/demodssb/ssbdemodsettings.h +++ b/plugins/channelrx/demodssb/ssbdemodsettings.h @@ -31,6 +31,12 @@ struct SSBDemodFilterSettings Real m_rfBandwidth; Real m_lowCutoff; FFTWindow::Function m_fftWindow; + bool m_dnr; + int m_dnrScheme; + float m_dnrAboveAvgFactor; + float m_dnrSigmaFactor; + int m_dnrNbPeaks; + float m_dnrAlpha; SSBDemodFilterSettings() : m_spanLog2(3),