eu MATHEMATICAL MORPHOLOGY APPLIED IN RECOGNITION OF HEART SIGNS

The paper proposes an improved, efficient and low-power approach of processing in the digital filtering using mathematical morphology multistage mode for the detection of QRS complex in the ECG signal.


Introduction
The use of programmable digital systems with the aim of analyzing the signals and set standards are increasingly evolving in biomedical signal processing.
Based on this reasoning one sees that the cardiac signals first observed by Willem Einthoven in 1902 after spending over a hundred years, continue developing both equipment as a way to interpret.There were also new applications, increasing the importance of the electrocardiogram as a test.
The cardiac electrical pulses, in turn, can be observed a few points on the body of the ECG waveform, in a wave packet composed of five basic wave denoted by P, Q, R, S and T. Based on this wave packet, the ECG is divided into three phases, PQ, QRS and ST whose analysis is an precise and efficient tool to assess heart diseases, however can be damaged by noises such as muscle contraction, power source equipment and respiration.Other problems are relevant to the equipment: size, power consumption, and computing resources.Thus, researchs have been carried out to ensure a robust and accurate way of the method of detection of QRS complex, which is still a problem and corresponds to the depolarization of the ventricles.Since in recent years a method for removing noise originating from mathematical morphology in a single scale (1M) was suggested by Yang [1] proposed a image filtering based on a multiscale model of morphology mathematical (3M), obtaining a better performance and making promise for the detection of the QRS complex.
The choice of mathematical morphology is singularized by not requiring anticipated knowledge of the frequency spectrum of the signal investigated.This feature has the benefit of avoiding the overlapping band of frequencies QRS, low computational complexity and easy implementation in hardware [2].
However, although good results were reported by Yang indicating the 3M method to be very promising in the detection of the QRS complex, it was found that the majority of detected R peaks have a significant change in position.In other words, the 3M method existing is unable to guarantee accurate positioning of the peaks of R [3].In this work, an improved approach is proposed to achieving the adequated position.

Materials and Methods
Theory of multiscale filtering of Mathematical Morphology The mathematical morphology early was used only for binary images and then to gray level images.Is of great importance for quantitative image analysis and is characterized by non-linear processing of images centered on the geometric structure of the information signal, making it an excellent method for detecting the components of interest from the contaminated signal without need to have a anticipated knowledge of the frequency spectrum, operating in signal with dual objectives: remove noise and extract useful signal [4].
The ECG signal in turn is processed similarly to an image in grayscale mode.For this reason it is able to use mathematical morphology effectively in locating components from the noisy signal without prior knowledge of the frequency spectrum being a very important factor in reducing noise.
The 3M morphology is an extension and has the same properties of operators of the 1M type: dilation, erosion, opening, closing, top-hat and bottom-hat.As the scale of the image ECG is similar to grayscale image can be established that the signal of function are analyzed according to the following properties: Erosion.
Here "i" is the i-esimal element in the structure of length M. Since the shape and length of the element in structur determines the information of interest of signal.In the 3M morphology, J scale structural element is defined as: where j = 1, 2, 3..., J, and operators can be any one of those of (1) to (6).
Block Diagram.To facilitate understanding of the established process follows the QRS detection scheme.The 3M filtering plays the most important role in the proposed algorithm, which removes noise in ECG signal.Subsequently performs a differential operation, followed by the convolution and modulation to further increase the signal that leads to the detection of QRS aiming to ensure precision.In the following subsections are presented the discussions of each component in figure.

