An algorithm for removing motion artifacts from a PPG signal in the frequency domain and a harmonic template classifier (HTC) algorithm and unit to determine heart rate are disclosed. In some examples, PPG signals can be processed in combination with accelerometer signals to remove unwanted artifacts in the frequency domain. For example, an acceleration mask can be generated and used to filter out acceleration contributions represented in the PPG signal. Additionally or alternatively, in some examples, an HTC unit can be configured to generate a heart rate correlation curve based on the correlation between frequency domain PPG signals and spectral templates. In some examples, the HTC unit can be configured to implement an algorithm to determine a predicted heart rate and an associated confidence measure. In some examples, heuristics can be used to determine a predicted heart rate based on the correlation curve and/or the confidence measure.