Abdul-Jabbar: Genetic-Based IIR Filter Design for Efficient QRS Complex Detection-- 172 Genetic-Based IIR Filter Design for Efficient QRS Complex Detection using Neuro -Based Classifier

In this paper, a new method is proposed for QRS complex detection using a special kind of IIR filter called bi-reciprocal lattice wave digital filter (WDF). This filter has some attractive features that make it more efficient than other types of filters. One of these features is its sufficient linear phase in the passband, thus yielding a perfect reconstraction condition. Therefore, it is not required to cascade the designed filter with an all-pass filter for correcting the phase distortion. The coefficients of the designed filter are achieved by simulating the FIR response suggested in [1]. A least square method solution is used in such simulation with a genetic-based algorithm. A simplified structure for the designed filter is accomplished with less-complex realization. 50 records of European ST – T ECG database is classified into four classes (Normal, Left Bundle Branch Block (LBBB), ST segment elevation, and Left Ventricular Hypertrophy (LVH)). By applying the designed filter coefficients into neural network classifier, the results show that the accuracy of the classification process is 95.9 %.


Introduction
ECG signal is usually used to check the electrical activity of the heart through number of leads lies on the skin of the body. The normal ECG shown in Fig. 1 consists of a P wave, a QRS complex, and a T wave. The QRS complex is often, but not always, includes three separate waves: the Q wave, the R wave, and the S wave [1], [2]. P wave is generated by electrical potentials appearance when the atria depolarizes before atrial contraction begins. The QRS complex is a result of potentials generated when the ventricles depolarize before contraction, i.e., when the depolarization wave spreads through the ventricles. Therefore, both the P wave and the components of the QRS complex are depolarization waves. In addition, when the ventricles recover from the state of depolarization, the T wave appears. This process normally occurs in ventricular muscle within 0.25 to 0.35 second after depolarization, and the T wave is known as a repolarization wave. Thus, ECG is composed of both depolarization and repolarization waves [2]. In this paper, a genetic-based IIR filter design is proposed for efficient QRS complex detection with a neuro-based classifier. It is known that using IIR filters for QRS complex detection has many advantages such as low filter order which reflects a simple filter structure, excellent roll-off frequency characteristics for low orders, and efficient implementation on FPGA chips.
In addition to this introductory section, there are other six sections in this paper. Section 2 presents a related literature review. The bi-reciprocal lattice WDF design procedure is described in section 3. Section 4 explains the ECG data used in this paper with the standard normalization application on filter coefficients. Section 5 illustrates the trained neural network to work as an ECG classifier. In section 6, the designed system is executed using Matlab simulation. Finally, section 7 concludes this paper.

