mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-07-31 13:02:27 -04:00
NFM demod: make squelch threshold match the displayed signal average
This commit is contained in:
parent
317836ac92
commit
0de8d916c0
@ -38,6 +38,7 @@ NFMDemod::NFMDemod() :
|
|||||||
m_squelchGate(2400),
|
m_squelchGate(2400),
|
||||||
m_audioMute(false),
|
m_audioMute(false),
|
||||||
m_squelchOpen(false),
|
m_squelchOpen(false),
|
||||||
|
m_magsq(0.0f),
|
||||||
m_magsqSum(0.0f),
|
m_magsqSum(0.0f),
|
||||||
m_magsqPeak(0.0f),
|
m_magsqPeak(0.0f),
|
||||||
m_magsqCount(0),
|
m_magsqCount(0),
|
||||||
@ -171,7 +172,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
|
|
||||||
// AF processing
|
// AF processing
|
||||||
|
|
||||||
if (m_movingAverage.average() > m_squelchLevel)
|
if (m_magsq > m_squelchLevel)
|
||||||
{
|
{
|
||||||
if (m_squelchCount < m_squelchGate)
|
if (m_squelchCount < m_squelchGate)
|
||||||
{
|
{
|
||||||
|
@ -74,6 +74,7 @@ public:
|
|||||||
void getMagSqLevels(Real& avg, Real& peak, int& nbSamples)
|
void getMagSqLevels(Real& avg, Real& peak, int& nbSamples)
|
||||||
{
|
{
|
||||||
avg = m_magsqSum / m_magsqCount;
|
avg = m_magsqSum / m_magsqCount;
|
||||||
|
m_magsq = avg;
|
||||||
peak = m_magsqPeak;
|
peak = m_magsqPeak;
|
||||||
nbSamples = m_magsqCount;
|
nbSamples = m_magsqCount;
|
||||||
m_magsqSum = 0.0f;
|
m_magsqSum = 0.0f;
|
||||||
@ -197,6 +198,7 @@ private:
|
|||||||
|
|
||||||
Real m_squelchLevel;
|
Real m_squelchLevel;
|
||||||
bool m_squelchOpen;
|
bool m_squelchOpen;
|
||||||
|
Real m_magsq; //!< displayed averaged value
|
||||||
Real m_magsqSum;
|
Real m_magsqSum;
|
||||||
Real m_magsqPeak;
|
Real m_magsqPeak;
|
||||||
int m_magsqCount;
|
int m_magsqCount;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user