gain compensation