Documente Academic
Documente Profesional
Documente Cultură
xsqp
b = {. . . , sl−2 l−1 l l+1
r , xw , sr , xw , sr , xw , sr , xw , . . .}. (3.2)
On the other hand, the nearly quasi-periodic base ECG signal can be defined by the base
ECG signal where its wave signal xw is slightly varied by time; i.e.,
xnqp
b = {. . . , sl−2 l−1 l−1 l l l+1 l+1 l+2
r , xw , sr , xw , sr , xw , sr , xw , . . .}. (3.3)
Note that the wave signal of the NQP base ECG signal may vary in amplitude or width,
or both. For example, Fig. 3.1 illustrates examples of a strictly quasi-periodic signal at
the top and a nearly quasi-periodic signal at the bottom. The ECG waves x w of the strictly
quasi-periodic signal plotted in solid line are identical copy of each other while the resting
states plotted in dashed line have the varied length. On the other hand, the ECG waves
of the nearly quasi-periodic signal plotted in solid line are varied such that the first ECG
wave xl−1 l
w is different from the middle ECG wave xw in a term of amplitude while both
xlr .
The unique and important components of the proposed QRS detection algorithm are con-
tained in the pre-processing and processing stages as simple thresholding and search meth-
ods are used in the determination stage. In the pre-processing stage, a moving average
is used as the low-pass filter. The difference between two moving average filters having
different cut-off frequencies, corresponding to different lengths, forms the bandpass filter.
Moreover, the localized energy-based ratio is computed for enhancing the QRS feature and
suppressing other features in the processing stage. The QRS detection algorithm is there-
CHAPTER 3. NEW ALGORITHMS FOR ECG SIGNAL PROCESSING 23
xw xw xw
Figure 3.1: An example of strictly quasi-periodic signal and nearly quasi-periodic signal.
fore referred to as the ratio square difference moving average (RSDMA) algorithm. The
diagram of the QRS detection algorithm is illustrated in Fig. 3.2.
Let the sequence xecg [n] be a finite duration discrete-time signal of an ECG with length
N where n = 0, 1, . . . , N − 1. The QRS detection of the ECG signal xecg is performed as
follows.
First, the bandpass filter, formed from the difference of the two moving averager filters Mu
and Ml is applied to the ECG signal xecg . Let the numbers lu and ll denote the lengths of the
finite impulse response (FIR) moving averagers Mu and Ml , respectively, where lu < ll and
both lu and ll are integers. Therefore, effectively the moving average filter Mu provides the
upper cut-off frequency of the bandpass filter while the moving averager Ml provides the
lower cut-off frequency of the bandpass filter. Note that if the length lu or ll is increased,
the cut-off frequency is lowered, and vice versa. Hence, the effects of varying the moving
CHAPTER 3. NEW ALGORITHMS FOR ECG SIGNAL PROCESSING 24
Moving Average Mu
Feature
Enhancement
| |2 ! | |2
ECG
Signal
Moving Average Ml
T{ }
QRS
Complexes
Determination
- If both lengths lu and ll are increased, both upper and lower cut-off frequencies are
lowered;
- If both lengths lu and ll are decreased, both upper and lower cut-off frequencies are
increased;
- If the length lu is decreased but the length ll is increased, the bandwidth of the filter
is increased;
- If the length lu is increased but the length ll is decrased, the bandwidth of the filter is
decreased.
The moving averages of the ECG signal xecg obtained from the moving average filters
Mu and Ml are, respectively, defined by
cu
1 X
xecg
u [n] = Mu {xecg
[n]} = xecg [n − k] (3.4)
lu
k=cu −lu
CHAPTER 3. NEW ALGORITHMS FOR ECG SIGNAL PROCESSING 25
and
cl
1 X
xecg
l [n] = Ml {xecg
[n]} = xecg [n − k] (3.5)
ll k=c −l
l l
In the processing stage, after applying the bandpass filter to the ECG signal x ecg , the QRS
complex remaining in the bandpass filtered ECG signal x ecg
bp is enhanced whereas other
features are suppressed. The features of the QRS complex are enhanced by using a feature
enhancement filter performing a local energy ratio computation. The feature enhanced
signal for the QRS complex applied to the bandpass filtered ECG signal x ecg
bp is defined by
2
xecg
bp [n]
xecg
r [n] = Pcw 2 (3.7)
k=cw −lw xecg
bp [n − k]
where lengths lw and cw are integers, and 0 ≤ cw ≤ lw . If the length lw is increased, a small
Note that at the same length of lw , the features of the QRS complex are more suppressed
when the heart rate is higher.
In the final stage, the QRS complexes are detected and their locations are determined.
However, further processing is required to avoid detecting several QRS complexes from a
CHAPTER 3. NEW ALGORITHMS FOR ECG SIGNAL PROCESSING 26
single QRS complex before the detection and searching steps. Maximum (Max) filtering
is used to perform another low-pass filtering operation to the feature enhanced signal x ecg
r .
xecg
m [n] = max x[n − k] (3.8)
k∈[cm −lm ,cm ]
where the lengths lm and cm are integers, and 0 ≤ cm ≤ lm . If the length lm is too high,
some of the QRS complexes may not be detected. On the other hand, a false positive of
detecting several QRS complexes from the single QRS complex may occur if the length l m
is too low.
Next, the threshold computed from the maximum value of the Max filtered signal x ecg
m
in the window range plays a role to detect the QRS complex. The thresholded signal x ecg
t
is defined by
1 if xecg ecg
m [n] ≥ dt maxk∈[ct −lt ,ct ] xm [n − k]
xecg
t [n] = (3.9)
0 otherwise
where the dt is a threshold ratio value such that 0 < d t ≤ 1; the lengths lt and ct are
integers, and 0 ≤ ct ≤ lt . At every group of 1s in the thresholded signal x ecg
t , there is one
QRS complex. The location of the QRS complex is determined from the location where
the value of the bandpass filtered ECG signal xecg
bp in a group of 1s is a maximum given by
ecg ecg
Lqrs [nq ] = argn xbp [n] = max xbp [k] (3.10)
k∈Qnq
At the end of the QRS detection process, the number of QRS complexes Nqrs , and the
CHAPTER 3. NEW ALGORITHMS FOR ECG SIGNAL PROCESSING 27
Composite
ECG Signal
QRS Detection
QRS
Complexes
2-D ECG
Array
ECG Signal ECG Signal
Conversion Transformation
=
Transformed
ECG Map
+
Extracted
ECG Signal ECG Signal
Reconstruction
After the QRS complexes of the base ECG signal that is being separated are detected in the
first stage, the composite ECG signal is partitioned into subsequences according to the loca-
tions of the QRS complexes; and then these subsequences are arranged to form a 2-D signal
stack through a signal resampling process. The base ECG signal is subsequently extracted
from the 2-D signal stack by performing a series of processes using a Fourier transform,
thresholding, and an inverse Fourier transform. The base ECG signal is reconstructed from
the extracted signal stack in the final stage. The ECG signal separation algorithm is referred
to as the Fourier Resampling based Signal Extraction Algorithm (FRSEA). The diagram of
the ECG signal separation algorithm is illustrated in Fig. 3.3.
Let xc [n] be a finite duration discrete-time signal of a composite ECG signal that is