A method for an optical heart rate sensor comprises recognizing a minimum amount of motion of the optical heart rate sensor during a testing duration and recognizing an average amount of motion of the optical heart rate sensor during the testing duration. The motion of the optical heart rate sensor is compensated for if the minimum amount of motion during the testing duration exceeds a first threshold, even if the average amount of motion during the testing duration is less than a second threshold, greater than the first threshold. The motion of the optical heart rate sensor is not compensated for if the minimum amount of motion during the testing duration is below the first threshold, even if the average amount of motion during the testing duration is greater than the second threshold.