mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-09-30 08:46:46 -04:00
NFM demod: quadrature squelch attack and decay
This commit is contained in:
parent
67f318e6ed
commit
07fc282d89
@ -183,25 +183,21 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
if ( (m_running.m_deltaSquelch && ((deviation > m_squelchLevel) || (deviation < -m_squelchLevel))) ||
|
if ( (m_running.m_deltaSquelch && ((deviation > m_squelchLevel) || (deviation < -m_squelchLevel))) ||
|
||||||
(!m_running.m_deltaSquelch && (m_movingAverage.average() < m_squelchLevel)) )
|
(!m_running.m_deltaSquelch && (m_movingAverage.average() < m_squelchLevel)) )
|
||||||
{
|
{
|
||||||
if (m_squelchCount < m_squelchGate)
|
if (m_squelchCount > 0)
|
||||||
{
|
{
|
||||||
m_squelchCount = 0; // return to 0
|
m_squelchCount--;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_squelchCount--; // grace period
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (m_squelchCount < m_squelchGate + 2)
|
if (m_squelchCount < m_squelchGate + 480)
|
||||||
{
|
{
|
||||||
m_squelchCount++;
|
m_squelchCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//squelchOpen = (getMag() > m_squelchLevel);
|
//squelchOpen = (getMag() > m_squelchLevel);
|
||||||
m_squelchOpen = m_squelchCount >= m_squelchGate; // wait for AGC to stabilize
|
m_squelchOpen = (m_squelchCount > m_squelchGate);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (m_afSquelch.analyze(demod))
|
if (m_afSquelch.analyze(demod))
|
||||||
@ -248,8 +244,9 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Real squelchFactor = (Real) (m_squelchCount - m_squelchGate) / 480.0f;
|
||||||
demod = m_bandpass.filter(demod);
|
demod = m_bandpass.filter(demod);
|
||||||
sample = demod * m_running.m_volume;
|
sample = demod * m_running.m_volume * squelchFactor * squelchFactor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user