diff --git a/sdrbase/dsp/agc.cpp b/sdrbase/dsp/agc.cpp index 41799bb34..94b77cd0b 100644 --- a/sdrbase/dsp/agc.cpp +++ b/sdrbase/dsp/agc.cpp @@ -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; -} diff --git a/sdrbase/dsp/agc.h b/sdrbase/dsp/agc.h index 8dbc8293c..101df8eab 100644 --- a/sdrbase/dsp/agc.h +++ b/sdrbase/dsp/agc.h @@ -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 class SimpleAGC {