1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 18:15:45 -05:00

Alpha AGC cleanup

This commit is contained in:
f4exb 2018-02-03 17:07:37 +01:00
parent a1c84718ef
commit 24080bafd3
2 changed files with 0 additions and 59 deletions

View File

@ -176,46 +176,3 @@ double MagAGC::feedAndGetValue(const Complex& ci)
return m_u0;
}
}
AlphaAGC::AlphaAGC(int historySize, Real R) :
AGC(historySize, R),
m_alpha(0.5),
m_magsq(0.0),
m_squelchOpen(true)
{}
AlphaAGC::AlphaAGC(int historySize, Real R, Real alpha) :
AGC(historySize, R),
m_alpha(alpha),
m_magsq(0.0),
m_squelchOpen(true)
{}
AlphaAGC::~AlphaAGC()
{}
void AlphaAGC::resize(int historySize, Real R, Real alpha)
{
m_R = R;
m_alpha = alpha;
m_squelchOpen = true;
m_moving_average.resize(historySize, R);
}
void AlphaAGC::feed(Complex& ci)
{
m_magsq = ci.real()*ci.real() + ci.imag()*ci.imag();
if (m_squelchOpen && (m_magsq))
{
m_moving_average.feed(m_moving_average.average() - m_alpha*(m_moving_average.average() - m_magsq));
}
else
{
//m_squelchOpen = true;
m_moving_average.feed(m_magsq);
}
ci *= m_u0;
}

View File

@ -66,22 +66,6 @@ private:
double m_clampMax; //!< maximum to clamp to as power value
};
class AlphaAGC : public AGC
{
public:
AlphaAGC(int historySize, Real R);
AlphaAGC(int historySize, Real R, Real alpha);
virtual ~AlphaAGC();
void resize(int historySize, Real R, Real alpha);
virtual void feed(Complex& ci);
Real getMagSq() const { return m_magsq; }
private:
Real m_alpha;
Real m_magsq;
bool m_squelchOpen;
};
template<uint32_t AvgSize>
class SimpleAGC
{