You are on page 1of 4

EXTRACTION OF ECG FROM SINGLE CHANNEL EMG SIGNAL USING

CONSTRAINED SINGULAR SPECTRUM ANALYSIS

Saeid Sanei and Ahmadreza Hosseini-Yazdi


Nature-Inspired Computing and Engineering, Faculty of Engineering and Physical Sciences University
of Surrey, Guildford, Surrey, UK, Email: S.Sanei@Surrey.ac.uk

ABSTRACT was developed for removing ECG artefact from surface


EMGs recorded in patients with cervical dystonia. Even in
A simple and extremely effective method for extraction of this approach an ECG signal recorded from a separate
electrocardiography (ECG) signal from noisy single channel channel was used as a reference signal. However, so far, to
noisy electromyography (EMG) signal has been developed. the authors knowledge, no prior attempts have been made to
The method is based on singular spectrum analysis, where separate noisy ECG and EMG signals from a single channel
the subspace of interest is estimated by incorporation of a recording without a reference component.
priori information. The method is applied to a number of For the first time in this paper a subspace-based method
real data sequences. The performance of the algorithm is called singular spectrum analysis (SSA) [3] is used to
both subjectively and objectively assessed and the results effectively separate ECG signal from the EMG at the
are compared with those of the well known adaptive line presence of very high-level noise. No reference ECG signal
enhancer (ALE) since at least one of the components, i.e. is used either. Here, the traditional SSA has been modified
ECG, is quasi-periodic. It is demonstrated that the proposed to incorporate some statistical characteristics of the signal
subspace method significantly outperforms ALE. (ECG artefact). This was done to select the subspace of
interest for an accurate and effective separation of the ECG
from the noisy EMG recording. We call this method
Index Terms—EMG, Constrained SSA, ECG, ALE.
constrained SSA (CSSA). The method is compared with
adaptive line enhancer (ALE) [10], as the benchmark for de-
1. INTRODUCTION
noising periodic single-channel signals. Unlike for ALE,
EMG signals provide valuable information relating to here, no reference is used. Instead, the quasi-periodic nature
peripheral and central motor functions and have been of the ECG is taken into account. The result of the CSSA
widely adopted in the study of motor function and approach is remarkable. High performance of the method
movement disorders. Surface EMGs represent a
can be easily verified both subjectively and objectively as
superposition of electrical activities from motor unit action
potentials located subcutaneous to the detecting electrodes. explained in the following sections.
Surface EMGs have previously been applied quantitatively
to assess muscular activity and diagnose various muscular 2. CONSTRAINED SSA
disorders. These signals however are nonstationary and
often available using only single-channel recordings. Most The basic SSA method consists of two complementary
of EMG signals are corrupted by ECG mainly because the stages: decomposition and reconstruction; each stage
blood vessels are spread all over the body. This problem is includes two separate steps. In the first step the series is
more severe when the muscles around heart and main decomposed and in the second stage the original series is
arteries are to be investigated. Restoration of EMG signals reconstructed and used for further analysis. The main
from artefacts is extremely difficult mainly due to their concept in studying the properties of SSA is separability,
randomness and being noisy in nature. There have been which characterizes how well different components can be
some attempts in denoising the EMG signals recently such separated from each other. The absence of approximate
as that in [1] where wavelet and ICA have been used for a separability is often observed in series with complex
multichannel recording of EMG. Unfortunately, not always structure. For these series and series with special structure,
more than one channel recording is available. Moreover, there are different ways of modifying SSA leading to
generally the conditions of independency and stationarity of different versions such as SSA with single and double
the signal components are not fully satisfied. In a very centering, Toeplitz SSA, and sequential SSA [3].
recent attempt by Lu et al. [2] an adaptive noise canceller SSA is becoming an effective and powerful tool for time
(ANC) based on recursive-least-squares (RLS) algorithm series analysis in meteorology, hydrology, geophysics,

978-1-4577-0274-7/11/$26.00 ©2011 IEEE DSP2011


