## 3 Experiment Setup
In both cases, since our system relies on the built-in VCSEL laser for illumination, a clear HR signal can still be seen in the time domain and the correct HR rate is obtained using a Fourier transform. Figure 1: Experimental configuration for proof-of-concept HR, RR measurements using the Pico Flex indirect ToF camera. We also demonstrate that the ToF camera can operate under more extreme lighting conditions. Figure 4 shows a measurement obtained with ambient light switched on and off at an interval of 5 s. When the ambient light is turned off, the background illumination intensity is less than 1 Lux while when the ambient light is turned on, the background illumination is 330 Lux. No significant effects of ambient light being turned on/off are seen in Figure 4a and a correct HR measurement is still obtained with a Fourier transform. Figure 3: (**a**) Raw intensity signal from ROI-1 measured in dark/bright environment. The grayscale intensity shows a clear HR signal. (**b**) Frequency domain HR measured in dark/bright environment. The highest peak in the frequency domain correspond to measured HR. Figure 2: Two ROIs used for RR and HR extraction: ROI-1 is used for HR measurements while ROI-2 is used for RR measurements. Motion artifact is a key source of noise in contactless HR measurements, especially on a system with low power and active illumination such as the one in this study. When no motion or very limited motion is present, the HR can be obtained directly from the raw grayscale intensity from the ToF camera, as is shown in Figure 5a, during which the participant is asked to remain as still as possible. However, in more realistic scenarios, when the users are behaving naturally, there will inevitably be more motion artifacts present in the raw intensity data (Figure 5b). Such motion artifacts are especially obvious in our system where active illumination from a point source is used. Intensity changes caused by the user moving closer or further from the light source can be many times stronger than the underlying heartbeat signal, leading to erroneous HR measurements (Figure 5b). Therefore, in this study, depth information is used to compensate for the intensity variation caused by motion artifacts. The underlying logic in the motion artifacts compensation is three-fold: First, because active illumination from a point source is used, the change of grayscale intensity is nonlinearly correlated to the relative position between the head and the camera. Secondly, the depth information recorded by the ToF camera should contain no heart rate component since the micromotion created by the heartbeat is too small to be measured by the ToF camera. Lastly, after the motion artifacts are removed,  
Figure 4: (**a**) Raw intensity signal from ROI-1 measured under alternating dark and bright environment. The ambient is swithced on/off at an interval of 5 s. (**b**) Frequency domain HR measured under alternating lighting condition. The highest peak in the frequency domain correspond to measured HR. Figure 5: (**a**) Raw intensity signal (blue) and depth signal (red) from ROI-1 when participants are intentionally staying still. The grayscale intensity shows a clear HR signal. (**b**) Raw intensity signal (blue) and depth signal(red) from ROI-1 when motion artifact is present. The grayscale intensity is dominated by motion induced intensity artifacts. the compensated intensity information should have a minimum correlation with the depth information. In other words, the motion compensation is achieved when the relationship in Equation (1) is satisfied, where \(I_{comp}\), \(I_{raw}\), and \(D_{raw}\) are compensated grayscale intensity, raw average intensity across all pixels in ROI-1, and raw average depth signal across all pixels in ROI-1 respectively.