An algorithm for removing motion artifacts from the PPG signal in the time domain to determine heart rate is disclosed. A device for determining a heart rate of a user can include a heart rate sensor configured to generate heart rate signals when positioned on or adjacent to a user's skin, an accelerometer configured to generate one or more acceleration signals, and processing circuitry configured to remove, in a time domain, motion artifacts from the heart rate signals based on the acceleration signals. In some examples, the removal of motion artifacts can also be based on mean-centered, variance-scaled integrated acceleration signals. In some examples, the processing circuitry can be configured to remove motion artifacts using a least squares algorithm to identify a best representation of acceleration and integrated acceleration signals in the heart rate signals.