Make AGC 25dB below saturation

This commit is contained in:
Geoffrey Merck 2020-02-13 20:34:51 +01:00
parent b9d0c6e532
commit 10c796f192
1 changed files with 3 additions and 1 deletions

View File

@ -44,8 +44,10 @@ CAGC::CAGC(float initialLeveldB)
m_EnergyPrime = 1.0f;
// We do not target full scale to avoid stauration
m_targetEnergy = 32767.0f/2.0f;//TODO : Move to parameter ?
m_targetEnergy = 32767.0f * pow(10.0f, (initialLeveldB - 25.0)/20.0f);//25 dB below saturation as stated in docs
//we also substract our target gain
//this is the time constant of our AGC...
m_Bandwidth = 1e-2f;//TODO : Move to parameter ?
m_Alpha = m_Bandwidth;
}