# XBeats: A Real-Time Electrocardiogram Monitoring and Analysis System
## 2 Background and Related Work
### Single Lead ECG  
Single Lead ECG devices are very common today. A single ECG lead covers limited heart regions, making it suitable for heart activity monitoring. One-lead ECG can help improve arrhythmia diagnosis but discriminating P-waves may be challenging and insufficient for correct diagnosis of sinus rhythm [9]. Accordingly, these devices are generally used to record long recordings up to 14 days or a recording of merely a few seconds (e.g., Apple Watch Series 7). The authors in [10] fused the machinal pattern of the heart using seismocardiography (SCG) signal with ECG data. The fusion method is based on the Naive Bayes probabilistic model to extract the PQRST annotations from the raw ECG signal. Then, they calculate the duration between different subsets of the PQRST data vector, which can indicate the presence of abnormalities in the ECG signals. The ECG processing is performed on a host desktop, where the data is transmitted through a synchronous data logger. This process is decoupled from the data acquisition process as it runs using a data logger which is not designed for real-time operations. Several research works have proposed transmitting ECG signals in real-time to a backend server for processing. The authors in [11] proposed integrating wireless communications (e.g., BLE and WIFI) for transmitting the acquired data. The actual design and hardware prototype didn't include wireless communication modules. Therefore, the device is connected to high-performance data acquisition hardware. Then, the data are transferred to the host computer for storage, processing, analysis, and visualization. [PERSON] et al. [12] present a fusion algorithm between multiple sensors, including a single-lead ECG sensor to measure lead I or II and a stethoscope to obtain an acoustic insight of the heartbeats. Similarly, [13] introduced a remote single-lead ECG powered by a coin battery. ECG signals are transferred to a mobile device in real-time and then to a backend system for further analysis. Although the device provides offline ECG data logging, it doesn't analyze the collected data for abnormal heart conditions to notify the patients or the healthcare provider to take necessary actions. A different line of research develops porotypes that use fog computing to enable remote ECG monitoring. The authors in [14] introduced a single lead ECG monitoring system to provide a telemedical solution for rural areas with the help of fog computing. The system utilizes the ESP-32 module as the main microcontroller (MCU) for processing the collected ECG data, then sends the collected data in one-minute intervals, not on a real-time basis. This limitation is due to the bandwidth restriction of the LoRa communication link (i.e., 0.3-50 Kb/s). Moreover, the authors didn't consider discontinuity scenarios where no wireless connectivity is in range since the device doesn't offer offline data logging. Accordingly, this solution is not optimized for long-term ECG monitoring. Similarly, [PERSON] et al. [15] developed a single-lead ECG acquisition hardware using Arduino Uno for acquiring ECG signals and sending them to a Raspberry PI (RPI) for further analysis and classification. However, the system has an overhead in the design since the Analog to Digital Converter (ADC) is interfaced to an Arduino Uno via Serial Peripheral Interface (SPI). The Arduino Uno device is connected serially to the RPI for signal analysis. This design overlap could have been avoided by directly connecting the ADC module to the RPI. Moreover, the RPI has an embedded BLE module that can communicate with a mobile phone instead of using the extra HC-05 Bluetooth hardware. The integration of the four modes of operations: (1) serial cable transmission, (2) offline data logging to a local flash drive, (3) transmission to a mobile phone via Bluetooth, and (4) transmission to a desktop via Bluetooth provides better integration and operability. The authors in [16] proposed a single-lead ECG signal acquisition prototype using one of the four given modes of operation.