Literature Review
QRS complex detection researchers have been continued their development in the past decade due to their vital importance in the automated ECG analysis. Many of those researchers used FIR filters, filter banks or wavelet filtering to extract the features of the QRS complex. Among many methods of ECG signal classification, researchers recently prefer to utilize fuzzy classifiers [1], [3], neural network classifiers [4], [5] or even some extreme learning machine [6]. Other researchers presented hybrid systems used as a diagnostic classifier for the ECG signals; such as a neuro-fuzzy network [7], [8] and a combined method of particle swarm with neural network [9].
In 2011, A. Pantelopoulos and N. Bourbakis [10], used wavelet with a 3 layer artificial neural network to classify 46 MIT -BIH ECG database into 5 classes with accuracy 94.9 %. Also in 2011, B. Abibullaev and H. Don [4], presented a method for QRS complex detection and ECG classification by the use of continuous wavelets and artificial neural networks. The resulting average accuracy is in the order of is 97.2% but the tests were only conducted for two categories of QRS complex classification (normal and abnormal). I. Saini et al. [11], used in 2012 a K-Nearest Neighbor algorithm as classifier for QRS complex detection in ECG signals. A CSE and MIT-BIH arrhythmia database was used to test this classifier. The results show that the QRS complex detection accuracy rate is 99.81%. It should be noted that the accuracy of this algorithm is largely dependent on the value of K and the type of distance metric. In 2013, S. Khoshnoud, and H. Ebrahimnezhad [12], proposed an algorithm consists of preprocessing block for noise elimination, multi-resolution wavelet for R-peak detection, and probabilistic neural network to classify four kinds of MIT-BIH ECG database. The results show that the accuracy is 92.9% and the sensitivity is 93.17%.
In 2014, J. M. Abdul-Jabbar and R. W. Hamad [1], designed an FIR filter bank with a fuzzy classifier to classify the ECG data into five classes with efficient classification rate. However, in that design, a small trained data is used. In 2015, a neuro-fuzzy classification method is used for identifications of ECG signals [8]. A feature extraction method with a QRS like filter is utilized. Five standard parameters (energy, mean value, standard deviation, maximum and minimum) are extracted from these disease features and then used as inputs to the neuro-fuzzy classification system. Again in 2015, K. Muthuvel and L. P. Suresh [13], developed a technique to classify ECG signal using Haar wavelet for features extraction and neural network classifier. An Artificial Bee Colony (ABC) combined with genetic algorithm (GA) was used to train the neural network. The accuracy of that technique was 93%, sensitivity was 90 % and specificity was 89% for the cross over rate of 0.8.
In this paper, the proposed classification system is composed of an IIR filter with approximate linear phase (perfect reconstruction) for QRS-complex detection, a standard normalization function to normalize the values of the filter coefficients, and a neural network to classify the data into four classes.