climatology, economics, biology, physics, medicine and component (note that if λ1 >> λ2, the information energy
other sciences where short and long, one-dimensional and will be mostly concentrated in the most dominant matrix
multidimensional, stationary and nonstationary, almost
deterministic and noisy time series are to be analyzed. A
X1 = λ1 u1 v1 associated with the first singular values).
comparison between SSA and other classical methods can
be seen in [4]. In addition, the method has several essential 2.2. Reconstruction
extensions [5]. The SSA is carried out in two stages;
decomposition and reconstruction. A brief description of the During reconstruction the elementary matrices are first split
SSA stages is given in the following subsections (for more into several groups (depending on the number of
information see [3]). components in the time series – in this application EMG and
ECG signals, the matrices within each group are added
2.1. Decomposition together). The size of the group or in other words, the length
of each subspace may be specified based on some a priori
This stage includes an embedding operation followed by information. In the case of ECG removal from recorded
singular value decomposition (SVD). Embedding operation EMGs this feature and the desired component are jointly
maps a one-dimensional time series f into a k×l matrix with (and automatically) identified based on a constraint on the
rows of length l as statistical properties of the signal to be extracted. Let I = {i1,
. . . , ip} be the indices corresponding to the p eigenvalues of
X = {xij } = [x1 , x 2 ,..., x k ] the desired component. Then the matrix X̂ I corresponding
⎡ f0 f1 f 2 . . . f k −1 ⎤ to the group I is defined as ˆ = ∑ X . In splitting
X
ip
I j =i j
⎢f f 2 f 3 . . . f k ⎥⎥
1

⎢ 1 the set of indices J = {1, . . . , d} into disjoint subsets I1 to Im


we always have
= ⎢ f2 f 3 f 4 . . . f k +1 ⎥ (1)
⎢ ⎥ Im
⎢ # # # % # ⎥ X= ∑ X̂ j (3)
⎢f f l f l +1 . . . f r −1 ⎥⎦
⎣ l −1 j = I1

The procedure of choosing the sets I1, . . . Im is called


