# A Low-Power ECG Processor ASIC Based on an Artificial Neural Network for Arrhythmia Detection
## 3 System Modules  
### Pre-Processing Engine  
The application scenario of this design is that the ECG is collected using single lead ECG sensors (Xunda Radio Equipment, Hangzhou, Zhejiang, China) at a sampling frequency of 360 Hz and quantified as signed values with a bit-width of 16. The raw digitized ECG signals are first filtered using a 69-tap Finite Impulse Response (FIR) filter in the pre-processing engine to remove noise, such as power-line interference, baseline drift, electromyographic (EMG) noise, and motion artifacts [13]. Considering the frequency range of the QRS complex, the bandwidth is set to 2-28 Hz. The schematic of the FIR filter is shown in Figure 2. A 16-bit \(\times\) 128 SRAM (Static Random-Access Memory) (UMC, Hsinchu, Taiwan, China) is used to cache the ECG data within a filtering convolution window. When new data arrive, the earliest data within the window are discarded to accommodate the latest data. The symmetry of the FIR coefficients is utilized here, and only half of the coefficients need to be stored. A counter is used to generate read addresses for SRAM and registers to obtain data. Due to the low sampling frequency, only a few hundred filtering operations are required per second. Thus, the time division multiplexing strategy is adopted, using only one multiplier accumulator (MAC) unit to complete all multiplication and addition  
Figure 1: The system architecture of the ECG processor. operations, which greatly reduces the hardware overhead compared to filter structures based on a delay chain. The entire convolutional filtering operation takes N clock cycles (N is the number of taps). The filtered data are then fed to the R-peak detector; the detection process is shown in Figure 3. First, the first derivative of the filtered ECG data X(i) is calculated as (2), and then the average value within a moving window is obtained as (3), where the window size W is 30. \[\text{D(i)}=\text{X(i)}-\text{X(i}-1), \tag{2}\]  
\[\text{A(i)}=\frac{\sum_{\text{i}-\text{W}+1}^{\text{i}}\text{X(i)}}{\text{W}}, \text{(i}\geq\text{W)}, \tag{3}\]  
If D(i) > THR_D and X(i) > A(i), then p_cnt is increased by 1. THR_D represents the threshold of the first derivative values, which is set to five in this paper. When the above judgment conditions are met twice, the current data point X(i) is considered as an R-peak point, the R-peak detection flag is set to high, and the R-peak value is equal to X(i). In order to eliminate the interference of false peaks near the R-peaks, a non-response period (nresp_period) of 0.2 s is applied here, which is equal to the time of 60 sampling points. The nresp_cnt signal is used for counting the non-response time. When it is equal to 0, it  
Figure 3: The process of R-peak detection. Figure 2: The schematic of the Finite Impulse Response (FIR) filter. indicates the end of the non-response period, and then the next R-peak will continue to be detected. The performance of the proposed R-peak detection method is evaluated using all 48 records in the MIT-BIH arrhythmia database [14], the true positives (TP), false positives (FP), and false negatives (FN) of each record are obtained, and the sensitivity (Sen) and positive precision rate (P+) are calculated as follows:  
\[\text{Sen}=\text{TP}/(\text{TP}+\text{FN}), \tag{4}\]  
\[\text{P+}=\text{TP}/(\text{TP}+\text{FP}), \tag{5}\]  
The records with the worst Sen are 114 and 207, while the rest are greater than 97%, and the record with the worst P+ is 114, while the other records are greater than 90%. Figure 4 shows the evaluation results of part of the records. The total Sen and P+ of all records are 98.62% and 98.74%, respectively. We compared the performance of the proposed method with other R-peak detection methods used for hardware, as shown in Table 1. It is observed from the table that our proposed method realizes comparable Sen and P+ to those of recent works, achieving a good compromise between the hardware cost and performance.