Patent ID: 8723512

Claim:
A circuit for detecting a movement of an object, comprising: a magnetic field sensing element for generating a magnetic field signal proportional to a magnetic field associated with the object, wherein the magnetic field signal has cycles including a present cycle; a motion detector configured to generate a motion signal indicative of the movement of the object, wherein the motion signal has edges associated with the cycles of the magnetic field signal, wherein the motion detector comprises: a peak identifying circuit for tracking at least one of a positive peak of the magnetic field signal or a negative peak of the magnetic field signal to provide a peak signal; a peak sample selection module coupled to receive the peak signal, configured to save samples of the peak signal, and configured to select a sample of the peak signal associated with a respective prior cycle of the magnetic field signal to generate a selected peak signal; a threshold generator coupled to receive the selected peak signal and configured to generate a threshold signal as a function of the selected peak signal; and a comparator coupled to receive the threshold signal, coupled to receive the magnetic field signal, and configured to compare the threshold signal with the magnetic field signal in order to generate the motion signal.