16 m_moving_average(historySize, m_R),
17 m_historySize(historySize),
47 m_threshold(threshold),
48 m_thresholdEnable(true),
50 m_stepLength(
std::
min(2400, historySize/2)),
51 m_stepDelta(1.0/m_stepLength),
55 m_stepDownDelay(historySize),
102 return 1.0 / (multiplier*
sqrt(magsq));
110 m_magsq = ci.real()*ci.real() + ci.imag()*ci.imag();
int m_gate
power threshold gate in number of samples
int m_stepDownCounter
step down transition samples counter
void setThresholdEnable(bool enable)
double m_threshold
squelch on magsq average
int m_historySize
Averaging length (attack)
static float smootherstep(float x)
int m_count
Samples counter.
double feedAndGetValue(const Complex &ci)
double m_R2
square of ordered magnitude
MagAGC(int historySize, double R, double threshold)
double hardLimiter(double multiplier, double magsq)
void resize(int historySize, int stepLength, Real R)
double m_clampMax
maximum to clamp to as power value
void resize(int historySize, double R)
bool m_clamping
clamping active
MovingAverage< double > m_moving_average
Averaging engine. The stack length conditions the smoothness of AGC.
double m_R
ordered magnitude
virtual void feed(Complex &ci)
int m_gateCounter
threshold gate samples counter
int m_stepLength
transition step length in number of samples
Fixed< IntType, IntBits > sqrt(Fixed< IntType, IntBits > const &x)
AGC(int historySize, double R)
bool m_squared
use squared magnitude (power) to compute AGC value
double m_magsq
current squared magnitude (power)
double m_stepDelta
transition step unit by sample
int m_stepDownDelay
delay in samples before cutoff (release)
int m_stepUpCounter
step up transition samples counter
float getStepValue() const
std::complex< Real > Complex
void resize(int historySize, Type initial)
bool m_thresholdEnable
enable squelch on power threshold
bool m_hardLimiting
hard limit multiplier so that resulting sample magnitude does not exceed 1.0
T min(const T &x, const T &y)