ISSN: 2455-2976
Journal of Cardiovascular Medicine and Cardiology
Mini Review       Open Access      Peer-Reviewed

An Overview of ECG Artifact Detection in EEG Signals

Sema Yildirim*

Selcuk University, Konya, Turkey

*Corresponding author: Sema Yildirim, Selcuk University, Konya, Turkey, E-mail: [email protected]
Received: 30 January, 2025 | Accepted: 12 February, 2025 | Published: 13 February, 2025
Keywords: EEG; ECG; Noise removal; QRS-complex; Brain

Cite this as

Yildirim S. An Overview of ECG Artifact Detection in EEG Signals. J Cardiovasc Med Cardiol. 2025;12(2):017-021. Available from: 10.17352/2455-2976.000222

Copyright License

© 2025 Yildirim S. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

Electroencephalography (EEG) is an important technique for recording brain signals and is particularly used in the diagnosis and treatment of neurological diseases such as epilepsy. However, due to the complex nature of EEG signals, their interpretation is difficult and time-consuming. In EEG recordings, physiological noises such as eye movements (EOG) and electrocardiography (ECG) can affect the signals and hinder accurate diagnosis. This study emphasizes the importance of removing noise from EEG signals, with a focus on the impact of ECG-induced noise. The detection of QRS complexes in the ECG signal plays a critical role in eliminating these noise components from EEG signals. The QRS-complex, a prominent marker of the heart’s electrical activity, helps in removing the corresponding noise components from EEG signals. As a result, removing noise from EEG signals is crucial for accurate diagnosis, and it is believed that future studies in this area could develop more precise methods.

Introduction

EEG is one of the fundamental techniques used for recording brain signals and plays a crucial role in the diagnosis and treatment of neurological disorders, especially epilepsy. However, the analysis of EEG signals is a time-consuming and costly process due to their complex and dynamic nature. Interpreting these signals accurately is challenging, and some signals in the recordings (such as EOG and ECG) can interfere with the EEG signals, preventing accurate detection of brain activity. In this context, the removal of noise from EEG signals is of great importance.

While recording brain signals with EEG, the patient’s ECG signal is also simultaneously recorded. ECG signals have amplitudes ranging from 1 to 5 mV, and these high-amplitude signals can suppress the lower-amplitude EEG signals, which are in the range of 10 - 100 µV. This situation may cause the QRS complex waves of the ECG signal to overlap with the spike waves used in disease detection, even in the absence of epileptiform activity. Therefore, it is necessary to detect the R-peaks in the same time window as the spikes in the EEG signal and remove them from the EEG signal. Since the ECG signal has a regular pattern with QRS complexes, the QRS complex should first be detected, and then filtering methods should be applied to remove it from the EEG signal. In this study, the R-peaks of the ECG signal were detected, and then the Q-S values were calculated using these reference points. Subsequently, instead of applying a filter to the entire EEG signal, a filter was applied only to the EEG signals corresponding to the QRS complexes in the same time window. This way, spikes that do not coincide with the QRS complex and are likely to be epileptiform signals were left unchanged on the EEG signal without filtering. The aim here is to preserve the peaks in the ECG signal that are not considered noise while treating other peaks in the same time window as noise and removing them with filters. Thus, a noise-free EEG signal is obtained, which facilitates disease detection.

Various methods are used for noise removal in EEG signals. Some of these methods are listed below:

  • The regression method is one of the techniques used to remove noise from EEG signals.
  • Normalized Least Mean Square Filtering (NLMS) algorithm and adaptive filters are used to eliminate ECG, EOG, and Electromyography (EMG) noise.
  • Wavelet Transform (WT) provides noise removal based on time-frequency analysis by using narrow window sizes for high frequencies and wide window sizes for low frequencies.
  • Principal Component Analysis (PCA) aims to reduce the dimensionality of the data while preserving variations; however, it may be insufficient in separating noise in some cases.
  • Independent Component Analysis (ICA) is used to remove noise from EEG signals without the need for a reference ECG channel. It offers a more effective source separation by decomposing the linear mixtures of signal sources and noise, making it a powerful method for enhancing EEG signal quality [1-5].

Some of the methods mentioned above focus on noise removal using filters applied to the entire EEG signal. However, in the technique implemented here, only the signals overlapping with the ECG were processed, and no signal was lost in other regions. This ensured that the accuracy of the signal was preserved, providing clearer data for the detection of epileptiform activities. Additionally, the preservation of the natural characteristics of the signal increased the reliability of the analysis and helped prevent erroneous results.

