Gain measurement