A signal compensation circuit compensates for direct-current offset of an input
signal by amplifying the input signal with an amplifier having a variable direct-current
offset. A low-speed negative feedback loop charges and discharges a capacitor in
an integrating circuit according to the direct-current component of the amplified
signal. A high-speed negative feedback loop charges and discharges the same capacitor
at a faster rate when the amplified signal goes outside an allowable amplitude
range. The capacitor potential is used to control the direct-current offset of
the amplifier. The allowable amplitude range is adjusted according to the amplitude
of the amplified signal. High-speed compensation can thus be combined with a tolerance
for runs of identical code levels in the input signal.