Open luigifcruz opened 5 months ago
I've had some good results using a simple control loop like:
T agc_work(T input, float agc_target = 1.0f, float agc_gain = 1e-4f , float agc_max = 655635.0f) {
T output = input * gain;
float error = agc_target - std::abs(T); // absolute magnitude of signal
gain += error * agc_gain;
// Optional ? Gain limit...
if(agc_max > 0.0f && gain > agc_max){
gain = agc_max;
}
return output;
}
I have one AGC and some other blocks partially implemented on my other machine local repo... I could open one PR later and we can finish them... I'm on vacation and don't have acess to the machine right now :\
Some refs / implementations...
The current implementation of the AGC is sub-optimal. New implementation should retain good parallelization characteristics and correctly implement averaging.