## 5 Raspberry Pi-Based Implementation of the Suggested Algorithm
### Parallel Computing of the Feature Vector Extraction and Encryption  
Parallel computing is a very efficient solution to accelerate the computation time of algorithms in different areas. A thorough evaluation of our scheme showed that the feature vector extraction and encryption and the QR code encryption steps can be parallelized. Figure 12 shows the difference between sequential and parallel feature vector computation using multi-core processors.  
In the sequential computation on a multi-core CPU (Figure 12a), we could observe that all instructions were executed on a single processor and that only one instruction was executed at a given instant. This implementation type limits the full exploitation of the available computing resources on multi-core CPUs. To solve this limitation, parallel computing can be exploited (Figure 12b). This type of computation requires initially splitting the computational problem into different parts that can be computed in parallel, and then the instructions of the individual parts are executed simultaneously (in parallel) on the available multi-processors. Consequently, the runtime can be improved by a factor  
Figure 11: Percentage corresponding to the execution time of the proposed scheme’s steps.  
Figure 12: Feature vectors extraction using (**a**) the sequential approach, and (**b**) the parallel one.  
of up to \(\chi\) compared to the sequential calculation of the same problem, where \(\chi\) factor is defined as follows [46]:  
\[\chi=\frac{T_{1}}{T_{N}} \tag{24}\]  
where \(T_{1}\) is the sequential execution time of a given problem and \(T_{N}\) is the execution time when \(N\) parallel computations are performed to solve the same problem.  
We use the Message Passing Interface (MPI) Python module [47] to implement the proposed parallel computing, which enables Python software to run on multi-core CPUs.  
To test the performance of parallel computing in the feature vector extraction and encryption task, we used four frames of the ECG signal shown in Figure 6 for different lengths (L = 256, L = 1024, L = 4096, and L = 8100). Then, the extraction and the encryption of the four feature vectors were performed by the conventional method using serial computing and by using the proposed parallel commuting method. We used a PC equipped with 4 GB of RAM and 2.4 GHz quad-core CPU to conduct the present test. Python 3.7 was used as a programming language to implement the feature vector extraction and encryption algorithm. Each method was executed 100 times, and the average execution time of both methods is shown in Figure 12.  
To compare the extraction time of the four feature vectors using the proposed method with that of the conventional one, the following execution time improvement ratio (ETIR (%)) criteria were used:  
\[ETIR(\%)=\left(1-\frac{\tau_{p}}{\tau_{s}}\right)\times 100 \tag{25}\]  
where \(\tau_{p}\) represents the time consumed by using the parallel computation method on the PC quad-cores and \(\tau_{s}\) corresponds to the time consumed when using the sequential method.  
The results presented in Table 2 clearly show that the parallel computing method improved the execution time by more than 72% compared to the conventional method for different feature vector lengths. This result encouraged us to implement our scheme on low-cost multi-core CPUs such as Raspberry Pi. This hardware can meet the requirements of ease of implementation since it supports Python language programming and offers advantages of low power consumption and portability.