kopia lustrzana https://github.com/f4exb/sdrangel
Fixed NFM squelch
rodzic
d9be377d5b
commit
681863b2a2
|
@ -33,6 +33,8 @@ MESSAGE_CLASS_DEFINITION(NFMDemod::MsgConfigureNFMDemod, Message)
|
||||||
NFMDemod::NFMDemod() :
|
NFMDemod::NFMDemod() :
|
||||||
m_ctcssIndex(0),
|
m_ctcssIndex(0),
|
||||||
m_sampleCount(0),
|
m_sampleCount(0),
|
||||||
|
m_squelchCount(0),
|
||||||
|
m_agcAttack(2400),
|
||||||
m_afSquelch(2, afSqTones),
|
m_afSquelch(2, afSqTones),
|
||||||
m_audioFifo(4, 48000),
|
m_audioFifo(4, 48000),
|
||||||
m_settingsMutex(QMutex::Recursive)
|
m_settingsMutex(QMutex::Recursive)
|
||||||
|
@ -54,7 +56,7 @@ NFMDemod::NFMDemod() :
|
||||||
m_audioBufferFill = 0;
|
m_audioBufferFill = 0;
|
||||||
|
|
||||||
m_agcLevel = 1.0;
|
m_agcLevel = 1.0;
|
||||||
m_AGC.resize(240, m_agcLevel);
|
m_AGC.resize(m_agcAttack, m_agcLevel);
|
||||||
m_magsq = 0;
|
m_magsq = 0;
|
||||||
|
|
||||||
m_ctcssDetector.setCoefficients(3000, 6000.0); // 0.5s / 2 Hz resolution
|
m_ctcssDetector.setCoefficients(3000, 6000.0); // 0.5s / 2 Hz resolution
|
||||||
|
@ -173,7 +175,20 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
||||||
|
|
||||||
// AF processing
|
// AF processing
|
||||||
|
|
||||||
squelchOpen = (getMag() > m_squelchLevel);
|
if (getMag() > m_squelchLevel)
|
||||||
|
{
|
||||||
|
if (m_squelchCount < m_agcAttack)
|
||||||
|
{
|
||||||
|
m_squelchCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_squelchCount = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
//squelchOpen = (getMag() > m_squelchLevel);
|
||||||
|
squelchOpen = m_squelchCount == m_agcAttack; // wait for AGC to stabilize
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (m_afSquelch.analyze(demod))
|
if (m_afSquelch.analyze(demod))
|
||||||
|
|
|
@ -155,6 +155,8 @@ private:
|
||||||
int m_ctcssIndex; // 0 for nothing detected
|
int m_ctcssIndex; // 0 for nothing detected
|
||||||
int m_ctcssIndexSelected;
|
int m_ctcssIndexSelected;
|
||||||
int m_sampleCount;
|
int m_sampleCount;
|
||||||
|
int m_squelchCount;
|
||||||
|
int m_agcAttack;
|
||||||
|
|
||||||
double m_squelchLevel;
|
double m_squelchLevel;
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue