# AI-Enabled Electrocardiogram Analysis for Disease Diagnosis
## 3 ECG Signal Analysis  
Before using ECG signal information as input for any artificial intelligence algorithm, ECG data must be processed to make it suitable. Without a signal analysis and processing, the ECG data might contain unwanted artifacts, noise, unusual spikes or abnormal characteristics, etc., which might result in the inaccurate result of ML/DL algorithms or under/overfitting. The typical steps or stages for ECG signal analysis and processing are filtering, feature extraction, and feature selection. In this section, the conventional techniques implemented using ECG are discussed. The signal-to-noise ratio for ECG is not high, so the raw ECG becomes unusable without proper denoising. Since it is a biomedical signal, there are chances of noise from biological, mechanical, and electrical aspects. The first noise to be discussed here is the electromyogram (EMG), which comes as a result of the electrical activity of the body muscle. Since the frequency spectra for EMG and ECG overlap, using ordinary filters does not work [35; 36]. Also, although the EMG noise is minimal at resting position, during activity, such as under stress or during exercise, the effect is significant. Adaptive filters, wavelet transformation, and low-pass filters were tried to remove EMG noise. Using those filters appears to affect the peak shapes of ECG [36; 37]. Two more common noises are baseline wanderer and power line interference. The fixed range (50-60 Hz) makes removing power line interference easier. The typical solution is using a notch filter and their variant with the downside of adding a ripple to the ECG wave [38; 39; 40; 41]. Some other solutions are adaptive filters, such as the Hilbert Huang Transform adaptive filter; the downside, in this case, is the requirement of a reference signal [42; 43; 44; 45; 46]. The electrocardiogram (ECG) waveform may exhibit baseband wander, which is extra low-frequency noise or movement that gradually shifts or drifts the baseline. It frequently results from electrode or patient movement, breathing, or muscular activation. Techniques including correct electrode placement, patient positioning, signal filtering, and cutting-edge artifact removal technologies are used to reduce baseband wander's adverse effects on the precision and interpretation of the ECG signal. Different filters were applied to remove baseband wander, such as high pass filters, adaptive filters, wavelet transformation, etc. [47; 48; 49; 50]. In Figure 2, a typical ECG wave is depicted, and in Figure 3, an example of baseband wander is shown. Figure 2: An example of an ECG wave with waves and segments highlighted [51] CC by 4.0. There are three different domains from which aspect the features are extracted. * Time domain: The most significant is the time domain since the ECG presents the physical movement of the heart's activities. However, the frequency and statistical domains provide helpful information that can remain unnoticed in time domain information. The time domain characteristics of the ECG waveform delineate its features based on time, which consist of amplitude, duration, P-wave duration, QRS duration, the QT interval, the RR interval, and the PR interval [52; 53; 54; 55; 56; 57; 58; 59]. The height of the waveform, known as the amplitude, represents the strength of the electrical signal generated by the heart. Duration denotes the time the waveform takes to complete one cycle, calculated from the beginning of one waveform to the beginning of the next. P-wave duration measures the time taken for the first positive deflection of the waveform that shows atrial depolarization. QRS duration determines the time taken for the QRS complex, which displays ventricular depolarization. The QT interval represents the duration between the start of the QRS complex and the end of the T-wave, signifying the entire length of ventricular depolarization and repolarization. The RR interval indicates the duration between two consecutive R waves corresponding to the time between two heartbeats.