# Comparison of ECG Between Gameplay and Seated Rest: Machine Learning-Based Classification
## 2 Materials and Methods
### ECG Data Collection and HRV Analysis  
ECG signals were continuously recorded using the Checkme Pro device (San-ei Medisys, Japan). The Checkme Pro was selected for its compact design, high-quality signal acquisition, and ease of use in controlled experiments. The ECG signal was measured using a NASA-guided lead placement, which records the potential difference between the upper and lower sternum. This placement was chosen because it effectively minimizes electromyographic (EMG) noise while providing excellent P-wave visibility, enhancing the accuracy of RR interval detection. The ECG signals were sampled at a frequency of 250 Hz, ensuring high temporal resolution for HRV analysis. The Checkme Pro device was connected to a PC via a USB cable, and the recorded ECG data were transferred to a computer using Checkme Viewer software (San-ei Medisys, Japan, [[https://www.checkme.jp/pcviewer/](https://www.checkme.jp/pcviewer/)]([https://www.checkme.jp/pcviewer/](https://www.checkme.jp/pcviewer/)), accessed on 1 February 2025). The exported ECG data were saved in CSV format for further processing and analysis. From the raw ECG signals, RR interval time series were extracted and resampled at 2 Hz to standardize the data for HRV analysis. The study focused on key heart-rate variability (HRV) indices, which were computed using fast Fourier transform (FFT) to extract frequency-domain features. Resampling RR interval time series at 2 Hz is a common practice in heart-rate variability (HRV) analysis to convert the inherently irregular RR intervals--derived from R-peaks in the ECG which represent individual heartbeats--into a uniformly spaced time series suitable for spectral analysis. Since RR intervals are not naturally equidistant in time, resampling is necessary to apply frequency-domain methods such as the fast Fourier transform (FFT). A sampling rate of 2 Hz (i.e., data points every 0.5 s) provides sufficient temporal resolution to capture both low-frequency (LF: 0.04-0.15 Hz) and high-frequency (HF: 0.15-0.4 Hz) components of HRV while minimizing computational load. This makes it a practical and balanced choice. Power spectrum analysis methods include Lomb-Scargle period analysis and the AR model (Yule-Walker equation and Akaike's Information Criterion). Lomb-Scargle period analysis can be applied to irregularly sampled data and is suitable for HRV analysis obtained from wearable devices. The AR model has high frequency resolution and can be applied to small datasets, making it suitable for long-term HRV analysis and autonomic nervous balance evaluation. In this study, we selected the fast Fourier transform method, which is easy to apply to short-term data because the sampling time interval is constant. * Mean RR interval (ms): The average duration between consecutive R-peaks, representing overall heart-rate trends. * SDRR (ms): The standard deviation of RR intervals, reflecting overall HRV magnitude. * VLF (very low-frequency power (In, ms\({}^{2}\)), 0.003-0.04 Hz): Associated with long-term autonomic regulation and possibly thermoregulatory mechanisms. * LF (low-frequency power (In, ms\({}^{2}\)), 0.04-0.15 Hz): Represents a combination of sympathetic and parasympathetic nervous system activity. * HF (high-frequency power (In, ms\({}^{2}\)), 0.15-0.40 Hz): Primarily reflects parasympathetic (vagal) activity and respiratory influences. * LF/HF ratio: An indicator of sympathovagal balance, with higher values suggesting increased sympathetic dominance. * HF peak frequency (Hz): The dominant frequency within the HF band, associated with respiratory modulation of heart rate. HRV indices were calculated for both 5 min and 10 min segments of ECG data to analyze short-term autonomic fluctuations. In this study, we adopted the power spectral density method to analyze the periodic structure of data in a time-series data analysis of heart-rate variability. The power spectrum was calculated using a nonparametric estimation method to calculate the power spectral density (PSD).