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


A simple and extremely effective method for extraction of EMGs recorded in patients with cervical dystonia. Even in
electrocardiography (ECG) signal from noisy single channel this approach an ECG signal recorded from a separate
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
Index Terms—EMG, Constrained SSA, ECG, ALE. from the noisy EMG recording. We call this method
constrained SSA (CSSA). The method is compared with
1. INTRODUCTION adaptive line enhancer (ALE) [10], as the benchmark for de-
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
widely adopted in the study of motor function and of the ECG is taken into account. The result of the CSSA
movement disorders. Surface EMGs represent a approach is remarkable. High performance of the method
superposition of electrical activities from motor unit action can be easily verified both subjectively and objectively as
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,

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 ©2011
nonstationary,
978-1-4577-0274-7/11/$26.00 IEEE almost X1  1u1v1 associated with the first singular values).
deterministic and noisy time series are to be analyzed. A
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 , x2 ,..., xk ] the desired component. Then the matrix X corresponding
ˆ
I
 f1 f2 . . fk 1  to the group I is defined as
ip
X   ji1 X . In splitting
f0 
 . ˆ
I
j

 f1 f2 f3 . . . fk  the set of indices J = {1, . . . , d} into disjoint subsets I1 to Im


  f2 f3 f4 . . f (1)
we always have
 I
.
k 1
 
 ⁝ ⁝ ⁝ ⋱ ⁝  X m (3)

j
 f l 1 fl . . fr 1 
 f jI1
l 1 .

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
d
should be sufficiently large. Note that the trajectory matrix . In the next step the obtained matrix is
 i
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
vi  XT ui i , then the SVD of the trajectory matrix 2.3. Constrained SSA

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   Xi   i ui vTi (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 reconstructed signal (ECG) is sum of the signals
reconstructed from the eigenvalues (and their corresponding number of eigentriples 240, the window length 2, while the
eigenvectors) within the window in order to have maximum threshold varied from segment to segment.
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)
Fig. 1. Separation of EMG and ECG signals using the traditional
s.t. having maxKurt[st ] & min  si , s j  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
in this case this condition is inherently satisfied, and st the ALE, the reference signal is a delayed replication of the
primary signal. Hence, if the autocorrelation coefficients of
refers to the source of interest which in this case is the pure
ECG. The r value also slightly varies with the total set value the noise decay much faster than that of the signal,
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   yt 
 (5) the proposed CSSA the segments were joined together to
st yˆ t k  j reconstruct the complete ECG and EMG components. The
1

Assuming that the signal with (j+1)th to (j+b)th eigentriple data were available from 11 subjects each recorded two
has the maximum kurtosis (or peak to variance ratio). Here, times, not necessarily from the same position. However, for
yˆ t is the kth reconstructed component of the signal. It illustration, only one segment of one record from one of the
subjects (selected randomly with no preference) was taken.
is interesting to know that often the subspace of the ECG
Figure 1 shows the results of ALE application. Figure 2
falls within few last eigenvalues where the noise subspace is
illustrates the results of application of the proposed CSSA
(the 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
human forearm recorded using surface EMG. The sampling directly used for diagnosis of heart clinical status. In other
frequency was 2 KHz and the subject was relatively relaxed methods, such as ALE, the separated ECG is not of
during slow arm movements. The overall recorded data sufficient quality to be used as an indicator of heart
length was 70 seconds (140Kdata samples), divided into function. Therefore, the proposed method can indeed be
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
 N 1 EMG(i)  , N = 140000 samples, Figures 1 and 2. Preliminary stages of this technique have
ECG(i)
 N i1 are calculated. As depicted in Table 1, the value of this
coefficient for the ALE output is ALE = 0.121, whereas for also been applied to decomposition of biomedical signals
the output of the proposed CSSA this coefficient is successfully [7][8][9].
negligible ( CSSA = 0.0016).
5. ACKNOWLEDGEMENT

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,
Fig. 2. Separation of EMG and ECG using the proposed CSSA Analysis of Time Series Structure: SSA and related
technique; top signal is the measuremet, middle signal is the techniques, Chapman & Hall/CRC, New York 2001.
separated ECG, and the EMG signal can be viewed at the bottom. [4] T. H. Alexandrov and N. Golyandina, “The automatic
extraction of time series trend and periodical components
with the help of the Caterpillar-SSA approach,” Exponenta
TABLE I. Correlation coefficient between the estimated ECG and Pro 3-4, pp. 54-61, 2004.
EMG using both ALE and CSSA methods.
ALE CSSA [5] GISTAT website www.gistatgroup.com.
[6] O. Haavisto, “Detection and analysis of oscillations in a
 0.121 0.0016 mineral flotation circuit,” Journal of Control Engineering
Practice, vol. 18, Issue 1, pp. 23-30, 2010.
[7] M. Ghodsi, H. Hassani, and S. Sanei, “Extracting fetal
4. CONCLUDING REMARKS heart signal from noisy maternal ECG by singular spectrum
analysis,” Journal of Statistics and its Interface, Special
In this new application of constrained SSA developed by Issue on the Appl. of SSA, vol. 3, pp. 399–411, 2010.
our research group single channel combination of ECG and
EMG signals are decomposed without use of any reference [8] F. Ghaderi, S. Sanei, and J. McWhirter, “Adaptive
signal. The effectiveness of the proposed CSSA is cancellation of heart sound from respiratory signals using
extremely high mainly because the signal components have Singular Spectrum Analysis,” Proc. of IEEE Int. Workshop
distinct subspaces in the covariance eigentriple space of the on Machine Learning for Signal Processing, Finland, 2010.
augmented Hankel matrix. What is important in this single [9] M. Ghodsi, H. Hassani, S. Sanei, and Y. Hicks,
channel source separation is to have the components “Singular spectrum analysis approach for detection of
statistically defined and are with measurable charac- temporomandibular disorder,” Proc. of 56th Session of the
teristics. In most of the cases such as in the above work, this Int. Statistical Institute, ISI, Portugal, 2007.
can be achieved easily. As clarified before, prior to
application of CSSA no preprocessing is necessary. The [10] S. Haykin, Adaptive Filters, 4th Ed., 2002, Prentice
assessment against noise level hasn’t been included in this Hall.
work because firstly, there is shortage of space for

You might also like