1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-13 11:51:47 -05:00

Tried to fix NFM squelch again

This commit is contained in:
f4exb 2015-09-12 09:46:51 +02:00
parent f97671ae93
commit c4ad938083
3 changed files with 7 additions and 3 deletions

View File

@ -22,6 +22,7 @@ public:
Real getValue();
Real getDelayedValue();
virtual void feed(Complex& ci) = 0;
virtual Real returnedDelayedValue() const = 0;
void openedSquelch();
void closedSquelch();
@ -41,6 +42,7 @@ public:
MagSquaredAGC(int historySize, Real R);
virtual ~MagSquaredAGC();
virtual void feed(Complex& ci);
virtual Real returnedDelayedValue() const { return m_u0; }
};
class MagAGC : public AGC
@ -50,6 +52,7 @@ public:
MagAGC(int historySize, Real R);
virtual ~MagAGC();
virtual void feed(Complex& ci);
virtual Real returnedDelayedValue() const { return m_u0; }
};
class AlphaAGC : public AGC
@ -61,6 +64,7 @@ public:
virtual ~AlphaAGC();
void resize(int historySize, Real R, Real alpha);
virtual void feed(Complex& ci);
virtual Real returnedDelayedValue() const { return 1; }
void openedSquelch();
void closedSquelch();
private:

View File

@ -26,7 +26,7 @@
#include "dsp/pidcontroller.h"
#include "dsp/dspengine.h"
static const Real afSqTones[2] = {1200.0, 8000.0}; // {1200.0, 8000.0};
static const Real afSqTones[2] = {1200.0, 6000.0}; // {1200.0, 8000.0};
MESSAGE_CLASS_DEFINITION(NFMDemod::MsgConfigureNFMDemod, Message)
@ -218,7 +218,7 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
{
demod = m_bandpass.filter(demod);
demod *= m_running.m_volume;
sample = demod * ((1<<19)/301) * m_AGC.getDelayedValue(); // denominator = bandpass filter number of taps
sample = demod * ((1<<18)/301) * m_AGC.getDelayedValue(); // denominator = bandpass filter number of taps
}
m_AGC.openedSquelch();

View File

@ -48,7 +48,7 @@ Real AGC::getDelayedValue()
}
else
{
return 1;
return returnedDelayedValue();
}
}