ANTI-JAMMING ALGORITHM FOR DETECTION OF QRS AND ST SEGMENTS ON ELECTROCARDIOGRAM

. As it was earlier described, capacitive electrodes could be widely used in electrocardiography, especially, in the state-of-the-art personal devices as they employ major advantages of these sensors. But such a way of electrocardiogram measurement usually generates quite noisy and unstable signals, which respectively must be processed with some anti-jamming algorithm. At the same time algorithm developers must take into account low computing power of portable personal devices, so designed methods must be “light” and “fast”. Such an algorithm is developed by authors and is further described in this paper.


Introduction
In the publications presented by the authors earlier [1], they published the results of performance tests for the capacitive electrocardiographic electrodes from "Plessey Semiconductors" as applied to portable systems.The study showed that the capacitive electrodes are appropriate for use in those areas where the need for speed and convenience of measurement prevail over the requirements to the signal / noise ratio (SNR) and measurement stability and requires repeated application.Personal electrocardiogram (ECG)  devices are one of the best applications as their popularity keeps growing all over the world.In this case, the received signals are often more noisy than those from the standard devices, and portable implementation imposes restrictions on the analog and digital processing methods.Resulting it requires to develop an anti-jamming algorithm for analysis of ECG with low computational complexity.The following is a description of the algorithm developed by the authors and testing results.The algorithm for detection of QRS and ST segments is chosen for implementation as the most important for further processing.

Main part
Here and following the standard ECG analysis algorithms are used as a base in the development [2][3][4][5][6][7][8][9][10][11][12][13][14][15][16].Algorithms are combined together and some original solutions are added.The algorithm consists of a block chain, which process input signals, convert and transform it for further calculations.The input data processing block is a bandpass filter derived from Pan -Tompkins algorithm [2][3][4][5].The filter was simulated if MATLAB software for testing and optimization of its parameters, as it shown on Figure 1.The filter order and bandwidth is matched experimentally.As most efficient from point of highest QRS amplitude and smallest transition time, the 6th order FIR filter with 5 Hz and 15 Hz cutoff frequencies is used for QRS complex selection.Table 1 shows the coefficient values for optimized digital filter.The designed filter allocates bandwidth comprising a QRS complex, while efficiently suppressing other frequency ranges and does not introduce additional distortion.The filter operation results without and with input noise is shown on Figure 2. Input filter operating by the algorithm of Pan -Tompkins efficiently allocates QRS complex in the absence and in the presence of large noise, which in turn provides a high reliability extraction algorithm peaks.
The next stage is a function of non-linear transformation which is intended to allocate QRS complex signal.For this purpose there are two well-known functions.
The first one -is the derivative operator from Pan -Tompkins algorithm with equation (1).
This transformation efficiently allocates QRS complex, but the output signal is too complex for further analysis without additional processing.Figure 3 shows the results without input noise (Figure 3, a) and with its presence (Figure 3, b).In this case, it is seen that the presence of noise has no significant effect on the output, which means good noise immunity.The disadvantage of method is that for using of a threshold detector, the received signal must be smoothed.Smooth function in this case must have a large order, which leads to a large signal delay and becomes impractical.An alternative function that can be applied to detect the QRS complex is the equation of Murthy and Rangaraj published in [2] with the equation (2).
Operation results of function ( 2

IME T &
The given Figures clearly shows that the equation ( 2) allows to obtain smooth peak, which is good shaped for further analysis with threshold detector and low-order smooth pre-processing function, if necessary.However, it is worth noting that this method isn't resistant to interference, which can be seen on Figure 4, b: the presence of a small noise makes it impossible observe any QRS peaks.
For obtaining of easy for recognition output peaks features combined with good antijamming performance, it was decided to combine the functions (1) and ( 2).The result is formula (3).Combining the two functions has allowed compensating disadvantages of each and getting the optimal solution, providing a stable discharge peaks and noise immunity.
The results of function (3) operation are shown on Figure 5.For obtaining smooth, well recognizable peaks on the next stage, an integrating filter is used.Filter output is shown in Figure 6.After the all transformations the received signal may be analyzed by using a threshold detector, which in turn does not require much computational resources.It should be noted that the QRS complex detection algorithm is robust to noise and is highly reliable.Also on the basis of the given transformation, the separate algorithm is built to detect sinus heart rhythm.It detects episodes of rhythm disorders as the moments of sudden RR interval change.Finally it provides the sequence of RR intervals against the time as it shown on Figure 7.
After all the tests the algorithm showed the following results: -sensitivity -95%; -specificity -92%.Moreover, other analysis methods such as ST depression / elevation detectors are based on the given results.ST segment position is calculated relative to the position of the QRS complex. Figure 8 shows the results of such a ST-segment detector, red markers pick the segments positions.

Conclusion
The combination of two existing methods for QRS complex detection (Pan-Tompkins and Murthy-Rangaraj algorithms) provides the new method with much more stable operation in noisy conditions as well as smooth shaped and obtainable output peaks for further analysis.
The result is a low-order difference function having the low computational complexity and, which is quite important for user-friendly devices, a minimum delay of the output.The function provides clear peaks that can be easily processed further threshold detector.These results are used to design special personal equipment based on the capacitive sensors.

Figure 2 .
The outputs of input (stage 1) filter: a) without input noise; b) in presence of noise.

Figure 3 .
The outputs of peak (stage 2) filter with Pan -Tompkins algorithm: a) without noise; b) in presence of noise.

) are shown on Figure 4 Figure 4 .
The outputs of peak (stage 2) filter with Murthy and Rangaraj algorithm: a) without noise; b) in presence of noise.

Figure 5 .
The outputs of peak (stage 2) filter with authors' algorithm: a) without noise; b) in presence of noise.

Figure 6 .
The outputs of smooth (stage 3) filter: a) without noise; b) in presence of noise.

Figure 7 .
Figure 7.The output of the algorithm for rhythm disorders detection.

Figure 8 .
Figure 8.The result of the algorithm for the detection of ST segment.

Table 1 .
The coefficients of input FIR filter.