Patent ID: 7204422

Claim:
A system for processing a signal imperfectly indicating perceived regions of relatively light and dark areas arranged in an alternating pattern as part of a binary optical code, the system comprising: a differentiator that generates a first derivative of the signal; a first comparator, connected to the differentiator, that compares the first derivative to a first threshold, the first comparator producing an output when the first derivative exceeds the first threshold; a second comparator, connected to the differentiator, that compares the first derivative to a second threshold, the second comparator producing an output when the first derivative is less than the second threshold; and a circuit receiving as an input the first derivative, the first derivative having a magnitude measured with respect to a reference level, the first derivative undergoing half-cycles of alternating polarity between successive crossings of the reference level, the first derivative having within a half-cycle a series of one or more successive local peaks of the same polarity as the half-cycle in which they occur, the circuit comprising: a first peak detector having an input receiving the first derivative, the first peak detector being operative during a positive half-cycle either to produce an output that approximately tracks the first derivative signal while both (a) the first derivative is sloping in the positive direction and (b) the first derivative is greater than at any previous time during the positive half-cycle or to produce an output that approximately holds near local positive peaks having increasingly larger magnitude in the positive half-cycle; a first node in the first peak detector having a voltage indicative of whether the first peak detector is in a tracking state or a holding state; a first set-reset flip-flop having a set input connected to the first node; a second peak detector having an input receiving the first derivative, the second peak detector being operative during a negative half-cycle either to produce an output that approximately tracks the first derivative signal while both (a) the first derivative is sloping in the negative direction and (b) the first derivative is less than at any previous time during the negative half-cycle or to produce an output that approximately holds near local negative peaks having decreasingly smaller value in the negative half-cycle; a second node in the second peak detector having a voltage indicative of whether the second peak detector is in a tracking state or a holding state; and a second set-reset flip-flop having a set input connected to the second node.