A medical device for sensing cardiac events that includes a plurality of light sources capable of emitting light at a plurality of wavelengths, and a detector to detect the emitted light. A processor generates an ambient light measurement in response to ambient light detected by the detector, generates a plurality of light measurements in response to the emitted light detected by the detector, and adjusts the plurality of light measurements in response to the ambient light measurement.