Filter Design Procedure
It is possible to obtain a bi-reciprocal lattice WDF with approximate linear phase by letting one of the branches (z ) consist of pure delay ( ( ) ). As shown in Fig. 2, the other branch ( ), of even order 2N, is a general all-pass function in [14].
From Fig. 2, the transfer function of a linear phase low pass bi-reciprocal lattice WDF is where R is the number of attenuation zeros. The frequency response of such filter is given by where ( ) is the magnitude response of ( ). In the pass-band, the phase response of ( ) branch (2 ) must approximate the linear phase response of the other branch (−(2 + 1) ) [15]; that is: (2 ) = −(2 + 1) (4) In this work, the order (N) of ( ) is chosen to be 4. Two 2 nd order identical all-pass filter sections are cascaded to minimize the number of multipliers (see Fig. 3). The order of delayer ( ) is 3, therefore, R = 1. The transfer function of the designed filter described in Fig. 3 is where and are all-pass filter coefficients.
The coefficients , , are determined by simulating the following transfer function of the FIR filter in [1]. ( Equation (9) requires an optimization algorithm to minimize . This is accomplished by the determination of the coefficients , that give minimum . Genetic algorithm (GA) is used for that purpose. Using Matlab software, the proposed flowchart of Fig. 4 is used to minimize in equation (9), and to determine the transfer function of the bi-reciprocal lattice WDF.
In Fig. 4, the number of variables of the fitness function is selected to be 2 (only the filter coefficients and as shown in equation (9)). Other options in the GA solver remain at their default cases. The optimization process is terminated after 51 iterations because the average change in the fitness value (FVC ) becomes less than options TolFun with an accepted value and the results are as follows: = 0.08866 , = 0.45 and = 4.212.

Al-Rafidain
From Fig. 5, it can be seen that the phase response of the designed filter is almost linear. Fig. 6 illustrates the phase difference (∆ɸ ) between the designed phase response and the exact linear phase response in the pass-band region (till the cutoff frequency = rad.). Error in phase of the designed filter is shown in Fig. 7 with maximum phase difference of , ∆ɸ , = 0.6198 rad. and an average value of ∆ɸ , =0.1711 rad. Polyphase structure is an efficient way to obtain a simplified filter structure for QRScomplex detection by splitting the input signal into odd and even samples (i.e., decimating the input samples by two) and reducing the order of each of the two filter branches ( and as shown in Fig. 8) to half of its original value. This reduction can be achieved without any effect on the phase response [16]. Therefore, equation (11) can be reduced after down sampling to the following equation: The number of samples of the output of the filter in Fig. 8 ( ( )) is half of its corresponding number at the input ( ( )). Recall that the algorithm of Pan and Tompkins [17], [18] used a differentiator as a step to pick the high frequencies out (i. e., to clarify information about the QRS complex slope). An identical digitized analogy will be used in the proposed system. So, to make the response of the filter structure shown in Fig. 8 similar to QRS-complex shape of ECG signal, two differentiation stages are required; one at each branch [1], [8]. Since all components in Fig. 8 are digital, therefore, two difference stages are used instead of differentiators.

ECG Database and Standard Normalization method
For the sake of training, 50 (1300 sample and 2-leads) recordings of European ST -T ECG database, sampled at 250 Hz, are selected from PhysioBank database [19] to be classified into four classes: Normal, LBBB, ST. segment elevation, and LVH. These ECG signals will pass through the designed filter to extract their QRS-complex coefficients. These coefficients contain +ve and -ve values, therefore, standard normalization is used to fit their values into the range of (0-1). Data normalization is important because it reduces the number of epochs considerably if there are outlier input vectors inserted to neural network classifier. Standard normalization equation used in this work is Fig. 9 shows the signal ( ) before and after standard normalization.

Neural Network Classifier
After ECG data is filtered and QRS-complex coefficients are normalized, the last stage of the classification process will utilize a neural network as a classifier. Creating, training, and simulating of the neural network are achieved by using Neural Network Toolbox in Matlab which includes nprtool command line function which is applied to open neural network pattern-recognition GUI using a two-layer (hidden layer and output layer) feedforward network with tan-sigmoid output neurons. Fig. 10 illustrates the trained neural network to classify the prescribed ECG data in this paper.

Matlab Simulation Results of The Overall Designed System
Using Matlab simulation, the overall designed system of Fig. 11 is simulated and the output is one of four pre-mentioned ECG data classes. Fig. 11 The designed system on Matlab software.
To briefly explain the operation of Fig. 11, it is divided into three stages: 1) Stage 1 (Modified structure of the designed bi-reciprocal lattice WDF): Each of the used ECG signals which contain 1300 samples will be applied to the designed IIR filter to detect its QRS-complexes. As shown in Fig. 11, the components of stage 1 are: A down sampler to alter the sampling rate and to divide the order of the all-pass filters and the delay by 2 [16], [20]. This makes the design more simpler. In equation (12), it can be seen that after using down-sampling the orders of all-pass sections became 1, and is now i.e., two registers are needed for that branch without taking the difference step into consideration (see Fig. 11). A forward difference unit is to achieve a band-pass filter response similar to the QRS complex shape as in [1]. Other components are the same components of bi-reciprocal lattice WDF (see Fig. 3). 2) Stage 2, which includes a delayer to delay the sample by 650 (half of 1300 because the first stage includes a down sampler) and to make all output coefficients be available at the input of the standard normalization step. The average accuracy of the classification process turns to be 95.9% as shown in Table I.
The accuracy values in Table I is defined based on the following equation:  By Matlab simulation of Fig. 11, the shape of the input wave (the record e0103 which is one of the used 50 records of the European ST -T ECG database) is shown in the Fig. 12, while the corresponding QRS-complex wave is shown in Fig. 13. . Fig. 13 Coefficients of QRS-complexes of record e0103.

Conclusions
In this paper, an ECG detection system which is composed of a bi-reciprocal lattice WDF, a standard normalization function, and a neural network classifier has been proposed. The designed filter has been able to detect QRS complex from different ECG signals with acceptable frequency response (approximately linear phase response and sharped roll-off magnitude response). That has reduced the noise in the QRS-complexes detection. Only two multiplier values have been used to implement the transfer function of the IIR filter. This may reflect the simplicity of the designed filter. Therefore, it can easily be implemented on an FPGA kit. Neural network classifier with two layers and 4 neurons in each, has been suggested. A resulting classification accuracy of 95.9% has been achieved. It is expected that the accuracy can be increased if more ECG data is used for training and testing the classifier. After that introducing more kinds of ECG arrhythmia can also be involved.