Analyzing Electrocardiogram Signals utilizing wavelets and the Fourier Transform
Find out moreThe challenge at hand is how effectively an ECG can be analyzed utilizing Wavelets, the Fourier Transform, and various filters. From these various processes, is it possible to denoise, detrend, and filter in order to reveal characteristics such as BPM, arrhythmia, and other various conditions of the heart. From the findings, it appears that these goals are able to be completed.
An typical heart pulse can be generalized as a depolarization of atria, a depolarization of ventricles, and then a repolarization of both. The repolarization of the atria and the depolarization of the ventricles happens in a similar time frame and ventricular depolarization obscures the former.
A heart pulse has distinct timings and amplitudes. A cartoon depiction of a generic signal is shown in Figure 2.
The team saw this opportunity to explore the potential of using DSP tools learned in EECS 351 to analyze ECG signals. Small publications about software ECG processing have been released but nothing detailing complete algorithms have be published. It is increasingly important that ECG processing becomes automated as the Minnesota code has been improved. Right now the technology has not caught up to the capabilities of the code.
The focus of the project is to test the feasibility of various transforms. Rather than attempt to diagnose heart conditions, the team focused on processing ECG signals and employing machine learning to extract components of the signal. Once each individual complex can be removed, characterization can be done.
From previous works and suggestions from Prof. Balzano, wavelets were chosen as our primary tool of analysis. Four wavelets were evaluated: coiflets, haar, mexican hat, and daubechies.
An initial attempt to analyze all 12 signals and compare them to each other was made. Figure X shows a general depiction of each signal. However, the number of combinations shifted the focus more on understanding the physiology of the heart rather than analyzing ECG signals. A focused analysis on signal 1 was done instead after an initial attempt to process all 12 signals.
In the Fourier Transform, the convolved signal are sinusoids of different frequencies. This gives the frequency representation of the original signal.
In the Fourier Transform, the convolved signal are sinusoids of different frequencies. This gives the frequency representation of the original signal. As seen in figure 4, the coefficients are plotted on the y axis, giving the magnitude of correlation and the frequency is plotted on the x axis.
In the Wavelet Transform, the convolved signal, the mother wavelet, is not a set function like the Fourier Transform. This makes the Wavelet Transform a more versatile tool as the mother wavelet can change for each application. There are many different types of wavelets; in this project, coiflets, daubachies, Mexican hat, and haar wavelets are evaluated and each are unique signals.
Another aspect of the wavelet transform is the scaling function. A scaling function will increase the duration of mother wavelet in the time domain and this is controlled by the scale value. Analysis of the wavelet transform can be done via a 2D graph shown in figure 5. The scale is plotted on the y axis, the coefficient magnitude is plotted on the z axis, and time is plotted on the x axis. This is because the transform has good time resolution at small scales which is explained in the next section.
As stated above, the mother wavelet can vary in length in the time domain.
This is useful when one recalls the uncertainty principle of signal processing: the frequency and time of a signal cannot be simultaneously known. In order to gain a better time representation, the frequency is sacrificed and vice versa.
In the Fourier Transform, windowing is used to segment the time domain. In the wavelet domain, a separate scaling function is used to “widen” the mother wavelet. Namely, at higher scales, the duration of the mother wavelet is longer. Therefore there is better frequency representation but worse time representation.
This is useful when selecting for features. In an ECG application, the windowing period of the Fourier transform should be similar to the duration of a heartbeat. In figure 6, the difference between different scales is clear. The scaling factor is plotted on the y-axis. At high scales. Indicated by the red box, the duration of the mother wavelet is long and the underlying sinusoid of the ECG is being extracted. If the big R peak is to be extracted, lower scales, indicated by the blue box, are much better to use.
When even smaller features are to be extracted, such as the QRS complex, even smaller scales need to be used.
To test the feasibility of each wavelet, the goal is to extract the QRS complex from the signal autonomously.
The QRS signal must be the first aspect because it is of the highest frequency. The P and T peaks are also important but are always of lower frequency because of the slower speed of membrane repolarization and atrial constriction. Additionally, the QRS yields the most diagnostic information. The QRS complex corresponds to ventricular polarization which directly correlates to the strength of the heart to pump blood to the rest of the body.
Once the QRS complex is extracted, then the two remaining peaks are the P and T peaks which could be easily extracted another algorithm. Therefore IF the wavelet can extract the QRS complex, that wavelet can be useful in ECG processing.
Return to top