diff --git a/plugins/channelrx/demodnfm/nfmdemod.cpp b/plugins/channelrx/demodnfm/nfmdemod.cpp index 444b39b1c..4f9babde8 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.cpp +++ b/plugins/channelrx/demodnfm/nfmdemod.cpp @@ -68,7 +68,7 @@ NFMDemod::NFMDemod() : m_agcLevel = 1.0; m_AGC.resize(m_squelchGate, m_agcLevel); - m_movingAverage.resize(16, 0); +// m_movingAverage.resize(16, 0); m_ctcssDetector.setCoefficients(3000, 6000.0); // 0.5s / 2 Hz resolution m_afSquelch.setCoefficients(24, 600, 48000.0, 200, 0); // 4000 Hz span, 250us, 100ms attack @@ -154,7 +154,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto double magsqRaw = m_AGC.getMagSq(); Real magsq = magsqRaw / (1<<30); - m_movingAverage.feed(magsq); +// m_movingAverage.feed(magsq); m_magsqSum += magsq; if (magsq > m_magsqPeak) @@ -172,7 +172,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto // AF processing - if ((m_magsq > m_squelchLevel) && (m_magsqPeak > m_magsq/2.0f)) + if (m_magsq > m_squelchLevel) { if (m_squelchCount < m_squelchGate) { diff --git a/plugins/channelrx/demodnfm/nfmdemod.h b/plugins/channelrx/demodnfm/nfmdemod.h index eeb4fe8fa..dee9dd4a9 100644 --- a/plugins/channelrx/demodnfm/nfmdemod.h +++ b/plugins/channelrx/demodnfm/nfmdemod.h @@ -68,7 +68,7 @@ public: m_ctcssIndexSelected = selectedCtcssIndex; } - Real getMag() { return m_movingAverage.average(); } + Real getMag() { return m_magsq; } bool getSquelchOpen() const { return m_squelchOpen; } void getMagSqLevels(Real& avg, Real& peak, int& nbSamples) @@ -207,7 +207,7 @@ private: //Complex m_m1Sample; //Complex m_m2Sample; MagAGC m_AGC; - MovingAverage m_movingAverage; +// MovingAverage m_movingAverage; AFSquelch m_afSquelch; Real m_agcLevel; // AGC will aim to this level Real m_agcFloor; // AGC will not go below this level