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 (308a, 454a) 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 (322, 456) 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 (PDAC, NDAC); a peak sample selection module (326, 344, 426) coupled to receive the peak signal, configured to save samples of the peak signal that are associated with respective cycles of the magnetic field 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 (380, 442) coupled to receive the selected peak signal and configured to generate a threshold signal (316, 464a) as a function of the selected peak signal; and a comparator (308, 454) 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. 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 (308a, 454a) 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 (322, 456) 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 (PDAC, NDAC); a peak sample selection module (326, 344, 426) coupled to receive the peak signal, configured to save samples of the peak signal that are associated with respective cycles of the magnetic field 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 (380, 442) coupled to receive the selected peak signal and configured to generate a threshold signal (316, 464a) as a function of the selected peak signal; and a comparator (308, 454) 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. a peak identifying circuit (322, 456) 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 (PDAC, NDAC); a peak sample selection module (326, 344, 426) coupled to receive the peak signal, configured to save samples of the peak signal that are associated with respective cycles of the magnetic field 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 (380, 442) coupled to receive the selected peak signal and configured to generate a threshold signal (316, 464a) as a function of the selected peak signal; and a comparator (308, 454) 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.