mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-02-03 09:44:01 -05:00
DSD Demod: use same magnitude squared average technique for the squelch as with the NFM demod
This commit is contained in:
parent
db3375ca3e
commit
dad2bf7bf9
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user