A Wi-Fi IoT prototype for ECG monitoring exploiting a novel Compressed Sensing method ACTA IMEKO ISSN: 2221-870X June 2020, Volume 9, Number 2, 38 - 45 ACTA IMEKO | www.imeko.org June 2020 | Volume 9 | Number 2 | 38 A Wi-Fi internet-of-things prototype for ECG monitoring by exploiting a novel compressed sensing method Eulalia Balestrieri1, Pasquale Daponte1, Luca De Vito1, Francesco Picariello1, Sergio Rapuano1, Ioan Tudosa1 1 Department of Engineering, University of Sannio, Benevento, Italy Section: RESEARCH PAPER Keywords: Internet of things; sampling; compressed sensing; ECG signal; embedded systems; data acquisition; energy consumption. Citation: Eulalia Balestrieri, Pasquale Daponte, Luca De Vito, Francesco Picariello, Sergio Rapuano, Ioan Tudosa, A Wi-Fi internet-of-things prototype for ECG monitoring by exploiting a novel compressed sensing method, Acta IMEKO, vol. 9, no. 2, article 7, June 2020, identifier: IMEKO-ACTA-09 (2020)-02-07 Editor: Alexandru Salceanu, Technical University of Iasi, Romania Received February 7, 2020; In final form March 25, 2020; Published June 2020 Copyright: This is an open-access article distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. Funding: The study has been supported by the PON project ARS01_00860 Ambient-intelligent Tele-monitoring and Telemetry for Incepting & Catering over Human Sustainability – ATTICUS – RNA/COR 576347. Corresponding author: Francesco Pciariello, e-mail: fpicariello@unisannio.it 1. INTRODUCTION The concept of Internet of Things (IoT) was proposed as new paradigm for machine-to-machine communication, whereby the things (i.e. smart sensors/actuators) are augmented with internet connectivity in order to (i) observe/actuate upon various physical quantities, (ii) collect information, (iii) transmit and receive, (iv) store, and (v) analyse the acquired data [1], [2]. Nowadays, the IoT concept is successfully applied in several measurement applications [1], such as smart cities, intelligent transportation [3], and even biomedicine [1][3]. Biomedical systems adopting IoT (i.e. thus forming internet- connected instrumentation for patient monitoring) are currently used in wearable health monitoring systems, thus allowing the implementation of personalised healthcare and telemedicine services [4]. Patient mobility requires that many such biomedical wearables are battery powered and consequently connected health wearable instrumentation is strongly dependent on the energy costs of wireless internet communication [5][6]. To illustrate, bio-electrical signals like the electrocardiogram (ECG) are used for the identification of arrhythmia or irregular abnormalities [4][7]. This process of patient monitoring requires the transmission and storage of ECG records in the long term. In the literature, developments of IoT prototypes for ECG signal monitoring [8][9] and digital signal processing algorithms for ECG signal quality improvement have been reported in the literature [10]-[20]. The actual research direction is motivated by the aim of developing biomedical wearables that exhibit low- power consumption in order to prolong their battery life [21]. The research activity presented in this article is part of the project entitled ‘Ambient-intelligent Tele-monitoring and Telemetry for Incepting & Catering over Human Sustainability’, ATTICUS, supported by the Italian Ministry of Education and Research. The project aims to develop a smart wearable device for the ABSTRACT This article presents an internet-of-things prototype consisting of a data acquisition device wirelessly connected to the internet via Wi- Fi for continuous ECG monitoring. The proposed system performs a novel compressed sensing-based method on ECG signals, with the aim of reducing the amount of transmitted data and thus realizing an efficient way of increasing the battery life of such devices. For the assessment of the energy consumption of the device, an experimental setup is arranged, and its description is presented. The evaluation of the reconstruction quality of the ECG signal in terms of the percentage of the root-mean-squared difference is reported for several compression ratios. The obtained experimental results clearly demonstrate high energy efficiency and the usefulness of the Wi-Fi-based internet-of-things device adopting the considered compressed sensing method for the data compression of ECG signals. Furthermore, it allows for the reduction of the energy consumption of the internet-of-things device by increasing the compression ratio without significantly degrading the quality of the reconstructed ECG signal. mailto:fpicariello@unisannio.it ACTA IMEKO | www.imeko.org June 2020 | Volume 9 | Number 2 | 39 monitoring of several vital parameters by adopting novel technologies (i.e. hardware and software) for minimising power consumption [4][21][22]. The general architecture of the ATTICUS system (see Figure 1) consists of [4] (i) a smart wearable device (S-WEAR), (ii) an ambient intelligence device (S-BOX), (iii) a Decision Support System (DSS), and (iv) a monitoring station. In case of wearable devices, which are wirelessly connected to the internet, the main contribution to the overall power consumption is from the transmission of the acquired data (e.g. real-time ECG signals). In order to reduce this contribution, it is necessary to decrease the number of times that the wireless transceiver is transmitting data. To this end, several data compression algorithms can be adopted [16]. Thus, a data compression method implemented on a wearable device should exhibit low complexity, due to the limited processing capabilities of the device and good quality in the reconstruction of the original signal. Several data compression methods for ECG signals based on Compressed Sensing (CS) theory have been developed in the literature [5]-[7]. In [12], a novel method for the CS-based sampling of ECG signals for IoT systems is proposed. A first experimental evaluation of the method on hardware is presented in [21]. This article aims to present the experimental results of the hardware implementation of the proposed CS method, which is tested on a Wi-Fi System-on-Chip (SoC) module, with the aim of experimentally assessing the method in terms of the energy consumption of the wearable device and reconstruction quality. The article is organised as follows. A brief presentation of the state of the art concerning IoT-based patient monitoring systems adopting Wi-Fi data transmission is given in Section 2. Section 3 describes the adopted CS-based method. In Section 4, the IoT prototype is presented. The experimental setup and the obtained results (in terms of the signal reconstruction quality and energy consumption of the implemented prototype) are described in Section 5. Several conclusions and recommendations for future work are reported in Section 6. 2. STATE OF THE ART Nowadays, the health status of patients and real-time services for emergency notification are possible due to the advancement of IoT technologies [23][25]. Thus, the biotelemetry of ECG data represents an important task that helps to assist the cardiac activity of monitored patients [26]. Many studies have presented ideas and developments concerning remote cardiac monitoring systems, which could be used by even laypeople for multiple patient monitoring in a residential environment [23][26]. In [25], the authors describe a Wi-Fi-based ECG monitoring system using the Concerto IoT platform. The Concerto family of Microcontroller Units (MCUs) are multicore SoCs from Texas Instruments (TI). The proposal in [25] is built on a single chip ECG signal acquisition, a SimpleLink CC3000 Wi-Fi-based communication module, and a receiving peer – a smartphone. The low-energy feature of CC3000 is used for its advertising function, which sends messages for the establishment of the Wi- Fi connection. Once the connection is established, a User Datagram Protocol (UDP) packet containing 7680 bytes is sent to the smartphone. However, in [25], there is no experimental evaluation of the energy consumption of the proposed IoT system for real-time ECG signal monitoring. In [27], an IoT-based portable ECG monitoring system for smart healthcare is presented. The authors developed an ECG wearable device comprising an (i) AD8232 as an Analog Front End (AFE) module for ECG signal acquisition, (ii) an Arduino Uno board for ECG sample transfer, and (iii) a Raspberry Pi 3B IoT platform for Wi-Fi data communication, which receives the ECG samples from the Arduino Uno board and sends them to a Wi-Fi peer receiver i.e. a smartphone. A similar approach is developed and presented in [28]. In the present work, the authors use (i) a classical ECG amplifier circuit built on AD620AN IC, (ii) an LPC2148 ARM7-based microcontroller for the analog-to- digital conversion of ECG signals, and (iii) a Raspberry Pi 3 IoT platform for Wi-Fi data communication to a laptop computer. In [29], the design of seven lead ECG monitoring systems exploiting Wi-Fi data communication is presented. The proposed system is based on a sensing device comprising (i) an AFE module for ECG signal acquisition, (ii) an STM32F103 microcontroller for data processing, and (iii) a Wi-Fi ESP8266 module for data communication. Another work presenting IoT Wi-Fi-based real-time heart rate variability monitoring is [30]. The ECG AFE is built using AD8232 IC, is connected to the TI MSP430F5529 MCU, and sends data wirelessly by means of the TI CC3100 SimpleLink Wi- Fi Booster pack evaluation board. The receiver is a laptop computer that receives the ECG data and streams it to an IoT cloud platform called PubNub. Other works dealing with IoT-based ECG monitoring exploiting data communication using Wi-Fi networks include [31]-[35]. From the prior research that we considered, [23]-[35], none presents an analysis regarding the energy consumption of Wi-Fi data transmission. For wearable IoT healthcare sensing devices, the instantaneous power consumption represents an important design parameter, allowing us to control the expectation of battery life. Moreover, in the surveyed literature, the adopted processing steps for ECG signal acquisition and transmission is like the one presented in Figure 2 (a), and as it was observed, there are no results presenting data compression and energy consumption measurements. In this work, the adopted processing steps for ECG signal acquisition and transmission is the one presented in Figure 2 (b). Thus, using a SoC-type MCU that embeds the Wi-Fi transceiver will gives an advantage in energy consumption optimisation compared to the existing proposals in the literature, which deal with systems like the one in Figure 2 (a). Figure 1. The architecture of the ATTICUS system [4]. ACTA IMEKO | www.imeko.org June 2020 | Volume 9 | Number 2 | 40 3. DESCRIPTION OF THE CS-BASED METHOD In this section, the implemented CS-based method for ECG compression in the proposed IoT system is briefly described. This method was firstly presented in [22], and it is based on a sensing matrix that contains information that is strictly correlated to the power of the ECG signal in a single frame. Usually, CS frameworks for the acquisition of ECG signals exploit sensing matrices, which are built up by using random sequences generated according to several probability density functions (e.g. Bernoulli and Gaussian) [12][13]. The reconstruction step, which operates on the compressed ECG samples, requires the definition of a dictionary matrix (e.g. Symlet 4, Daubechies 6, and Mexican Hat wavelets), whereby the ECG signal can be considered sparse (i.e. it can be represented with a small number of coefficients). In these cases, by considering the same dictionary matrix, the reconstruction quality of the ECG signal strictly depends on the adopted random sequence used for defining the sensing matrix. In order to overcome this limit, in [12], the sensing matrix is built up by using a deterministic sequence. Moreover, this sequence depends on the power content of the ECG signal under observation. In this way, the information content (i.e. R-peak, QRS complex, and P-wave) on the compressed samples of the ECG signal is maximised, and then, the reconstruction quality is enhanced compared with classic approaches [12][13]. For one lead ECG signal compression, the adopted method performs the following steps (see Figure 3) [21][22]: 1. A vector 𝒙 ∈ ℝ𝑁×1 of 𝑁 discrete samples, including at least one period of the ECG signal, is acquired. 2. Based on this vector, the average value, 𝑥𝑎𝑣𝑔 , is calculated. 3. The absolute value of the point-by-point difference between the 𝒙 vector and its average value, 𝑥𝑎𝑣𝑔 , is performed, thus obtaining the vector 𝒙𝒂. 4. The vector 𝒙𝒂 is compared point-by-point with a fixed threshold value, 𝑥𝑡ℎ. 5. The vector 𝒑 ∈ ℝ𝑁×1 of 𝑁 binary values is built as follows: (i) if the element of 𝒙𝒂 is higher than (or equal to) 𝑥𝑡ℎ, the value 1 is inserted into the corresponding vector position of 𝒑, and (ii) if the element of 𝒙𝒂 is lower than 𝑥𝑡ℎ, the value 0 is inserted in the corresponding vector position of 𝒑. 6. Each row of the sensing matrix 𝜱 ∈ ℝ𝑀×𝑁 is obtained by the circular shifting of the vector 𝒑𝑻, where ⋅𝑻 represents the transpose operation. The number of shifted samples is equal to the compression ratio, 𝐶𝑅 = 𝑁/𝑀, where 𝑀 is the number of compressed samples and corresponds to the number of 𝜱 rows. The circular shifting is performed in order to comply with the restricted isometry property and to reduce the coherence of the sensing matrix with the dictionary matrix, which are required for guaranteeing the signal reconstruction in CS theory [23]. 7. The 𝑀-compressed samples, which are contained in the vector 𝒚, are obtained by multiplying the sensing matrix 𝜱 by the vector 𝒙. The above operations do not require a large amount of memory and high-processing computational efforts. Thus, they could be performed on low-cost microcontrollers. In order to construct the vector 𝒙, which represents an estimation of the original signal 𝒙, from the compressed samples 𝒚, the following steps are performed (see Figure 4): 1. The dyadic Mexican Hat wavelet matrix, 𝜳 ∈ ℝ𝑁×𝑁+1, and the sensing matrix, 𝜱 are built. 2. The Orthogonal Matching Pursuit (OMP) algorithm is used for estimating the 𝑅 coefficients that represent the 𝒙 vector in the domain defined by the dyadic Mexican Hat wavelet, by solving the following minimisation problem: �̂� = 𝑎𝑟𝑔 𝑚𝑖𝑛 𝜶 ‖𝜶‖1, subject to 𝒚 = 𝜱 ⋅ 𝜳 ⋅ 𝒙, where �̂� is the vector containing the 𝑅 estimated coefficients. 3. By multiplying the estimated �̂� vector with the dyadic Mexican Hat wavelet matrix, 𝜳, the vector 𝒙 is estimated. The above reconstruction operations are performed on a processing platform that does not have energy consumption constraints and size limitations. 4. THE IMPLEMENTED IOT SYSTEM PROTOTYPE In this section, the architecture of the implemented IoT system performing the proposed CS method is described. The Figure 2. The processing steps of the ECG signal acquisition and transmission: (a) a generic overview of the proposals in the literature and (b) a generic overview of the adopted system in this work. Figure 3. The processing steps of the adopted CS-based data compression. Figure 4. The processing steps for the reconstruction of the ECG signals from the compressed data. x xavg xa      p   1 0  1) 2) 3) 4) 5) 6) xth xth 7) y  1)  ̂1 ̂ 2 ̂ N+1 OMP Algorithm   y   2)   ^ 1x x̂ 2 x̂ N  1 1  1  3)  ̂1 ̂ 2 ̂ N+1 N  N+1 ACTA IMEKO | www.imeko.org June 2020 | Volume 9 | Number 2 | 41 system consists of (i) an ECG data acquisition system, which embeds a Wi-Fi transceiver, (ii) a Wi-Fi router, and (iii) a laptop. The ECG data acquisition system acquires the ECG samples, performs the data compression for obtaining the vector 𝒚, and sends to the Wi-Fi router both vector 𝒚 and 𝒑 in a UDP packet. The router collects the received data and transmits them to the laptop. The laptop receives the compressed samples 𝒚 and the vector 𝒑, and it executes the OMP algorithm in order to reconstruct 𝒙. The reconstructed samples are shown to the user through a graphic interface. In the following section, the hardware and the firmware of the implemented ECG data acquisition system are described. Furthermore, a LabVIEW application running on the laptop for data acquisition and reconstruction is developed. Its main tasks are described thereafter. 4.1. ECG data acquisition system: hardware The ECG data acquisition system consists of a CC3200MOD LaunchPad evaluation board [37], embedding the CC3200MOD SoC. This SoC is a wireless microcontroller module that integrates an ARM Cortex-M4 core running at 80 MHz and a Wi- Fi network processor to completely offload the host processor along with an 802.11 b/g/n radio, baseband, and MAC for secure WLAN internet connections. The network processor supports station, Wireless Access Point (WAP), and Wi-Fi direct connection modes. Moreover, it implements the IPv4 TCP/IP stack [36]. The microcontroller acquires the samples of the ECG signal by means of its embedded 12-bit Analog-to-Digital Converter (ADC) on the ADC-CH2 pin. The ADC works at a sampling rate of 500 Hz and has an input voltage range of [0, 1.4] V [36]. The AFE has not been designed in the implemented prototype, since its energy consumption is negligible in respect to the necessary power for Wi-Fi communication. In order to reduce the power consumption of the overall SoC, both the Cortex-M4 Application Processor (AP) and the Networking Processor (NP) can work in different power states. The user program controls the power modes of the AP, which can be in the following five states: (i) active, (ii) sleep, (iii) Low- Power Deep Sleep (LPDS), and (iv) hibernate. During the active state, the AP executes the code at a 80 MHz clock rate. On the other hand, in sleep mode, the AP clocks are gated off, and the entire state of the device is retained. In that state, the AP can be configured to wake up by an internal fast timer or by activity from any General Purposes Input Output (GPIO) line. In LPDS mode, the state information is lost, and only certain AP specific register configurations are retained. The AP can wake up from external events or by using an internal timer with a wake-up time of around 3 ms. The lowest power mode in which all digital logic is power-gated is the hibernate mode. The Real-Time Clock (RTC) keeps running, and the AP supports wake up from an external event or from an RTC time expiry. In this state, the wake-up time is about 15 ms. The NP can be active or in LPDS mode. Furthermore, when there is no network activity, the NP sleeps most of the time and wakes up only for a Beacon packet reception. In Table 1, the current consumption in the different power states of both AP and NP, according to the datasheet [36], are summarised. For the implemented prototype, the AP alternates between the active and the idle states, while the NP works into the transmission (Tx), reception (Rx), and LPDS states. 4.2. ECG data acquisition system: firmware A general overview of the firmware executed by the ECG data acquisition system is depicted in Figure 5. In the beginning, the AP initialises the NP and provides it with the Service Set IDentifier (SSID) and the password of the WAP. The AP waits until the connection has been established between the NP and the WAP. A timer working at a frequency of 500 Hz is initialised, and the interrupt signalling due to its overflow is enabled. Two global variables are initialised to zero – count and length (see Figure 5). The variable count contains the number of acquired ECG samples at any program instant, while the variable length contains the length of the data that will be sent to the router through a UDP packet. The AP is in an idle state until the number of acquired samples, performed during the interrupt routine of the timer, is equal to 𝑁. Vector 𝒑 is constructed according to the fixed threshold 𝑥𝑡ℎ and the vector 𝒙 containing the 𝑁 acquired samples. Data compression is performed on vector 𝒙 according to sensing matrix 𝜱, which is a circulant matrix in which the first row is vector 𝒑𝑻. Vector 𝒚 is evaluated as a multiplication between the sensing matrix and the vector 𝒙. Both the 𝒚 and 𝒑 vectors are coded in a vector called payload. The variable length is incremented according to the length of the coded data. The data compression procedure is performed for each frame of 𝑁 ECG samples until the length of the vector containing the coded data achieves the maximum value of the payload length, MAX, allowed by the UDP packet, corresponding to 1472 bytes. When the maximum payload length is reached, the UDP packet is sent to the laptop through the WAP. In order to reduce power consumption, due to the Wi-Fi transceiver, the NP is always in the LPDS state. It goes into the reception state for receiving the Beacon packet sent by the WAP, Figure 5. A general overview of the firmware executed by the ECG data acquisition system. Table 1: Current consumption of the AP and NP in the available states [23]. AP state NP state Current consumption Active Tx 278 mA Rx 59 mA Idle 15.3 mA Sleep Tx 275 mA Rx 56 mA Idle 12.2 mA LPDS Tx 272 mA Rx 53 mA LPDS 0.275 mA Idle 0.875 mA Hibernate Hibernate 7 µA START NP initialization Timer initialization at 500 Hz Enabling timer interrupt count = 0, length = 0 Connected to the WAP? No Yes count = N? No count = 0 power vector, p, evaluation data compression, y length = MAX? No sending the UDP packet length = 0 length = length + + payload(y,p) Yes Yes main loop interrupt routine of the timer count = count +1 timer reset Timer routine x(count) = ADC reading Board initialization ACTA IMEKO | www.imeko.org June 2020 | Volume 9 | Number 2 | 42 and for responding to it every 2 s. The number of transmitted UDP packets depends on the 𝐶𝑅. Of course, by increasing the 𝐶𝑅, the UDP packets will be sent by the ECG data acquisition system more and more sporadically, and the entire energy consumption of the data acquisition system will then reduce. 4.3. Laptop: software The task of the laptop is to collect compressed samples 𝒚 and power vector 𝒑 sent by the ECG data acquisition system and to perform the OMP algorithm to reconstruct 𝒙. To this end, a LabVIEW application has been realised. In the beginning, the laptop waits for the reception of a packet containing MAX = 1472 bytes. When the packet is received, the vector of the compressed data, 𝒚, and vector 𝒑 are extracted. For each ECG frame of N samples, the length of 𝒚 is 2 ∙ 𝑀 bytes, and the length of 𝒑 is 𝑁/8 bytes. Thus, according to the 𝐶𝑅, several frames of ECG signals are enclosed in a UDP packet. For example, if 𝐶𝑅 = 4 and 𝑁 = 512, 𝑀 is 128. For each frame, 256 + 64 = 320 bytes are required, and in a UDP packet, 4 frames are enclosed. By considering that the sampling frequency of each ECG sample is 500 Hz, 4 frames of compressed ECG samples will be received by the laptop about every 4 s. Vector 𝒙 is reconstructed according to the OMP algorithm (see Figure 4), which is performed in real time for each frame contained in a UDP packet. Vector 𝒙 is finally shown to the user. 5. EXPERIMENTAL RESULTS AND DISCUSSION An experimental setup has been implemented (see Figure 6) for (i) assessing the quality of signal reconstruction at different 𝐶𝑅 values and (ii) measuring the energy consumption of the ECG data acquisition system for different values of 𝐶𝑅. In order to evaluate the quality of signal reconstruction, in the UDP packet, 𝒚 and 𝒑 are enclosed as well as 𝒙. In that case, the setup consists of an ECG signal provided by the Agilent 33220A arbitrary waveform generator connected to the ADC-CH2 pin of the SimpleLink Wi-Fi CC3200 Module LaunchPad [37]. The generated ECG signal has a high level of 950 mV and a low level of 100 mV, with a frequency of 1 Hz, which corresponds to a heart rate of 60 bpm. The LabVIEW application reconstructs 𝒙, which is compared with the original ECG signal contained in 𝒙. As a figure of merit, the Percentage of Root-mean-squared Difference (PRD) is computed as follows: 𝑃𝑅𝐷 = ||𝐱 − �̂�||2 ||𝐱||2 × 100% . (1) This figure of merit is widely used by the scientific community for comparing CS algorithms in terms of the reconstruction quality of ECG signals [23]. The 𝑃𝑅𝐷 value is evaluated along an acquisition time of 1 minute of the ECG signal for the following 𝐶𝑅 values: {2, 4, 8}. Those 𝐶𝑅s have been chosen according to the results obtained in [21], where it is reported that with the proposed method, a good reconstruction quality is obtained for 𝐶𝑅 ≤ 8. For the experimental assessment, threshold, 𝑥𝑡ℎ, has been chosen at 20 mV. In Figure 7, a single frame reconstructed signal for each considered 𝐶𝑅 and the point-by-point absolute value of the difference between the estimates and the original signal are depicted. It is observable that the point-by-point differences increase along with the 𝐶𝑅. In particular, for 𝐶𝑅 = 4, the maximum difference is around 20 mV, while for 𝐶𝑅 = 8, it is 60 mV [see Figure 7 (d) and (e)]. However, for all the considered 𝐶𝑅, the reconstructed signal approximates the original one well. For assessing the energy consumption of the ECG data acquisition system for several 𝐶𝑅 values, the experimental setup depicted in Figure 7 is used. It consists of a power measurement system consisting of (i) a shunt resistor with a nominal value of 1.2 Ω, (ii) the NI-DAQ 6036E, and (iii) a PC interfacing with the NI-DAQ. The shunt resistor is placed in a series on the power supply pin of the CC3200. Its drop voltage, 𝑣𝐼 (𝑡), proportional to the current dissipated by the SoC, is measured by using a differential input of the NI-DAQ, while the voltage measurements, 𝑣𝑃 (𝑡), are performed by means of a single-ended analog channel in the NI-DAQ. The current and voltage measurements are multiplied for measuring the instantaneous power consumption of the ECG data acquisition system. These values are acquired by the PC in continuous mode with a sampling frequency of 100 kHz. Figure 6. A general overview of the implemented experimental setup for assessing the quality of signal reconstruction and for measuring the energy consumption of the EGC data acquisition system. ACTA IMEKO | www.imeko.org June 2020 | Volume 9 | Number 2 | 43 The voltage and current measurements have been calibrated against the value provided by the FLUKE 5500A calibrator. The current measurements have been calibrated by imposing current values from 0 mA up to 500 mA with a step of 50 mA. For each imposed current value, a type A uncertainty evaluation is performed on 105 measurements. The obtained expanded uncertainty is 0.4 mA by considering a coverage factor 𝑘 = 2. On the other hand, the voltage measurements have been calibrated within a range of 0 V up to 5 V, with a step of 0.5 V. For each of the imposed voltage values, the type A uncertainty assessment is performed on 105 measurements. The obtained expanded uncertainty is 0.3 mV, by considering a coverage factor 𝑘 = 2. According to the law of the propagation of uncertainty, the expanded uncertainty for the power measurements is 1.5 mW. In Figure 8, the instantaneous power consumption of the ECG data acquisition system is depicted for a time window of 15 s in the case of no compression, implemented on the data acquisition system [Figure 8 (a)], and data compression performed for 𝐶𝑅 = {2, 4, 8}, see Figure 8 (b), (c), and (d), respectively. The measurements have been evaluated by considering for both NP and AP, the LPDS current consumption values reported in Table 1. In Figure 8, the power consumption due to the UDP packet transmission and the packet due to the Beacon response are marked. As expected, by increasing 𝐶𝑅, the number of times that the Beacon response is sent and the UDP packet is transmitted reduce. In particular, for 𝐶𝑅 = 8, it is observable that the Beacon response is sent every 2 s and that the UDP packets are transmitted about every 5 s. The power consumption measurements are taken for 4 s and, for this time period, energy consumption is estimated. Those measurements are repeated 10 times, and the type A uncertainty assessment is performed. Furthermore, for the considered 𝐶𝑅, 100 ECG frames of 1 s each are acquired, and the 𝑃𝑅𝐷 and its uncertainty are estimated. In Table 2, the energy consumption and the 𝑃𝑅𝐷 values when compression is not performed and for the 𝐶𝑅 values of 2, 4, and 8 are reported. For the expression of the expanded uncertainties a coverage factor, 𝑘 = 2 has been considered. From this Table, it can be noted that for 𝐶𝑅 = 2, there is no advantage in terms of energy consumption respect with the no compression case (the two energy consumption measurements are compatible). For the 𝐶𝑅 values of 4 and 8, the energy consumption decreases even if, as it was expected, the 𝑃𝑅𝐷 increase. However, the obtained 𝑃𝑅𝐷 for 𝐶𝑅 = 8 is lower than the 9 %, which is usually considered the maximum acceptable limit value for medical diagnosis [22][23]. 6. CONCLUSIONS In this article, an IoT prototype for continuous ECG monitoring that performs a novel CS-based method to reduce the amount of transmitted data was presented. The implemented prototype consists of a wearable device wirelessly connected to the internet via Wi-Fi, based on the CC3200 SoC. The hardware of the implemented prototype and the firmware and software executed on the wearable device and the laptop, respectively, were described. A description of the experimental setup used for the assessment of the energy consumption of the device for several 𝐶𝑅 values and for the evaluation of the reconstruction quality in terms of 𝑃𝑅𝐷 was given. The obtained experimental results Figure 7: Single frame reconstructed signal for the following 𝐶𝑅 = {2, 4, 8}, a), b) and c), and the corresponding point-by-point absolute value of the difference between the estimates and the original signal, d), e), and f). Table 2: Energy consumption and PRD when the compression is not performed and for 𝐶𝑅 values of 2, 4, and 8. Energy consumption in J PRD in % No compression (2.65 ± 0.09) − 𝐶𝑅 = 2 (2.70 ± 0.08) (0.94 ± 0.50) 𝐶𝑅 = 4 (2.49 ± 0.06) (1.21 ± 0.10) 𝐶𝑅 = 8 (2.32 ± 0.04) (4.61 ± 0.55) ACTA IMEKO | www.imeko.org June 2020 | Volume 9 | Number 2 | 44 demonstrate that the tested IoT prototype, which implements the CS method presented in [22], allows for the reduction of the energy consumption of the wearable device by increasing the compression ratio, without degrading the quality of the reconstructed ECG signal. For 𝐶𝑅 = 8, the obtained energy consumption for 40 s is 2.32 J with respect to 2.65 J, obtained without compression, and the 𝑃𝑅𝐷 is 4.61 %. Further work in this area should test the method by using ECG signals from a patient collected by an AFE module. The implementation of an algorithm for the online evaluation of the threshold value, 𝑥𝑡ℎ, by considering patient specific ECG signals should be considered. ACKNOWLEDGEMENT The study has been supported by the PON project ARS01_00860 ‘Ambient-intelligent Tele-monitoring and Telemetry for Incepting & Catering over Human Sustainability’’ – ATTICUS – RNA/COR 576347. REFERENCES [1] E. Balestrieri, L. De Vito, F. Lamonaca, F. Picariello, S. Rapuano, I. Tudosa, Research challenges in measurement for Internet of Things systems, ACTA IMEKO 7(4) (2018) pp. 82-94. [2] P. Daponte, F. Lamonaca, F. Picariello, L. De Vito, G. Mazzilli, I. Tudosa, A survey of measurement applications based on IoT, Proc. of the Workshop on Netrology for Industry 4.0 and IoT, 2018, Brescia, Italy, pp. 1-6. [3] P. Daponte, L. De Vito, G. Mazzilli, S. Rapuano, I. Tudosa, Network design and characterization of a Wireless Active Guardrail System, Proc. of the IEEE Int. Instrumentation and Measurement Technology Conference (I2MTC), 2014, Montevideo, Uruguay, pp. 1047-1052. [4] E. Balestrieri, F. Boldi, A. R. Colavita, L. De Vito, G. Laudato, R. Oliveto, F. Picariello, S. Rivaldi, S. Scalabrino, P. Torchitti, I. Tudosa, The architecture of an innovative smart T-shirt based on the Internet of Medical Things paradigm, Proc. of the IEEE Int. Symposium on Medical Measurements and Applications (MeMeA), 26-28 Jun., 2019, Istanbul, Turkey, pp. 1-6. [5] P. Daponte, L. De Vito, G. Mazzilli, F. Picariello, S. Rapuano, Power consumption analysis of a Wireless Sensor Network for road safety, Proc. of the IEEE Int. Instrumentation and Measurement Technology Conference, 2016, Taipei, pp. 1-6. [6] G. Laudato, G. Rosa, S. Scalabrino, J. Simeone, F. Picariello, I. Tudosa, L. De Vito, F. Boldi, P. Torchitti, R. Ceccarelli, L. Torricelli, A. Lazich, R. Oliveto, MIPHAS: Military performances and health analysis system, Proc. of the 13th Int. Conf. on Health Informatics, 24-26 Feb., 2020, Valletta, Malta. [7] F. Lamonaca, E. Balestrieri, I. Tudosa, F. Picariello, L. D. Carnì, C. Scuro, F. Bonavolontà, V. Spagnuolo, G. Grimaldi, A. Colaprico, An overview on Internet of Medical Things in blood pressure monitoring, Proc. of the IEEE Int. Symposium on Medical Measurements and Applications (MeMeA), 26-28 Jun., 2019, Istanbul, Turkey, pp. 1-6. [8] N. Belgacem, S. Assous, F. Bereksi-Reguig, Bluetooth portable device and Matlab-based GUI for ECG signal acquisition and analisys, in Proc. of Int. Workshop on Systems, Signal Processing and their Applications, WOSSPA, 2011, Tipaza, Algeria, pp. 87- 90. [9] U. Satija, B. Ramkumar, M. Sabarimalai Manikandan, Real-time signal quality-aware ECG telemetry system for IoT-based health care monitoring, IEEE Internet of Things Journal 4(3) (2017) pp. 815-823. [10] I. Tudosa, N. Adochiei, LMS algorithm derivatives used in real- time filtering of ECG signals: A study case on performance evaluation, Proc. of the Int. Conf. and Exposition on Electrical and Power Engineering, 2012, Iasi, Romania, pp. 565-570. [11] I. Tudosa, N. Adochiei, FPGA approach of an adaptive filter for ECG signal processing, Proc. of the Int. Conf. and Exposition on Electrical and Power Engineering, 2012, Iasi, Romania, pp. 571- 576. [12] L. Michaeli, J. Šaliga, P. Dolinský, I. Andráš, Optimization paradigm in the signal recovery after compressive sensing, Measurement Science Review 19(1) (2019) pp. 35-42. [13] P. Dolinský, I. Andráš, J. Šaliga, L. Michaeli, Reconstruction for ECG compressed sensing using a time-normalized PCA Figure 8: Instantaneous power consumption of the Wi-Fi ECG data acquisition system for a time window of 15 𝑠 in the case of no compression, a), and data compression performed for 𝐶𝑅 = {2, 4, 8}, b), c), and d). ACTA IMEKO | www.imeko.org June 2020 | Volume 9 | Number 2 | 45 dictionary, Proc. of the 12th Int. Conf. on Measurement, MEASUREMENT 2019, pp. 30-33. [14] D. Azariadi, V. Tsoutsouras, S. Xydis, D. Soudris, ECG signal analysis and arrhythmia detection on IoT wearable medical devices, Proc. of the 5th Int. Conference on Modern Circuits and Systems Technologies (MOCAST), 2016, Thessaloniki, Greece, pp. 1-4. [15] V. Natarajan, A. Vyas, Power efficient compressive sensing for continuous monitoring of ECG and PPG in a wearable system, Proc. of the 3rd IEEE World Forum on Internet of Things (WF- IoT), 2016, Reston, VA, pp. 336-341. [16] V. Mandić, I. Martinović, Biomedical signals reconstruction under the compressive sensing approach, Proc. of the 7th Mediterranean Conference on Embedded Computing (MECO), 2018, Budva, Montenegro, pp. s1-4. [17] B. Liu, Z. Zhang, Quantized compressive sensing for low-power data compression and wireless telemonitoring, IEEE Sensors Journal 16(23) (2016) pp. 8206-8213. [18] E. Balestrieri, S. Rapuano, Calibration of automated non invasive blood pressure measurement devices, in: Advances in Biomedical Sensing Measurements Instrumentation and Systems, C. S. Mukhopadhyay, A. Lay-Ekuakille, Springer, 2010, ISBN 9783642051661, pp. 281-304. [19] L. De Vito, F. Lamonaca, G. Mazzilli, M. Riccio, D. L. Carnì, P. F. Sciammarella, An IoT-enabled multi-sensor multi-user system for human motion measurements, Proc. of the IEEE Int. Symp. on Medical Measurements and Applications (MeMeA), 2017, Rochester, USA, pp. 210-215. [20] P. Daponte, L. De Vito, G. Mazzilli, S. Rapuano, C. Sementa, Investigating the on-board data processing for IMU-based sensors in motion tracking for rehabilitation, Proc. of IEEE Int. Symp. on Medical Measurement and Applications, May, 2015, Torino, Italy, pp. 645-650. [21] E. Balestrieri, P. Daponte, L. De Vito, F. Picariello, S. Rapuano, I. Tudosa, Experimental assessment of a novel CS-based acquisition method for ECG signals in IoMT, Proc. of the 23rd IMEKO TC4 Int. Symposium, Sept., 2019, Xi’an, China, pp. 1-5. [22] E. Balestrieri, L. De Vito, F. Picariello, I. Tudosa, A novel method for compressed sensing based sampling of ECG signals in medical-IoT era, Proc. of the IEEE Int. Symp. on Medical Meas. and Applications (MeMeA), 2019, Istanbul, Turkey, pp. 1-6. [23] D. Craven, B. McGinley, L. Kilmartin, M. Glavin, E. Jones, Compressed sensing for bioelectric signals: a review, IEEE Journal of Biomedical and Health Informatics 19(2) (2015) pp. 529-540. [24] I. Chiuchisan, H. Costin, O. Geman, Adopting the Internet of Things technologies in health care systems, Proc. of the IEEE International Conference and Exposition on Electrical and Power Engineering (EPE), 2014, Iasi, Romania, pp. 532-535. [25] S. Shebi Ahammed, B. C. Pillai, Design of Wi-Fi based mobile electrocardiogram monitoring system on Concerto platform, Procedia Engineering 64 (2013) pp.65-73. [26] S. Pal, ECG monitoring: present status and future trend, in: Reference Module in Biomedical Sciences Encyclopedia of Biomedical Engineering, Roger Narayan, Elsevier, 2019, ISBN 9780128051443, pp. 363-379. [27] P. Kamble, A. Birajdar, IoT based portable ECG monitoring device for smart healthcare, Proc. of the 5th International Conference on Science Technology Engineering and Mathematics (ICONSTEM), 2019, Chennai, India, pp. 471-474. [28] S. Aparna, S. B. Yashwanth, P. V. Nair, M. Ganesan, K. Akshay, Design of Wi-Fi based ECG system, Proc. of the International Conference on Signal Processing and Communication (ICSPC), 2017, Coimbatore, India, pp. 7-11. [29] J. Zhang, R. Sun, S. Wang, J. Zhang, The design of seven-lead electrocardiograph monitoring system based on Wi-Fi, Proc. of the 11th Int. Congress on Image and Signal Processing, BioMedical Engineering and Informatics (CISP-BMEI), 2018, Beijing, China, pp. 1-5. [30] R. R. Rajanna, S. Natarajan, P. R. Vittal, An IoT Wi-Fi connected sensor for real time heart rate variability monitoring, Proc. of the 3rd Int. Conference on Circuits, Control, Communication and Computing (I4C), 2018, Bangalore, India, pp. 1-4. [31] A. Khalaf, R. Abdoola, Wireless body sensor network and ECG Android application for eHealth, Proc. of the 4th International Conference on Advances in Biomedical Engineering (ICABME), 2017, Beirut, Lebanon, pp. 1-4. [32] M. Pereira, K. K. Nagapriya, A novel IoT based health monitoring system using LPC2129, Proc. of the 2nd IEEE International Conference on Recent Trends in Electronics, Information & Communication Technology (RTEICT), 2017, Bangalore, India, pp. 564-568. [33] A. Moein, M. Pouladian, WIH-based IEEE 802.11 ECG monitoring implementation, Proc. of the 29th Annual International Conference of the IEEE Engineering in Medicine and Biology Society, Lyon, France, 2007, pp. 3677-3680. [34] F. Bamarouf, C. Crandell, S. Tsuyuki, J. Sanchez, Y. Lu, Cloud- based real-time heart monitoring and ECG signal processing, Proc. of 2016 IEEE SENSORS, 2016, Orlando, FL, pp. 1-3. [35] K. Cai, X. Liang, Development of WI-FI based telecardiology monitoring system, Proc. of the 2nd International Workshop on Intelligent Systems and Applications, 2010, Wuhan, China, pp. 1- 4. [36] CC3200MOD, SimpleLink™ Wi-Fi® and Internet-of-Things Module Solution, a Single-Chip Wireless MCU. [Online]. Available: www.ti.com/product/CC3200MOD [37] SimpleLink™ Wi-Fi® CC3200 Module LaunchPad. [Online]. Available: www.ti.com/tool/TIDC-CC3200MODLAUNCHXL http://www.ti.com/tool/TIDC-CC3200MODLAUNCHXL