EEG signal

EEG signals are evaluated in terms of frequency and amplitude rather than shape, unlike ECG and EMG signals [6]. While EEG is designed to record cerebral activity in the brain, it may also capture electrical activity from outside the brain. These external and internal electrical disturbances are referred to as “artifacts” and are generally classified into two main categories: physiological (eye movement, muscle activity, ECG, pulse, etc.) and extra-physiological (power line noise, electrode noise, external device noise, etc.) [7]. These noises mixed with EEG signals can be removed using simple filtering techniques when their frequencies are inconsistent with the frequencies of the desired signals [8]. However, the removal of physiological noise, in particular, is a process that requires specialized algorithms [9].

ECG signal and noise removal

ECG is a technique used to record the electrical activity of the myocardium during a heart cycle. The ECG signal is characterized by a series consisting of P, QRS, and T waves (Figure 1) [10]. The QRS-complex or R-wave in the ECG can be detected by the sensitive electrodes of EEG as a high-energy activity, which can contaminate the EEG signal in the corresponding EEG channel [11]. The P and T waves present in the ECG signal are not observed in the EEG signals due to the distance from the heart and the suboptimal axis. Therefore, it is not necessary to detect the P and T waves in ECG noise removal. It is simpler to remove ECG noise using only the reference waveform, the QRS-complex [12].

Characteristics of ECG Artifacts:

  • The noise can appear in all channels using a common reference or only in a few EEG channels.
  • The increased distance between the electrodes increases the susceptibility to ECG noise.
  • Small cardiac-originated noises are generally attributed to the R-wave of the ECG. Larger waves may reflect other components of the ECG.
  • As the patient breathes in and out, the position of the heart relative to the head changes, which can cause variations in the amplitude and frequency distribution of the ECG noise.

It is possible to detect QRS complexes via the R-wave. The R-peak-detect.m file is an open-source MATLAB function used for detecting R waves in ECG signals. This function is widely used in the fields of biomedical engineering and signal processing, particularly for heart rate analysis and detection. The pseudocode for the function is provided in Figure 2.

The R_peak_detect.m function detects heartbeats on an ECG signal. Initially, the ECG signal is loaded, and then necessary variables such as the signal length are defined. Next, a loop is initiated, and this loop examines each point of the signal to identify the peak points. A point k is considered a peak if its value is greater than the previous (k-1) and next (k+1) values, and it is positive. When these peak points are found, the location information of the heartbeat is recorded, and the heart rate count is increased. This way, the peak points on the ECG signal are detected.

In Figure 3, an ECG signal with 3600 samples and the R-waves detected by the R_peak_detect.m function are shown. In Figure 3, the zero point is indicated by a dashed line. Therefore, the peaks under this line are not considered, and the R-waves are marked by red circles. After detecting the R-waves, the QRS complexes were determined.

After the QRS complexes of the ECG signal are identified, only the EEG signals corresponding to these complex waves should be filtered. This way, by applying the filter to the entire EEG signal, the loss of important information in the signal is prevented. In this study, the Zero Phase Filtering (ZPF) method was employed, an effective technique for processing complex signals like EEG. This method reduces noise while preserving key features of the signal. It achieves this by processing the signal both forward and backward, thus ensuring that no phase distortion occurs. First, the signal is filtered in the forward direction, then it is reversed and filtered again, which ensures there is no time shift or phase loss. Additionally, to minimize the start and end transitions, the initial conditions are adjusted to align with the DC component of the signal, and reversed copies are added to improve the results. This approach ensures the preservation of the signal’s integrity during noise removal.

The general block diagram of the processing steps used for the separation of ECG artifacts from the EEG signal is shown in Figure 4. These processing steps encompass the procedures followed to remove ECG-induced noise from the EEG signal. In the first stage, the raw EEG signal is obtained. Then, the R wave and QRS complexes in the ECG signal are detected, and the impact of ECG-induced noise on the EEG signal is determined. Appropriate filtering methods are applied to accurately remove these signals. After the ECG artifacts are cleaned from the EEG signal, an additional post-processing step may be required. In the final stage, the noise-free EEG signal is analyzed, and the desired classification or neurological activity analysis is performed. These steps are crucial for accurate diagnosis and analysis.

Experimental results

