In an electronic system receiving an analog signal from an electrical output of a photodetector and applying it to an input of a signal processing device which is characterized by having a defined input signal range window that is smaller than swings in the incoming analog signal, an automatic gain control circuit, comprising:
- means receiving said incoming analog signal for integrating individual samples thereof for a controllable time,
- means controlling the time that the individual signal samples are integrated for maintaining said signal integrated samples within said defined input signal range window, and
- means responsive to both the time that the individual signal samples are integrated and an output of said signal processing device for determining the values of the individual signal samples.