**2. Biometric System Architecture**

The ECG identification process typically consists of three main stages: data acquisition, data processing (filtering, normalization, and feature extraction) and pattern matching (classification) [4,7,8,12,13].

Data acquisition requires an analogue front-end (a two- or three-electrode measurement circuit based typically on instrumental amplifiers) followed by ADC. The digitized data are then being streamed to MCU/PC.

For the ECG measurement, we decided to choose a third-party e-Health Sensor Platform V2.0 which is based on ATmega328P. The data acquisition was performed using a differential OpAmp schema followed by an 8-bit ADC operating at a 277 Hz sampling rate [14].

The data processing includes filtering (low-pass to remove offsets and respiration, high-pass to remove noise and 50 Hz coupling, movement artifacts), heartbeats segmentation and normalization. To split the ECG waveform into separate heartbeats, it was necessary to detect the R peaks. There are multiple algorithms that have been developed for this specific purpose, but in our case a third-party implementation of the Hamilton algorithm was chosen, being available in the bioscipy library. After segmentation, each heartbeat was normalized to a range of [−1; 1]. Afterwards, the data points on the ends of each heartbeat were omitted, so only the points within the central part (around 60% of the entire heartbeat) were further used in the identification process.

Another important transformation at the data processing stage is the outlier correction. It is expected that the ECG signal is of a regular nature and that the beats tend to be similar to one another. However, for some of the beats, some strong deviations were observed. There might be different kinds of reasons for this to happen, e.g., muscle noise, respiration, non-stable contact impedance, electrodes displacement, etc. In order to detect and correct those corrupted segments (outliers), a special algorithm, proposed in [15], was applied.

The data processing is followed by the classification stage. The classification model should recognize some user-specific patterns in the processed ECG signal and perform a matching with one of the corresponding classes (users). This is the last step of the identification process.

The entire ECG-based identification process is presented in Figure 1. The ECG signal waveforms appearing at different transformation stages are presented in Figures 2 and 3.

**Figure 2.** (**a**) Raw ECG signal and (**b**) ECG signal after filtering and normalization with the detected R peaks.

**Figure 3.** ECG segments (heart beats) aligned to the R peak (**a**) before and (**b**) after the outlier correction.
