By analyzing the source of signal fluctuation in optical fiber transmission chain,two key elements that will cause the fluctuation of the signal were obtained.A set of high-speed automatic gain control system(AGC system) and a scheme of calibration and a PC software based on this scheme for the AGC system were designed.By introducing the calibrated AGC system into the optical fiber chain,the flatness of the signal level has been greatly improved form about 11 dB to 0.5 dB.