## 4 Analysis
### Preprocessing  
To make the analysis in this study possible, the camera-measured signals and expected signals first had to be obtained, synchronised, and compiled into a dataset. An outline of this process can be seen in Figure 4.  
Initially, the instructional film was manually coded to obtain the expected signal for FAC. For each movement, the first, last, and peak frame number reference was transcribed. Next, the intensity of the model's movement at this peak was also assessed, through cross-examination with examples within [PERSON]'s FAC Manual [46]. Using this data, an array of expected facial movement intensities could be produced which matched the sample rate of the recorded videos (50 Hz). This expected response signal was univariate, only describing the activation of the target expression being demonstrated by the on-screen model in the instructional film. The video footage was cut so that the recordings began at the start of the instructional film. This was done with _LosslessCut_[62], a software solution for segmenting video files  
Figure 4: Data preprocessing flow chart showing how all the data were collected for the study and processed ready for further analysis (see Section 4). without re-encoding, using the visual marker discussed in Section 3.1. This also allowed for visual inspection, confirming that all the footage was in focus and all participants had made an attempt at the instructions prompted in the film. The truncated video was then processed with _OpenFace 2 (2.2.0)_ using the CLI _FeatureExtraction_ command, to output the camera-measured signal [1]. This was then sliced to create a univariate signal containing only the target expressions. The _Polar H10_ is able to process electrocardiogram (ECG) data in real-time on the device and deliver a heart rate value each second via Bluetooth, as well as a timestamp, hence no pre-processing was needed to obtain this expected heart rate signal. To obtain the camera-measured signal, _PyVHR_ was used to process the video footage from the start of the instructional film until the end of the facial actions task. The specific rPPG process used is described in the demo file available via the associated GitHub repository [2]. Notably, the six-region approach was preferred to the one-hundred-region approach for facial patch sampling as it was considered to reduce the influence of facial hair and glasses by not sampling these regions. When processing the video data using _PyVHR (1.0.2)_, it became clear that processing any more than one minute of video with the patches extraction subprocess enabled, led to a'memory full' error. To address this issue, each video was cropped using the _FFmpeg_ library at lossless quality [63]. The crop window removed much of the background, whilst still ensuring that none of the participants' faces moved out of frame at any point in any of the videos. Specifically, the video was cropped to a 700 pixel by 1080 pixel frame, centred in the middle of the original 1920 pixel by 1080 pixel frame. Reducing the resolution in this way caused the file sizes to increase, due to the lossless re-encoding, but led to faster execution times in _PyVHR_ and successful processing without error. After the video data had been processed using _PyVHR_, to obtain the camera-measured signal, the _Polar H10_ data was synchronised with this data by aligning the associated timestamps. To obtain these millisecond precision timestamps from the file's metadata, _Exiftool_ was used [64]. However, the alignment of the two signals appeared to be incorrect using this method. Hence, the synchronisation was reassessed by analysing the maximum value of the cross-correlation function, with the expected (_Polar H10_) and camera-measured (_PyVHR_) signals as inputs. This assessment was made for all videos in bright condition. Implementation notes for this process are accessible via the _SciPy_ library documentation [65]. The outcome of this process suggested that the internal clock of the _Polar H10_ sensor was 54 s behind the timestamps obtained from the camera.