# XBeats: A Real-Time Electrocardiogram Monitoring and Analysis System
## 5 Experimental Results and Discussions
### Data Acquisition and Data Transmission
Following the benchmark setup, we evaluate the ECG patch prototype by applying the same configurations used in the benchmark experiment. The ADS1298 chip on the ECG prototype applies the RDATAC methods to collect ECG data continuously at a default sampling rate of 500 SPS. This setup is fixed during the whole experiment. We run the experiment four times under different operation modes, as shown in Table 4. The evaluation criterion is based on the resultant data rate of our ECG prototype, which varies according to the selected operation mode. The first operation mode evaluated is the \"offline mode\", in this operation mode, the wireless communication module (i.e., BLE) is switched off completely. The ECG patch is programmed to enable the 12-lead ECG acquisition in the \"offline mode\" or the \"disconnected mode\". We allow this feature to guarantee that the ECG patch doesn't miss any vital information about the heart conditions during disconnectivity. The resultant ECG data acquisition rate in the \"offline mode\" is 480 SPS. In contrast, the \"Disconnected mode\" provided a resulting sampling rate of 370 SPS. The observations from this experiment noted that the communication module on the ECG patch enters the advertising mode [42]. A BLE device uses advertisements to broadcast packets to BLE-enabled devices around it. Then the receiving devices can act on this information or connect to receive more information. When the BLE module on the ECG patch is in advertising mode, advertising packets are sent periodically on each advertising channel to update the presence of the ECG patch to the surrounding devices until it matches with a paired BLE device and establishes a new connection. This operation adds an overhead to the data acquisition task and, thus, the reduced sampling rate. The second patch of tests includes the operation modes that rely on the BLE wireless connectivity to transfer the acquired ECG data to the paired BLE-enabled mobile device. This experiment requires a BLE-enabled mobile device to run our customized mobile application. We use the Google Pixel 3 smartphone to install our ECG patch mobile application. The smartphone supports the latest BLE v5.2 that allows our application to utilize the Data Length Extensions, and the LE 2M PHY features provided by BLE v5.2. Our mobile application automatically sets the physical layer to the 2 MB/s physical configurations and updates the maximum payload to 251 bytes. The payload of one successful BLE packet at the \"continuous mode\" contains seven samples, where each sample carries values from the digitized channels. We encapsulate the 24 bits received for each channel into an unsigned integer object. The total payload size inside on BLE packet applies the following formula: \(Number\ of\ Channels\times Object\ Size\times Number\ of\ samples\). Consequently, we evaluate the \"continuous mode\" on the ECG patch prototype and display the streamed ECG in real-time, as shown in Figure 6a,b. The displayed ECG leads are computed similarly using the leads derivation in Table 3. The useful acquisition rate at the \"continuous mode\" is 343 SPS. Likewise, we apply the same setup on the \"triggered mode\" with one and three lead configurations. The observed useful data acquisition rate at both operation modes configurations was the same (i.e., 441 SPS). \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Operation** & **Number of** & **Number of** & **\# Samples/** & **Payload/** & **Acquisition** \\
**Mode** & **Channels** & **ECG leads** & **BLE Packet** & **BLE Packet** & **Rate** \\ \hline Offline & 8 & 12 & N/A & N/A & 480 SPS \\ Disconnected Mode & 8 & 12 & N/A & N/A & 370 SPS \\ Continuous Mode & 8 & 12 & 7 & 8 (CH) \(\times\) 4 (Bytes) \(\times\) 7 & 343 SPS \\ Triggered Mode-1 & 1 & 1 (i.e., Lead II) & 56 & 1 \(\times\) 4 \(\times\) 56 = 224 Bytes & 441 SPS \\ Triggered Mode-2 & 2 & 3 (i.e., Leads I, II, and aVF) & 28 & 3 \(\times\) 4 \(\times\) 28 = 224 Bytes & 441 SPS \\ \hline \hline \end{tabular}
\end{table}