Filtering differentiation Convolution Modulation
Thresholing, Detection First 3M Filtering It is well known that image processing with multiscale form of opening and closing operations outperforms the multiscale dilation and erosion on the filtering due to its spatial independence.
The combination of opening and closing operations provide a formal and simple mathematically method to extract the peak or trough [5] due to the opening of a data sequence which can be interpreted as a sliding structuring element over data the lower sequence and the result is the highest point reached by any part of the structuring element.Similarly, the closing of a data sequence can be interpreted as a turn sliding version of structural element along the data sequence from above, and the result is to obtain the lowest point reached by any part of the structuring element.In most applications the use of the aperture is in order to suppress peaks are used as closures for suppressing valleys [6].
The top-hat operator aims to produce an output consisting of the signal peaks.Likewise, the operator bottom-hat extracts the valleys (negative peaks).The weighted sum of the top-hat and bottom-hat operations form an extractor peak-valley which is represented by the formula below: Here the coefficients of weighting are: The coefficients are chosen to be a geometric series, in order to minimize the influence of noise.To improve performance, a multi-scale combination of opening and closing is introduced into a 3M filter, which is expressed as: where J is equal to 3 and the structural elements of (n) are defined as , where g1 = 1, 1, 1, g2 = 0.2, 0.6, 1, 1.2, 1, 0.6, 0.2 and g3 = 00.2,0.4, 0.6, 0.8, 1.0, 1.2, 1.0, 0.8, 0.6, 0.4, 0.2.The values of g1, g2 and g3 are determined empirically and may be estimated by experiments, see [6].
Thus the combination of different elements and multi-scale operators, 3M was set for filtration of the ECG signal, whose formula is given by: With the objective to make cuts in the signal, reducing the peaks and fill valleys, combinations of opening and closing operations are performed.These operations, in turn, should be short structure to eliminate noise effectively and not generate a deterioration of the information necessary to detect the QRS complex.
Another important factor adoption of mathematical morphology is related to the reduced energy consumption due to its formulation does not require any multiplier, only registers, comparators and adders.For this reason in portable equipment are best suited to the wavelet filtering method with whose multiplication algorithm presents.Thus causing a reduction in the cost of the hardware, compared with the wavelet, see [2].
Another feature relates to the similarity of the 3M formula with FIR filter.However, there are two differences: the delay elements in the FIR are replaced by operators of opening or closing; there is an closure operation additional multiscale.On the other hand there is the possibility of the FIR filter to be modified to act as 3M modifying the delay elements, in the operators of opening or closing.One possibility to get the 3M filter is illustrated in the figure below.
Second Filtering (Differentiation) -Soon after filtering 3M, with output signal x (n) is realized a differential operation, whose objective is to remove Figure 1: Figure 1: 3M filter, modified of [2] noise and establish a baseline.The characteristic equation is: where "n" is the sample and belongs to the defined interval: 0 ≤ a ≤ 0.99.
Convolution and Modulation -The output of the second filtering is extremely and for this reason a convolution and modulation with the goal of increasing the information is held.Is mathematically expressed as: Peak detection -The detection of the peak is obtained based on comparison with a threshold, which is used as a decision function in conjunction with the proposed location of the QRS.When s(n) is compared with a pre-determined threshold, it is easy to determine the region where a peak is located.For the signal produced, it is stipulated that the required adaptive threshold, having a function of the maximum of the transform of the waveform in the ECG, which were defined as 0.27 x MAX, where MAX is the highest peak of s(n).If the value of s(n) has become greater than the threshold, the corresponding final hold signal for detecting peak, denoted as final (n) being the same value s(n), otherwise sets the corresponding final (n) to zero.Once the end (n) is decided, R peaks can be easily searched.This method of peak detection is used in most QRS detectors, and for this reason applied in the work.

Results
The following graphs below represent part of the result obtained in each step, as was done an extensive amount of testing.

Discussion
Based on the results noted that the method presented, after several tests, and ECG signals acquired even with a variety of noise applications, showed a correct detection of the QRS complex.Compared with other works that address the application of mathematical morphology, it is observed that the detection accuracy is improved and as a suggestion for future work is proposed to obtain a logical and efficient sequence of structuring elements to be used in 3M filtering.

Conclusion
It was observed that the algorithm presented and analyzed can handle a large amount of impulse noise, showing the improved adress in the processing stages capable of showing a more accurate detection with less movement.Demonstrated to be a promising and characterize a new approach to the processing of of the QRS complex.

Figure 9 :
Figure 9: Expansion of a QRS wave of Figure 7