with vectors xi = [fi-1, fi, . . . , fi+l+2]T ∈ RL , where k = r - l eigentriple grouping. For a given group I the contribution of
+1 is the window length (1≤ l ≤ r), and subscript T denotes the component XI in expansion (3) is measured by
the transpose of a vector. Vectors xi are called l-lagged contribution of the corresponding eigenvalues:
vectors (or, simply, lagged vectors). The window length l
∑i∈I λi ∑i=1 λi . In the next step the obtained matrix is
d
should be sufficiently large. Note that the trajectory matrix
X is a Hankel matrix, which means that all the elements transformed to the form of a Hankel matrix which can be
along the diagonal i + j = const. are equal. subsequently converted to a time series. If zij stands for an
In the SVD stage the SVD of the trajectory matrix is element of a matrix Z, then the k-th term of the resulting
computed and represented as sum of rank-one bi-orthogonal series is obtained by averaging zij over all i,j such that i+j =
elementary matrices. Consider the eigenvalues of the k +1. This procedure is called diagonal averaging or
covariance matrix Cx = XXT are denoted by λ1, . . ., λl in Hankelization of matrix Z. A recursive SSA algorithm has
decreasing order of magnitude (¸λ1 ≥ . . . ≥ λl ≥ 0) and the been developed recently [6]. Such a method is advantageous
corresponding orthogonal eigenvectors by u1, . . ., ul. Set d for real-time processing of the data.
= max(i; such that λi > 0) = rank(X): If we denote
2.3. Constrained SSA
v i = XT u i λi , then the SVD of the trajectory matrix
can be written as: Comparing the background EMG and ECG, it is seen that
the ECG has limited duration time and often with relatively
d d larger amplitude. As a result, distribution of such a signal is
X = ∑ X i = ∑ λi u i v Ti (2) sharper (and often skewed toward left) than a quasi-
i =1 i =1 Gaussian distribution, making the kurtosis larger than that
of the EMG. Therefore, the distribution is super-Gaussian
Here, the objective is to separate the subspace of the for the ECG and clearly Gaussian or sub-Gaussian for the
two constituent components of noisy MEG and ECG. These EMG. This property can be enforced into the SSA
components are separated through a constrained procedure reconstruction algorithm as a constraint. A similar
of configuring X and the SVD operation. Since the desired constraint may be imposed by means of skewness. The first
signal might have different energy level, in this work, there signal component is reconstructed from the eigentriples of
won’t be any assumption about the relationship between the the covariance of the Hankel matrix by sliding a window
order of the eigenvalues and the physiologically dominant over the eigenvalues and select m out of M of them, where
m << M for the signal reconstruction. The desired number of eigentriples 240, the window length 2, while the
reconstructed signal (ECG) is sum of the signals threshold varied from segment to segment.
reconstructed from the eigenvalues (and their corresponding
eigenvectors) within the window in order to have maximum
kurtosis. Other simple criteria such as peak to variance ratio
of the reconstructed signals or more complex ones may also
be adopted.
Another important parameter is the subspace size of
the desired component. For stronger signals the eigenvalues
are in the lower subspaces and for weaker signals their
values fall within higher-band subspaces (usually where the
noise components are). Generally, a signal component can
have eigenvalues in one or more distinct regions of the
eigenspace. Both cases are present in this study. Therefore,
to select an optimum m (may be denoted as b) the following
constrained problem can be solved iteratively using a
hierarchical search procedure:
b = min (m)
m
(4)
s.t. having max (Kurt[ st ]) & min < s i , s j >
Fig. 1. Separation of EMG and ECG signals using the traditional
ALE; top signal is the measuremet, middle signal is the separated
where Kurt denotes kurtosis operation and shows how ECG, and in the bottom row the EMG signal can be viewed.
peaky the signal distribution is, <⋅,⋅> refers to the
correlation between ECG and the rest of the signals, which Both ALE and the proposed CSSA are examined here. In
the ALE, the reference signal is a delayed replication of the
in this case this condition is inherently satisfied, and st
primary signal. Hence, if the autocorrelation coefficients of
refers to the source of interest which in this case is the pure
the noise decay much faster than that of the signal,
ECG. The r value also slightly varies with the total set value
for d. Due to the limited window length and the number of appropriate delay would ensure correlation of the primary
sliding lags the overall searching time is short (∼m×d). The and secondary signal components (i.e., delayed primary) but
EMG component is then easily extracted by subtracting the not that the noise components. Therefore, ALE would be a
estimated ECG from the original signal; well established adaptive filtering approach for restoration
j +b of periodic signals. After processing the data using ALE and
EMG = s t = y t − ∑ yˆ
k = j +1
t (5) the proposed CSSA the segments were joined together to
reconstruct the complete ECG and EMG components. The
data were available from 11 subjects each recorded two
Assuming that the signal with (j+1)th to (j+b)th eigentriple
times, not necessarily from the same position. However, for
has the maximum kurtosis (or peak to variance ratio). Here,
illustration, only one segment of one record from one of the
ŷt is the kth reconstructed component of the signal. It is subjects (selected randomly with no preference) was taken.
interesting to know that often the subspace of the ECG falls Figure 1 shows the results of ALE application. Figure 2
within few last eigenvalues where the noise subspace is (the illustrates the results of application of the proposed CSSA
EMG is stronger than the ECG here). to the same signal segment. In both figures the original
segment has been given in the top row. The separated ECG
3. RESTORATION OF EMG FROM ECG is in the middle row and at the bottom the remaining EMG
(often noisy) is shown. What is very important here is that
A comprehensive experiment was performed on real EMG. the separated ECG using the proposed CSSA method can be
corrupted by noise and ECG. The EMG signals were from directly used for diagnosis of heart clinical status. In other
human forearm recorded using surface EMG. The sampling methods, such as ALE, the separated ECG is not of
frequency was 2 KHz and the subject was relatively relaxed sufficient quality to be used as an indicator of heart
during slow arm movements. The overall recorded data
function. Therefore, the proposed method can indeed be
length was 70 seconds (140Kdata samples), divided into
20K sample segments (10 sec each). In these experiments used for extraction of ECG from noisy EMG easily.
no preprocessing was performed. Therefore, the noisy EMG Primary objective in separation is that the estimated
remained un-altered and the ECG was completely separated. components be independent or uncorrelated. Therefore, as a
For the CSSA all parameters were automatically set as the quantitative or objective assessment when comparing these
two methods, the correlation coefficients of both presenting synthetic data results and secondly, the high
normalized eparated signal components, noise level can be easily seen in the mixed signals in