The small amount of ECG noise observed in the EEG channel typically does not pose a significant problem. However, this noise can obscure the details observed in the EEG channel, which may prevent an accurate diagnosis. Therefore, the removal of ECG noise from EEG signals is of great importance [13]. EEG signals are composed of a combination of complex signals from the brain and external sources, making them difficult and time-consuming to interpret accurately. While long-term EEG recordings provide critical information for diagnosing diseases, they require substantial time and cost. Analyzing data that has not been properly cleaned of noise becomes even more difficult. Therefore, effectively removing noise from EEG signals is crucial. The goal of noise removal is to eliminate the noise from the EEG signal while preserving its important information. Otherwise, applying filters to the entire EEG signal may lead to the loss of significant data. Therefore, the filtering process was applied only to the regions corresponding to the QRS complexes. In this study, the Zero-Phase Filtering method was used to remove ECG signal noise.

Experiments were conducted using an EEG recording from the MIT-BIH Polysomnography EEG dataset to remove ECG noise. The ECG signal and the EEG signal containing ECG noise from the patient with the code slp01b are shown in Figure 5. Figure 5(a) displays the ECG signal, while Figure 5(b) shows the EEG signal with ECG noise. In Figure 5(b), the regions marked with green circles have high amplitudes, which are closely aligned with the QRS complex of the ECG signal shown in Figure 5(a). This observation demonstrates that the EEG signal is contaminated with the ECG signal in the time-frequency domain, highlighting the need for an appropriate filtering method to remove this noise.

After detecting the QRS complexes in the ECG signal, the Zero Phase Filtering (ZPF) method was applied to the corresponding EEG signals at these reference points. The results obtained with the SFF filtering method are presented in Figure 6. In this figure, the EEG signal containing ECG noise, the ECG signal, the EEG signal after the removal of ECG noise, and the initial EEG signal are shown together in sequence. The red color represents the EEG signals with ECG noise, while the blue color represents the EEG signals after noise removal. The areas marked with red circles indicate the regions where the ECG noise has been successfully removed.

The experiments showed that the correlation between the EEG signal obtained after removing ECG noise using the ZPF method and the raw EEG signals was examined. The correlation value between the EEG signal obtained after applying ZPF and the raw EEG signal was found to be 0.989. The correlation coefficient ranges from -1 to +1, where -1 indicates the signals move in opposite directions, and +1 indicates the signals move in the same direction. A value of 0.989 indicates that the removal of ECG noise preserved the other features of the EEG signal without significant loss. In other words, the goal of the noise removal process using the ZPF method was to eliminate only the ECG noise, while maintaining the integrity of the remaining EEG signal. The ZPF plays a crucial role in enhancing data quality by effectively removing ECG noise from EEG signals while preserving the other vital components of the signal.

Conclusion

ECG signals may contain noise or abnormal waves due to cardiovascular diseases. Methods such as Discrete Wavelet Transform (DWT) and Convolutional Neural Networks (CNN) are used to effectively remove this noise, enabling accurate analysis by eliminating the unwanted interference in the signal. Wavelet transform processes both time and frequency information in parallel, allowing for the separation of ECG noise from the signal and enabling the analysis of the variations of components over time. It is particularly effective in separating low-frequency ECG components from high-frequency EEG signals [15]. On the other hand, deep learning algorithms, such as Convolutional Neural Networks (CNN), provide powerful results in identifying and removing ECG noise mixed into EEG signals. CNNs are capable of learning complex patterns from large datasets, distinguishing and separating noise effectively, and performing accurate classification, thereby enhancing the accuracy of the EEG signal [16].

Advanced filtering methods, particularly adaptive filters, and spectral analysis techniques, offer effective solutions for cleaning the signal and eliminating unwanted components [17]. Additionally, deep learning-based approaches can better identify noise and artifacts, allowing for accurate analysis of the signal [16]. These methods go beyond traditional filtering techniques, enabling more accurate and reliable cardiac anomaly detection [16,18]. For instance, deep learning methods such as Convolutional Neural Networks (CNN) can perform feature extraction with high accuracy, even from noisy data [16]. In this context, multi-modal data analysis and AI-based models enable a more secure interpretation of signals [17].

