A method, algorithm, circuits, and/or systems for automatic gain control
(AGC) are disclosed. In one embodiment, an AGC circuit can include a
comparator configured to compare an output of an amplifier against a
reference voltage, gain logic configured to decrease a gain of the
amplifier when an output of the comparator has a first state, and to
periodically increase the gain of the amplifier, a digital-to-analog
converter (DAC) configured to receive an output from the gain logic and
control the gain of the amplifier, and lock detection logic configured to
determine from the output of the gain logic when the gain of the
amplifier is in a predetermined range.