Alpha AGC cleanup

pull/147/head
f4exb 2018-02-03 17:07:37 +01:00
rodzic a1c84718ef
commit 24080bafd3
2 zmienionych plików z 0 dodań i 59 usunięć

Wyświetl plik

@ -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;
}

Wyświetl plik

@ -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
{