Focusing on the removal of ECG noise from EEG signals, this research uses a limited dataset. Future studies could examine the relationship between epileptiform activities and neurological diseases in more detail using larger datasets. Additionally, the development of automated noise removal interfaces will enable specialists to use their time more efficiently. Such technological advancements will be particularly beneficial for clinical research working with large datasets. The role of epileptiform activities in the classification of neurological diseases could be investigated in greater depth, and the integration of machine learning and deep learning methods into classification algorithms could improve accuracy and facilitate more precise diagnoses. These technological innovations will enable faster and more reliable results in clinical applications.

  1. Hillyard R, Galambos SA. Eye movement artifact in the CNV. Electroencephalogr Clin Neurophysiol. 1970;28(2):173-182. Available from: https://doi.org/10.1016/0013-4694(70)90185-9
  2. Issa MF, Tuboly G, Kozmann G, Juhasz Z. Automatic ECG artefact removal from EEG signals. Meas Sci Rev. 2019;19(3):101-108. Available from: https://www.measurement.sk/2019/msr-2019-0016.pdf
  3. Correa ME, Laciar AG, Patiño E, Valentinuzzi HD. Artifact removal from EEG signals using adaptive filters in cascade. J Phys Conf Ser. 2007;90(1). Available from: https://iopscience.iop.org/article/10.1088/1742-6596/90/1/012081/pdf
  4. Adeli N, Zhou H, Dadmehr Z. Analysis of EEG records in an epileptic patient using wavelet transform. J Neurosci Methods. 2003;123(1):69-87. Available from: https://doi.org/10.1016/S0165-0270(02)00340-0
  5. Berg M, Scherg P. Dipole modelling of eye activity and its application to the removal of eye artefacts from the EEG and MEG. Clin Phys Physiol Meas. 1991;12(A):49. Available from: https://doi.org/10.1088/0143-0815/12/a/010
  6. Shaker MM. EEG waves classifier using wavelet transform and Fourier transform. Brain. 2006;2:3. Available from: https://www.noisebridge.net/images/4/46/DWTandFFTforEEG.pdf
  7. Shoka A, Dessouky A, El-Sherbeny M, El-Sayed A. Literature review on EEG preprocessing, feature extraction, and classifications techniques. Menoufia J Electron Eng Res. 2019;28(1):292-299. Available from: https://dx.doi.org/10.21608/mjeer.2019.64927
  8. Urigüen B, Garcia-Zapirain JA. EEG artifact removal—state-of-the-art and guidelines. J Neural Eng. 2015;12(3):31001. Available from: https://doi.org/10.1088/1741-2560/12/3/031001
  9. Anderer B, Roberts P, Schlögl A, Gruber G, Klösch G, Herrmann W, et al. Artifact processing in computerized analysis of sleep EEG—a review. Neuropsychobiology. 1999;40(3):150-157. Available from: https://doi.org/10.1159/000026613
  10. Kalyakulina AI, Yusipov II, Moskalenko VA, Nikolskiy AV, Kosonogov KA, Osipov GV. LUDB: A new open-access validation tool for electrocardiogram delineation algorithms. IEEE Access. 2020;8:186181-186190. Available from: https://ieeexplore.ieee.org/document/9214911
  11. Dora C, Biswal PK. Correlation-based ECG artifact correction from single channel EEG using modified variational mode decomposition. Comput Methods Programs Biomed. 2020;183:105092. Available from: https://doi.org/10.1016/j.cmpb.2019.105092
  12. Bajpai S, Kumar Moolchandani H, Sahu M, Mohdiwale S. Artifacts removal in EEG data. 2018.
  13. Gülbay BE. Artefakt kayıtları ve skorlam hataları. Solunum. 2013;15(3):180-183.
  14. Goldberger AL, Amaral LAN, Glass L, Hausdorff JM, Ivanov Pl Ch, Mark RG, et al. PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource for complex physiologic signals. Circulation. 2000;101(23). Available from: https://www.ahajournals.org/doi/10.1161/01.cir.101.23.e215
  15. Yildirim S, Kocer HE, Ekmekci A. Research on brain signals via artificial neural network and swarm intelligence algorithms. Int J Appl Math Electron Comput. 2019;7(2):27-37. Available from: http://dx.doi.org/10.18100/ijamec.475090
  16. Drahansky M, et al. Deep learning algorithms for efficient analysis of ECG signals to detect heart disorders. Biosignal Process. 2022;13.
  17. Rathore D, Choudhary N. An overview of ECG signal preprocessing and feature extraction for cardiac health monitoring. Int J Eng Appl Sci Manag. 2025;5(12):February.
  18. Abagaro AM, Barki H, Ayana G, Dawud AA, Thamineni BL, Jemal T, et al. Automated ECG signals analysis for cardiac abnormality detection and classification. J Electr Eng Technol. 2024;19(5):3355-3371. Available from: https://link.springer.com/article/10.1007/s42835-024-01902-y
 

Help ?