∑ Figures 1 and 2. Preliminary stages of this technique have


N
ρ= 1
N i =1
EMG (i ) ⋅ ECG (i ) , N = 140000 samples,
also been applied to decomposition of biomedical signals
are calculated. As depicted in Table 1, the value of this successfully [7][8][9].
coefficient for the ALE output is ρALE = 0.121, whereas for
the output of the proposed CSSA this coefficient is 5. ACKNOWLEDGEMENT
negligible (ρ CSSA = 0.0016).
We wish to thank Dr. K. Nazarpour from University of
Newcastle, UK, for providing the data.

6. REFERENCES

[1] B. Azzerboni, M. Carpentieri, F. L. Foresta, and F. C.


Morabito, Neural-ICA and wavelet transform for artifacts
removal in surface EMG, Proc. Int. Joint Conf. Neural
Networks, pp. 3223–3228, 2004.
[2] G. Lu, J.-S. Brittain, P. Holland, J. Yianni, A. L. Green,
J. F. Stein, T. Z. Aziz, and S. Wang, “Removing ECG noise
from surface EMG signals using adaptive filtering,”
Neuroscience Letters, vol. 462 pp. 14–19, 2009.
[3] N. Golyandina, V. Nekrutkin, and A. Zhigljavsky,
Analysis of Time Series Structure: SSA and related
techniques, Chapman & Hall/CRC, New York 2001.
Fig. 2. Separation of EMG and ECG using the proposed CSSA [4] T. H. Alexandrov and N. Golyandina, “The automatic
technique; top signal is the measuremet, middle signal is the extraction of time series trend and periodical components
separated ECG, and the EMG signal can be viewed at the bottom. with the help of the Caterpillar-SSA approach,” Exponenta
Pro 3-4, pp. 54-61, 2004.

TABLE I. Correlation coefficient between the estimated ECG and [5] GISTAT website www.gistatgroup.com.
EMG using both ALE and CSSA methods. [6] O. Haavisto, “Detection and analysis of oscillations in a
ALE CSSA mineral flotation circuit,” Journal of Control Engineering
Practice, vol. 18, Issue 1, pp. 23-30, 2010.
ρ 0.121 0.0016
[7] M. Ghodsi, H. Hassani, and S. Sanei, “Extracting fetal
heart signal from noisy maternal ECG by singular spectrum
analysis,” Journal of Statistics and its Interface, Special
4. CONCLUDING REMARKS Issue on the Appl. of SSA, vol. 3, pp. 399–411, 2010.

In this new application of constrained SSA developed by [8] F. Ghaderi, S. Sanei, and J. McWhirter, “Adaptive
our research group single channel combination of ECG and cancellation of heart sound from respiratory signals using
EMG signals are decomposed without use of any reference Singular Spectrum Analysis,” Proc. of IEEE Int. Workshop
signal. The effectiveness of the proposed CSSA is on Machine Learning for Signal Processing, Finland, 2010.
extremely high mainly because the signal components have [9] M. Ghodsi, H. Hassani, S. Sanei, and Y. Hicks,
distinct subspaces in the covariance eigentriple space of the “Singular spectrum analysis approach for detection of
augmented Hankel matrix. What is important in this single temporomandibular disorder,” Proc. of 56th Session of the
channel source separation is to have the components Int. Statistical Institute, ISI, Portugal, 2007.
statistically defined and are with measurable charac-
[10] S. Haykin, Adaptive Filters, 4th Ed., 2002, Prentice
teristics. In most of the cases such as in the above work, this
Hall.
can be achieved easily. As clarified before, prior to
application of CSSA no preprocessing is necessary. The
assessment against noise level hasn’t been included in this
work because firstly, there is shortage of space for

You might also like