DSD Demod: use same magnitude squared average technique for the squelch as with the NFM demod

This commit is contained in:
f4exb 2016-12-14 18:46:31 +01:00
parent db3375ca3e
commit dad2bf7bf9
3 changed files with 5 additions and 5 deletions

View File

@ -67,7 +67,7 @@ DSDDemod::DSDDemod(BasebandSampleSink* sampleSink) :
m_sampleBuffer = new qint16[1<<17]; // 128 kS
m_sampleBufferIndex = 0;
// m_movingAverage.resize(50, 0);
m_movingAverage.resize(16, 0);
m_magsq = 0.0f;
m_magsqSum = 0.0f;
m_magsqPeak = 0.0f;
@ -141,7 +141,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
qint16 sample, delayedSample;
Real magsq = ((ci.real()*ci.real() + ci.imag()*ci.imag())) / (1<<30);
// m_movingAverage.feed(m_magsq);
m_movingAverage.feed(magsq);
m_magsqSum += magsq;
@ -157,7 +157,7 @@ void DSDDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
// AF processing
if (getMagSq() > m_squelchLevel)
if (m_movingAverage.average() > m_squelchLevel)
{
if (m_squelchGate > 0)
{

View File

@ -262,7 +262,7 @@ private:
bool m_squelchOpen;
Real m_lastArgument;
// MovingAverage<double> m_movingAverage;
MovingAverage<Real> m_movingAverage;
Real m_magsq;
Real m_magsqSum;
Real m_magsqPeak;

View File

@ -24,7 +24,7 @@
const PluginDescriptor DSDDemodPlugin::m_pluginDescriptor = {
QString("DSD Demodulator"),
QString("2.1.5"),
QString("2.5.0"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,