Patent ID: 7312856

Claim:
An apparatus, comprising: an optical detector; a threshold unit capable of converting an analog optical signal received by the optical detector to a digital representation thereof; a capture unit capable of capturing the digital representation of the received optical signal; a process unit capable of processing the captured digital representation; and an automatic gain control capable of controlling the gain of the optical detector responsive to the content of the processed digital representation, wherein the automatic gain control drives the gain higher responsive to determining that the intensity of a return pulse in the optical signal is lower than a target value and drives the gain lower responsive to determining that the intensity of the return pulse in the optical signal is higher than the target value, the automatic gain control including: an intensity median computation circuit capable of comparing the intensity of the return pulse to a predetermined value and outputting a first signal indicating the result of the comparison; an up/down counter capable of receiving the first signal, incrementing and decrementing responsive to the first signal, and outputting a second signal proportional to the count therein; a digital to analog converter capable of converting the second signal to an analog signal; and an attenuator receiving the analog signal and attenuating a gain signal responsive to the analog signal.