NFM demod: make squelch threshold match the displayed signal average

This commit is contained in:
f4exb 2016-12-05 18:41:49 +01:00
parent 317836ac92
commit 0de8d916c0
2 changed files with 4 additions and 1 deletions

View File

@ -38,6 +38,7 @@ NFMDemod::NFMDemod() :
m_squelchGate(2400),
m_audioMute(false),
m_squelchOpen(false),
m_magsq(0.0f),
m_magsqSum(0.0f),
m_magsqPeak(0.0f),
m_magsqCount(0),
@ -171,7 +172,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
// AF processing
if (m_movingAverage.average() > m_squelchLevel)
if (m_magsq > m_squelchLevel)
{
if (m_squelchCount < m_squelchGate)
{

View File

@ -74,6 +74,7 @@ public:
void getMagSqLevels(Real& avg, Real& peak, int& nbSamples)
{
avg = m_magsqSum / m_magsqCount;
m_magsq = avg;
peak = m_magsqPeak;
nbSamples = m_magsqCount;
m_magsqSum = 0.0f;
@ -197,6 +198,7 @@ private:
Real m_squelchLevel;
bool m_squelchOpen;
Real m_magsq; //!< displayed averaged value
Real m_magsqSum;
Real m_magsqPeak;
int m_magsqCount;