mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-29 03:09:14 -05:00
Fixed some AGC issues
This commit is contained in:
parent
4e25f4d678
commit
f98800702c
@ -63,7 +63,6 @@ MagAGC::MagAGC(int historySize, double R, double threshold) :
|
||||
m_stepDownCounter(0),
|
||||
m_gateCounter(0),
|
||||
m_stepDownDelay(historySize),
|
||||
m_R2(R*R),
|
||||
m_hardLimiting(false)
|
||||
{}
|
||||
|
||||
@ -72,20 +71,18 @@ MagAGC::~MagAGC()
|
||||
|
||||
void MagAGC::resize(int historySize, int stepLength, Real R)
|
||||
{
|
||||
m_R2 = R*R;
|
||||
m_stepLength = stepLength;
|
||||
m_stepDelta = 1.0 / m_stepLength;
|
||||
m_stepUpCounter = 0;
|
||||
m_stepDownCounter = 0;
|
||||
AGC::resize(historySize, R);
|
||||
m_moving_average.fill(0);
|
||||
m_moving_average.fill(m_squared ? R : R*R);
|
||||
}
|
||||
|
||||
void MagAGC::setOrder(double R)
|
||||
{
|
||||
m_R2 = R*R;
|
||||
AGC::setOrder(R);
|
||||
m_moving_average.fill(0);
|
||||
m_moving_average.fill(m_squared ? R : R*R);
|
||||
}
|
||||
|
||||
void MagAGC::setThresholdEnable(bool enable)
|
||||
|
@ -39,7 +39,7 @@ protected:
|
||||
double m_u0; //!< AGC factor
|
||||
double m_R; //!< ordered magnitude
|
||||
MovingAverage<double> m_moving_average; //!< Averaging engine. The stack length conditions the smoothness of AGC.
|
||||
int m_historySize; //!< Averaging length (attack)
|
||||
int m_historySize; //!< Averaging length (the longer the slower the AGC)
|
||||
int m_count; //!< Samples counter
|
||||
};
|
||||
|
||||
@ -76,7 +76,6 @@ private:
|
||||
int m_stepDownCounter; //!< step down transition samples counter
|
||||
int m_gateCounter; //!< threshold gate samples counter
|
||||
int m_stepDownDelay; //!< delay in samples before cutoff (release)
|
||||
double m_R2; //!< square of ordered magnitude
|
||||
bool m_hardLimiting; //!< hard limit multiplier so that resulting sample magnitude does not exceed 1.0
|
||||
|
||||
double hardLimiter(double multiplier, double magsq);
|
||||
|
Loading…
Reference in New Issue
Block a user