EE434 Lecture 08
EE434 Lecture 08
EE434
Biomedical Signal Processing
Lecture # 8
Biomedical Signal Processing
Application Examples
28.11.2024 Lecture # 8 1
EE434 Biomedical Sig. Proc. Lecture # 8 Examples
ECG Analysis 1:
QRS Detection
28.11.2024 Lecture # 8 2
EE434 Biomedical Sig. Proc. Lecture # 8 ECG Theoretical Waveform
28.11.2024 Lecture # 8 3
EE434 Biomedical Sig. Proc. Lecture # 8 ECG Signal Characteristics
• The QRS complex is the dominant feature of the ECG signal.
28.11.2024 Lecture # 8 4
EE434 Biomedical Sig. Proc. Lecture # 8 ECG Signal Characteristics
• Relative power spectrum of QRS complex, P and T waves, muscle noise and
motion artifacts. The ECG signal is formed by combining all of these.
28.11.2024 Lecture # 8 5
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
28.11.2024 Lecture # 8 6
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
28.11.2024 Lecture # 8 7
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
• Bandpass filter (cascaded lowpass filter and highpass filter) to isolate the
predominant QRS energy centered at 10 Hz. Energy of QRS is between 5Hz-
15Hz. (Thakor et. al., 1983)
28.11.2024 Lecture # 8 8
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
• Lowpass filter: Eliminate noise such as the EMG and 50Hz power line noise
• Cutoff frequency, fC = 11 Hz
y[n] = 2y[n-1] - y[n-2] + x[n] - 2x[n-6] + x[n-12]
• In an IIR filter, the gain at the cut-off frequency is usually
defined as a 3dB reduction. This means that the gain is
reduced to half its maximum value.
28.11.2024 Lecture # 8 9
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
• Highpass filter: Eliminate motion artifacts, P wave and T wave .
• Cutoff frequency, fC = 5 Hz
y[n] = y[n-1] - x[n]/32 + x[n-16] - x[n-17] + x[n-32]/32
28.11.2024 Lecture # 8 10
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
• Differentiation: To obtain information
on slope and overcome the baseline
drift problem.
• Accentuates QRS complexes relative to
P & T wave
8y[n] = 2x[n] + x[n-1] - x[n-3] - 2x[n-4]
• Squaring:
• Emphasizes the higher frequency
component and attenuates the lower
frequency component.
y[n] = x2[n]
28.11.2024 Lecture # 8 11
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
• Moving Average filter
28.11.2024 Lecture # 8 12
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
Bigeminy is a cardiac arrhythmia in which there is a single ectopic beat, or irregular heartbeat,
28.11.2024 following each regular heartbeat. Lecture # 8 13
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
Figure: a) The digitized ECG signal, ECG (k), b) after band pass filtering,
28.11.2024 Lecture # 8 14
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
Figure (Cont.): c) after band pass filtering and differentiating, d) after band pass filtering, differentiating and
squaring,
28.11.2024 Lecture # 8 15
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
Figure (Cont.): e) the final process; after band pass filtering, differentiating, squaring and moving average filter.
28.11.2024 Lecture # 8 16
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
Another Example:
28.11.2024 Lecture # 8 17
EE434 Biomedical Sig. Proc. Lecture # 8 A Real-Time QRS Detection Algorithm
• The QRS complex is detected when the slope amplitude is within the
threshold.
Heart rate (bpm)= (60 000*fs) / R-R interval(ms), where (fs = 450Hz)
28.11.2024 Lecture # 8 18
EE434 Biomedical Sig. Proc. Lecture # 8 Examples
ECG Analysis 2:
QT Dispersion Algorithm as a
Predictor of Sudden Cardiac
Death
28.11.2024 Lecture # 8 19
EE434 Biomedical Sig. Proc. Lecture # 8 ECG Theoretical Waveform
28.11.2024 Lecture # 8 20
EE434 Biomedical Sig. Proc. Lecture # 8 Myocardial Ischemia and Infarction
• If a coronary artery is occluded, the transport of oxygen to the cardiac muscle is
decreased, causing an oxygen debt in the muscle, which is called ischemia.
• If the oxygen transport is terminated in a certain area, the heart muscle dies in
that region. This is called an infarction (Jaakko Malmivvo and Robert Plonsey,
1995). In another word, it is known as heart attack. An infarct area is
electrically silent since it has lost its excitability (Jaakko Malmivvo and Robert
Plonsey, 1995).
28.11.2024 Lecture # 8 21
EE434 Biomedical Sig. Proc. Lecture # 8 QT Dispersion (QTd)
• QTd is calculated from the 12-lead ECG has emerged as a noninvasive
measurement for quantifying the degree of myocardial repolarization
inhomogeneity (Day CP, et al., 1990).
• The QTd phenomenon lies in the fact that by electrodynamics laws the
ventricle complex duration must be uniform for almost all leads except for
special cases. But electrocardiographic measurements towards 12 lead ECG
shows the lead-to-lead QT-duration distribution exists and it is used as a
predictor of the heart rhythm disturbances.
28.11.2024 Lecture # 8 22
EE434 Biomedical Sig. Proc. Lecture # 8 QT Dispersion (QTd)
• QTd is used as informative index to predict sudden death. QT dispersion
defined as the difference between the maximum and minimum QT intervals on
any of 12 leads, is a marker of myocardial electrical instability (Mirvis DM,
1985).
• As the increased QTd is associated with sudden death, QTd is often used as a
marker of sudden arrhythmic death caused myocardial infarction.
28.11.2024 Lecture # 8 23
EE434 Biomedical Sig. Proc. Lecture # 8 QT Dispersion (QTd)
28.11.2024 Lecture # 8 24
EE434 Biomedical Sig. Proc. Lecture # 8 QT Dispersion (QTd)
• The QT interval begins at the onset of the QRS complex and terminates at the
end of the T wave. It represents the time of ventricular depolarization and
repolarization. It is useful as a measure of repolarization and is influenced by
electrolyte balance, drugs, and ischemia. The QT interval is inversely related to
heart rate. (Day CP et al., 1990).
• Location: Extends from the beginning of QRS complex to the end of the T
wave. (includes the QRS complex, S-T segment and the T wave)
• Duration: Varies according to age, sex and heart rate. Normal (0.35s-0.44s)
(MD Sulaiman et al., 1997).
28.11.2024 Lecture # 8 25
EE434 Biomedical Sig. Proc. Lecture # 8 QT Dispersion (QTd)
• QTd = QT(max) - QT(min) (Day CP et al., 1990).
• If the QT dispersion value was > 60 ms (MD Sulaiman et al., 1997), there would
be a higher risk of sudden death.
28.11.2024 Lecture # 8 26
EE434 Biomedical Sig. Proc. Lecture # 8 Research Methodology
• This study was performed at Hospital of University Kebangsaan Malaysia
(HUKM).
Sampling
Hardware Feature Verification
&
Circuitry Extraction of QTd
Digitization
28.11.2024 Lecture # 8 27
EE434 Biomedical Sig. Proc. Lecture # 8 Hardware Circuitry
28.11.2024 Lecture # 8 28
EE434 Biomedical Sig. Proc. Lecture # 8 ECG Circuit
28.11.2024 Lecture # 8 29
EE434 Biomedical Sig. Proc. Lecture # 8 ECG Circuit
• Instrumentation amplifier is used to amplify low-level signals in the presence
of high common-mode noise. It is used for it’s high accuracy, precise gain and
very high common mode rejection ratio (CMRR). (Buchla et al,1992).
• There are 3 basic inputs for this circuit which is RA, LA and LL. These inputs are
the bipolar leads. The buffer amplifier stage is to prevent electrode-offset
voltage from saturating the amplifiers.
• The common-mode signal will be inverted into the right leg drive (RL) . It is
used to reduce the 50 Hz power line noise.
28.11.2024 Lecture # 8 30
EE434 Biomedical Sig. Proc. Lecture # 8 Data Acquisition
• The standard 12 lead ECG were recorded simultaneously for each patient from the age
group of 60 . There were 53 patients eligible for the data collection process. ECG data
were gathered from 2 clinical groups which consist of 28 normal patients (15 female
and 13 male) and 25 (13 female and 12 male) patients with Myocardial Infarction
(MI).
• Data were obtained from patients from Hospital of University Kebangsaan Malaysia
(HUKM).
• A PC with PC-ECG interface card is used as data acquisition equipped with a 12 bit
analogue to digital conversion card. The ECG was digitized at sampling frequency of
500Hz. The signals were recorded for 8 leads (V1, V2, V3, V4, V5, V6, I, II).
28.11.2024 Lecture # 8 31
EE434 Biomedical Sig. Proc. Lecture # 8 Software Development
• The software development part involves the development of QT dispersion
algorithm which consists of the following process.
• The algorithm discussed below are for one lead but the same approach is done
to 8 lead of ECG to determine the QT dispersion.
Feature Extraction
28.11.2024 Lecture # 8 32
EE434 Biomedical Sig. Proc. Lecture # 8 Software Development
Figure: Flow Chart of the Algorithm to Compute QT Interval for Every Cycle in a Lead
28.11.2024 Lecture # 8 34
EE434 Biomedical Sig. Proc. Lecture # 8 Waveform Recognition
Figure: Figure shows the AR peak and BR peak location detection with respective threshold
28.11.2024 Lecture # 8 35
EE434 Biomedical Sig. Proc. Lecture # 8 T end Detection
• The location of AT peak (max) and BT peak (min) of a cardiac cycle within the window defined
are compared. If the AT peak location occurs first before the BT peak location, the condition of
|max|> 4|min| is checked. If it is false, the T wave is considered normal T wave (upward-
downward).
• The location of AT peak (max) and BT peak (min) of a cardiac cycle within the window defined
are compared. If the AT peak location occurs first before the BT peak location, the condition of
|max| > 4|min| is checked. In this case, if it is true, the T wave is considered as only upward.
28.11.2024 Lecture # 8 37
EE434 Biomedical Sig. Proc. Lecture # 8 T Wave
Inverted T wave (downward-upward)
• The location of AT peak (max) and BT peak (min) of a cardiac cycle within the window defined
are compared. If the BT peak location occurs first before the AT peak location, then a minimum
point (mina) is searched between the max and ewind. If |max| < 4|mina|, again the upward-
downward T wave is considered. Otherwise, then next criteria, |min| > 4|max| is checked. The
true case makes the T wave inverted.
• The location of AT peak (max) and BT peak (min) of a cardiac cycle within the window defined
are compared. If the BT peak location occurs first before the AT peak location, then a minimum
point (mina) is searched between the max and ewind. If |max| > 4|mina| and |min| < 4|max|,
it is considered as only downward T wave.
28.11.2024 Lecture # 8 38
EE434 Biomedical Sig. Proc. Lecture # 8 T end Detection
• T offset is defined as the intersection of the T slope which best fit between 10%
and 30% of T wave amplitude with the isoelectric baseline.
28.11.2024 Lecture # 8 39
EE434 Biomedical Sig. Proc. Lecture # 8 T end Detection
Figure: The bwind, ewind and T wave offset location detection with respective threshold.
28.11.2024 Lecture # 8 40
EE434 Biomedical Sig. Proc. Lecture # 8 Duration Measurement
• Heart rate= 60 000/RR interval (ms)
28.11.2024 Lecture # 8 41
EE434 Biomedical Sig. Proc. Lecture # 8 Result: 8 Lead Analysis
28.11.2024 Lecture # 8 46
EE434 Biomedical Sig. Proc. Lecture # 8 Conclusion
28.11.2024 Lecture # 8 47
EE434 Biomedical Sig. Proc. Lecture # 8 Examples
ECG Analysis 3:
Heart Rate Variability
28.11.2024 Lecture # 8 48
EE434 Biomedical Sig. Proc. Lecture # 8 Heart Rate Variability
• “Inter-beat-interval” (IBI, in ms).
• The length of the cardiac cycle
• Also termed as “heart period”, i.e., the period of the cardiac cycle.
• Can be determined by measuring each occurrence of a specific component of the ECG waveform.
• R-wave
• The most common point of the cardiac cycle used when measuring heart period is the peak of the R
wave.
• This is due to the fact that the R wave is manifested as a sharp positive peak followed by a negative
deflection in the ECG waveform.
• The peak of the R-wave is normally greater in amplitude than all other peaks in the ECG making it
easily distinguishable.
• Thus, IBI (also known as R-R interval) is often defined as the duration between successive R-
28.11.2024 Lecture # 8 49
waves
EE434 Biomedical Sig. Proc. Lecture # 8 1) Bandpass Filtering
• The purpose of the filtering is to enhance the QRS complexes of the digitized
ECG, while suppressing noise and artifacts.
• The upper cut-off frequency is needed to suppress motion artifacts but not
narrow QRS complexes.
28.11.2024 Lecture # 8 50
EE434 Biomedical Sig. Proc. Lecture # 8 2) QRS Wave Detection Algorithms
(R Wave Localization)
• to obtain a single positive peak for each QRS, which thus allows the use
of a threshold-based peak detector in the second stage.
28.11.2024 Lecture # 8 51
EE434 Biomedical Sig. Proc. Lecture # 8 2) QRS Wave Detection Algorithms
• Nygards and Sornmo found that the envelope of the ECG to be useful for obtaining a positive-
valued peak for each QRS waveform from the ECG. The envelope is defined by
• The envelope is further smoothed out by using a smoothing filter with a triangular impulse
response (or also known as Bartlett window) to remove any ripples present in the function.
• The resultant signal is known as the delineation function, d[n], in which the QRS waveform is
represented by a single positive pulse centered around the position of the R peak.
• The onset and the end of the QRS complex is then determined from threshold crossings in the
delineation function.
28.11.2024 Lecture # 8 52
EE434 Biomedical Sig. Proc. Lecture # 8 3) Outliers Removal
• A cardiac beat originating elsewhere than at the SA is known as the ectopic beat.
Ectopic beats are usually manifested as a premature beat followed by a longer than
normal RR interval before the next normal beat.
• The ectopic beats and any artifacts due to QRS missed detections are denoted as
outliers. These outliers affect the quality of the RR interval series.
• The time-domain signal associated with HRV exhibits a sharp transient at the ectopic
beat making it unusable, particularly when estimating the spectral estimate of HRV.
28.11.2024 Lecture # 8 53
EE434 Biomedical Sig. Proc. Lecture # 8 3) Outliers Removal
• An isolated ectopic beat corrupts the spectral estimate because of the broad-band nature of
the impulse-like artefact. In particular, frequency domain features are erroneously
overestimated.
• Therefore, corrections of outliers must be done prior to analysis or index estimations of the
HRV.
• A widely used technique to reduce effects of outliers is to discard the outliers from the time
series and interpolate the RR interval signal using either linear or cubic splines.
• Cubic spline interpolation is well suited for replacing isolated ectopic beats.
• It is, however, not suitable for replacing runs of ectopic beats, since it results in a large and
apparently artifactual increase in low-frequency power.
• The interpolation-resampling
• The window-averaging-resampling
• Reciprocal of the RR interval time series - the instantaneous heart rate (IHR)
28.11.2024 Lecture # 8 55
EE434 Biomedical Sig. Proc. Lecture # 8 5) Detrending
• Trends have been found to result from alterations in posture or activity during ECG
recording.
• They tend to mask spectral components (i.e. spectral peaks) of HRV
• The steeper the trend, the less detail is evident in the spectra.
• Detrending often yields more informative spectra with all major spectral peaks visible.
• Hence, average heart rate and trends are often removed from the data segment
before further analysis is performed.
• These trends are usually very low frequency and can be removed by a high pass filter.
• Alternatively, a linear trend is assumed, estimated using linear regression, and
subtracted from the time series
28.11.2024 Lecture # 8 56
EE434 Biomedical Sig. Proc. Lecture # 8 Analysis of Heart Rate Variability (HRV)
• Analysis of Heart rate variability (HRV) provides a non-invasive method to
assess the neuronal influences on the cardio regulatory function.
28.11.2024 Lecture # 8 57
EE434 Biomedical Sig. Proc. Lecture # 8 Analysis of Heart Rate Variability (HRV)
• The HRV analysis can be performed on short-term ECG recordings (lasting from
1 to 5 minutes) or on long-term recordings lasting for 24 hours depending on
application at hand.
• Two conventional approaches to the analysis of HRV: the time-domain and the
frequency-domain (spectral).
• Due to the nonstationary nature of the HRV, these approaches fail to reveal
valuable information embedded in signal.
28.11.2024 Lecture # 8 58
EE434 Biomedical Sig. Proc. Lecture # 8 Time-Domain Analysis
• Time-domain features are derived from simple statistical calculations or
• The most commonly used indices for short term analysis are the mean and
variance of RR intervals.
28.11.2024 Lecture # 8 59
EE434 Biomedical Sig. Proc. Lecture # 8 Time-Domain Analysis
Table 2.1: Statistical and geometrical parameters recommended by the Task Force of the European Society of
Cardiology and the North American Society of Pacing and Electrophysiology
28.11.2024 Lecture # 8 60
EE434 Biomedical Sig. Proc. Lecture # 8 Frequency-Domain Analysis
• Spectral analysis involves decomposition of the series of sequential RR intervals into its
various frequency components and quantifies them in terms of their relative intensity,
termed ‘power’.
• The power spectrum is usually divided into different spectral bands and the powers are
calculated in these bands.
• There are three major spectral peaks in the adult short-term HRV power spectrum
• A high-frequency (HF) spectral peak appears generally between 0.15 and 0.5 Hz.
• A low-frequency (LF) peak occurs around 0.1 Hz (generally between 0.04 and 0.15
Hz).
• Very low-frequency (VLF) heart rate oscillations are below 0.04 Hz.
28.11.2024 Lecture # 8 61
EE434 Biomedical Sig. Proc. Lecture # 8 Frequency-Domain Analysis
• As the neonatal heart rate oscillations differ from that of the adult, 0.2 Hz is
utilized as the cut-off point between LF and HF bands.
• Studies that exclude VLF band, start LF at 0.02 Hz [33, 36-38] and those that
include the VLF band use 0.04 Hz as the cut-off point dividing the two.
28.11.2024 Lecture # 8 62
EE434 Biomedical Sig. Proc. Lecture # 8 Frequency-Domain Analysis
• The spectral peaks in HRV power spectrum reflect the amplitude of the heart rate
fluctuations present at different oscillation frequencies.
• Thus, relationships between HRV and physiological variables that relate to oscillatory
control systems in homeostasis are established using spectral estimation techniques.
• Sympathetic activities manifest themselves in the low frequency band (LF) ascribed to
baroreceptor reflex and vasomotor activity.
• Better spectral resolution in the case of short data lengths on which the signal is supposed
to maintain stationarity
• The disadvantage of parametric methods, however, is the need to verify the suitability of the
chosen model and its complexity
28.11.2024 Lecture # 8 64
EE434 Biomedical Sig. Proc. Lecture # 8 Frequency-Domain Analysis
28.11.2024 Lecture # 8 65
EE434 Biomedical Sig. Proc. Lecture # 8 Frequency-Domain Analysis
28.11.2024 Lecture # 8 66
EE434 Biomedical Sig. Proc. Lecture # 8 Frequency-Domain Analysis
28.11.2024 Lecture # 8 67