Add exponential average to the local gain adjustment process. Code is not validated yet!