Patent ID: 7053674

Claim:
A circuit, comprising; a capacitor having a threshold node; a selected one of: a charging circuit having a charging circuit input node to receive an input signal and a charging circuit output node coupled to the threshold node, wherein the charging circuit is adapted to provide a charging signal at the charging circuit output node to charge the capacitor to a voltage in accordance with a positive peak of the input signal, and a discharging circuit having a discharging circuit input node to receive an input signal and a discharging circuit output node coupled to the threshold node, wherein the discharging circuit is adapted to provide a discharging signal at the discharging circuit output node to discharge the capacitor to a voltage in accordance with a negative peak of the input signal; a comparator having a first comparator input node coupled to the threshold node, a second comparator input node coupled to the input node of the selected one of the charging circuit and the discharging circuit, and a comparator output node at which a comparator output signal is provided; a logic circuit having a logic circuit input node coupled to the comparator output node and a logic circuit output node at which a logic circuit output signal is provided in response to a predetermined period of time during which the comparator output signal has no transitions; and a switch having a first switch node coupled to the threshold node, a second switch node coupled to the selected one of the charging circuit input node and the discharging circuit input node, and a switch control node coupled to the logic circuit output node.