# Extracting Fetal Electrocardiogram from Being Pregnancy Based on Nonlinear Projection

Authors: Truong Quang Dang Khoa; Ho Huu Minh Tam; Vo Van Toi
Journal: Mathematical Problems in Engineering
 (2012)

---

## Abstract

Fetal heart rate extraction from the abdominal ECG is of great importance due to the information that carries in assessing appropriately the fetus well-being during pregnancy. In this paper, we describe a method to suppress the maternal signal and noise contamination to discover the fetal signal in a single-lead fetal ECG recordings. We use a locally linear phase space projection technique which has been used for noise reduction in deterministically chaotic signals. Henceforth, this method is capable of extracting fetal signal even when noise and fetal component are of comparable amplitude. The result is much better if the noise is much smaller (P wave and T wave can be discovered).


---

## Body

## 1. Introduction

Since the early work of Cremer in 1906, various methods for fetal monitoring have been proposed to obtain information about the heart status. The cardiac electrical activity of a fetus can be recorded noninvasively from electrodes on the mother’s body surface. Such recordings of fetal electrocardiograms (ECGs) are complicated by the existence of the mother’s ECG and effectively random contaminations due to noncardiac sources. Furthermore, the fetal signal is rather small due to the size of the fetal heart and the intervening tissue. We have to separate the fetal ECG (FECG) from the maternal trace and from the other contaminations. The ECGs is the tool for the clinical diagnostic because the nonlinear chemilogical excitation of cardiac tissue and signal show both fluctuation and remarkable structure. Moreover, because the length of cardiac cycle which is measured by the distance of two successive QRS spike fluctuates with the predictable component, ECGs is deterministic chaotic. Besides, ECGs also comprise the excitation of the mother, the distortion of tissues on the transmission.In general, linear filter is used to separate signals based on their  difference in frequency domain which can be expressed in terms of Fourier spectrum. However, even the optimal linear filter, the Wiener filter, cannot be successful in this case because ECGs of the pregnant include both maternal and fetal signals which have the same spectral contents, and the noise coming from the electric equipments has a broad band and random [1].Another solution is nonlinear filter which offers some superior features to linear projection in this case. However, because the method is based on theory of deterministic dynamical system, we must make sure that the observed data contents the typical properties of deterministic chaotic signals. We can find it true with ECGs by seeing that the maximal Lyapunov exponent is positive [2].In nonlinear filter, though the fetal signal and maternal signal are similar in shape and spectral contents, we can separate the components by a very natural way: the magnitude and the heart beat. In fact, because the fetal heart is much smaller than the maternal heart, the fetal signal is much smaller than the maternal signal. Generally, the heart beat of the fetus is about one-third of the mother. In fact, our method is used for noise reduction, we just consider fetal signal as a contaminated noise.Up to now, in order to deal with this problem, many works have been done and have given satisfactory results: “wavelet transform” was applied to extract wavelet-based features of fetal signal [3], “blind source separation (BSS)” was used to separate a set of source signal from numerous observed signals [4], “source extraction” is quite related to BSS except using additionally prior information about FECG [5], and some other method such as matched filtering [6], dynamic neural network [7], adaptive neurofuzzy inference systems [8], fuzzy logic [9], frequency tracking [10], and polynomial networks [11].The technique we apply below is actually based on phase space reconstruction. The posttransient trajectory of the system is frequently confined to a set of points in state space called an “attractor” [12]. By using the delay coordinates, attractor is then empirically found to be constrained to a low-dimension manifold [13]. Hence, by estimating the attractor, noise can be reduced by projecting onto it. Whenever a multidimensional reconstruction of a signal can be approximated by a low-dimensional surface (or attractor), a projection onto this surface can improve the signal-to-noise ratio. In the present application, the fetal component is first treated as a contamination of the maternal ECG, whence noise reduction techniques are suitable for signal separation.On the other hand, the extracted FECG recorded in the form of the nonstress test (NST) by using cardiotocography (CTG) was analyzed by wavelets to monitor fetal well-being [14].


## 2. Method

It has been proved that if a system is controled by an attractor, we can find out the dynamics of the full system just by single variables (theorem of Takens). In this paper, we use the delay coordinates ofm dimension. The geometry of a state space trajectory or a shape of attractor can be obtained by using delay coordinates to construct vectors valued time from a single-channel observation (s⃗n,n=m*t,…,N):(2.1)s⃗n=(sn-(m-1)t,sn-(m-2)t,…,sn).Here timen is measured in the sampling intervals, t is called delay or lag, and m is the embedded dimension. All of the vectors are then inserted into a matrix, in this way we can draw delay plots: a plot pf sn versus a delay itself is able to reveal the characteristic of the attractor. According to Taken’s theorem, under general conditions, if the embedded dimension m is large enough, the local topology of the attractor is preserved. This process is called a delay reconstruction in m dimension (see Figure 1).The delay plots of ECG. (a) The delay time is 30 ms; the large resolves the ventricular QRS complex while the smaller features in the center the atriaP wave. (b) The bigger value of lag in comparison to the maternal time scale, we see the huge decrease in resolution of the QRS complex.
(a)(b)For noise reduction, according to Schreiber’s algorithm [12], we have to move all points s⃗n of the phase space to the attractor manifold. First, we have to find the nearest points to s⃗n, called neighbors, within the radius ε and the set of these points called Un. In addition, the number of neighbor |Un| should not be lower than a specified number which is usually 50 [15]. From here, we compute the mean:(2.2)〈s⃗〉(n)=1|Un|∑k∈Uns⃗k.Then we compute the covariance matrix:(2.3)Cij(n)=∑sn′⃗∈Un[R(s⃗n′-〈s⃗〉(n))]i[R(sn′⃗-〈s⃗〉(n))]j.R is a weight matrix R which is chosen to be diagonal with R11 and Rmm large (about 1000) and all other diagonal entries Rii=1. This makes the two largest eigenvalue of C(n) lying in subspace spanned by the first and the last coordinates of embedded space and prevents the correction vector from having any component in these direction.Particularly, when using MATLAB, instead of using the for loop to compute covariance matrix, the method we use is a little bit different. First, we create a “deviation” matrixD(n) whose each column is the “deviation” vector δ⃗j(n)=R*(s⃗n-s⃗j)(s⃗j∈Un). Then, the covariance matrix in equation is computed simply by  C(n)=transpose(D(n))*D(n). Empirically, this makes the result more accurate and much faster than using for loop.In the next step, we determine the orthonormal eigenvectorcq⃗ and the eigenvalue of C(n). The eigenvector of C(n) represent the semiaxes of the ellipsoid best approximating the cloud of neighbor points Un. Ideally, the largest eigenvalues of the covariance matrix span the attractor manifold and the lower span the others. Projecting vector onto the subspace spanned by the largest eigenvalue will move it closer to the attractor manifold thereby creating a more accurate approximation of the true dynamics of the system, because the contaminating noise and the fetal signal span in another subspace.(2.4)s⃗̂=sn⃗-R-1∑q=1Qcq⃗[cq⃗⋅R(sn⃗-〈s⃗〉(n))],
(where Q is the number of dimensions of the manifold that will be locally approximate by Q eigenvector corresponding to the largest eigenvalues).When the projection is finished for all the points, we will getm corrected vector because each element in scalar time series exists in m vector. Therefore, we just average them all; this will not project the vector exactly to the manifold but will still move it closer to the manifold.In this algorithm, there are three important parameters: the embedded window(m-1)t which is used to select components by time scale, the radius of cloud of neighborhood points which is used to select components by magnitude, and the number of dimension of the manifold Q.In order to choose an optimalm, many studies have been done. According to [2], m should be large for two reasons. First, the larger m is, the more deterministic signs are presented in the dataset. In fact, due to the fluctuating of body condition such as the respiration, the biological signal such as ECG becomes nonstationary and that violates the condition to apply the locally projective noise reduction. A solution is to increase m. Instead of using m>2D in Taken’s theory, m>2(D+P) is used where P is the number of nonstationary parameters [16]. Although, mathematically, P must form a stationary chaotic system, this still works well if the nonstationary component varies slowly and rarely has any sudden change. The other reason is that with the large m, the selectivity or appropriate neighbor is increased because we are using max norm to define the distance between neighbors. For more precise value of m, the technique of Kennel and Abarbanel [17] is often used, which examines whether points that are near neighbors in this dimension are still near neighbor in the next dimension. Empirically, the larger m  is, the fewer false neighbors and the more fully the image unfolded.In alliance withm, choosing t is a very important factor. A suitable t should fulfill two criteria. First, t must be large enough compared to the time scale or the two successive s⃗n or they will be strongly correlated, that is, the value of the time series at i must be significantly different form its value at i+t. Therefore, we can gather enough information to successfully reconstruct all whole phase space with the reasonable choice of m. Another criteria is that t must not be too large than the time scale of the system, in which the two successive s⃗n will be independent and uncorrelated [18, 19], and the system will lose memory of its initial state. According to [18], it has been showed that the optimal value of t is typically around 1/10-1/2 of the mean orbital period of the attractor. Often value of t is around the correlation time.Finally,ε should be larger than the noise amplitude and the fetal amplitude (when the fetal signal is considered as a contaminated noise), but still small enough not to average out the curvature radius of the time series to reserve the manifold shape. However, if we find the neighbors for all points in phase space by using fixed ε will not give a good result. In this paper, we use a graph between the number of neighbor versus distance to determine ε for each point in phase space (see Figure 2 for relation between ε and distance).Figure 2
Number of neighbor versus distance.In the graph, each curve represent one point in phase space. Clearly, we can see that it is separated into 3 parts. Part (a) is those points which lay on the peaks of ECG, part (b) is those points which lay on the peaks of FECG, part (c) is other points. Thus, basing on the slope and the height of the curve, we can apply this simple rule for better filter: because our aim is to calculate the fetal heart beat,ε should be sufficiently large for the (b) part, and for avoiding distortion, ε should be fair small for the (a) and (c) parts. However, at the (b) part, there is, in fact, some points that does not lay on the FECG’s peak. The number of those points is few but the reason for this phenomenon is unknown. Fortunately, in some dataset, we find out that its slope is larger than the points lying on the FECG’s peak when the number of neighbor grow sufficiently large (about > 150). Note that this method is primarily used in the first filtering for we need to avoid the large distortion at this point (large error will severely affect the second filtering), while in the second filtering, we will come back with the fix ε to suppress the noise better. In further research, a better rule or algorithm for the neighbor finding procedure may solve this problem.Besides, we approximate the attractor as a collection of locally linear manifolds. For example, the loop can be approximated by a collection of short line segments; in this case the approximating manifold is one dimensional. When the embedding dimensionm is larger than two, it can be appropriate to select locally linear manifold with dimension Q where 1≤Q<m. For instance Q=2, the manifold is locally planar.In order to acquire FECG, in this paper, we will follow this strategy. First step, using Schreiber’s algorithm for the input data to extract to clear ECG, without noise and fetal signal. Second, subtracting the input data with the clear ECG to acquire the secondary input (including noise and fetal signal). The last step, using Schreiber’s algorithm again for the secondary input data to extract the clear FECG. The first and the last step should be repeated 2-3 times to get a better result. In sum, there are a lot of tradeoffs in choosing parameters and times of iteration, so that we have do a careful visual inspection of time series and few test runs to find the optimal results (see Figure3).Figure 3
The processing diagram.


## 3. Result

### 3.1. Artificial Signal

At first, we generate an artificial ECG by repeating one clear heart cycle of mother (the sample rate is 4 ms), plus the fake fetal signal created by scale artificial mother signal and then plus random noise following the Gaussian distribution (see Figure4).Figure 4
The artificial ECG.(a) Clean FECG RMS: Noise RMS = 1 : 1 (noise ratio = 1 : 1).Following the following strategy, at first, to extract the clear ECG, we form an embedded window of 200 ms (equal 1/3 heart cycle of the mother) withm=51 and t=1 and using dynamic ε. Q around 2 is enough to reconstruct the phase space. The noise reduction ratio R=1.426 (see Figure 5).Figure 5
The artificial ECG after the first filtering.After that, the secondary input (using dynamicε) is processed again with the embedded window (m=61,t=1).  With Q of about 3, we will get the noise reduction ratio R=1.265, and see that P wave and T wave are distorted. However, we just need to calculate the fetal heart beat so that the result is good enough (see Figure 6).(a) The artificial FECG after the second filtering with the secondary input is the result of subtracting the artificial ECG to the filtered itself. (b) The true FECG.
(a)(b)(b) Clean FECG RMS: Noise RMS = 1 : 5 (noise ratio = 1 : 5).The first filtering (using dynamicε) is done with m=71 and t=1, we will get the noise reduction equal to 2.58. However, the noise ratio is too large so that none of the characteristic of the FECG is reserved, thus the FECG extraction failed (see Figure 7).(a) The artificial ECG. (b) ECG after the first filtering. (c) The extracted FECG, nothing is revealed here cause the FECG extraction failed.
(a)(b)(c)


### 3.2. In the Real World

The entire following sample is taken from MIT website [20].(1) ECG 23rd Weeks
Because the fetus has grown a lot, the magnitude of the fetal signal is quite big so that its heart beat can be seen virtually.
The first filtering is quite good despite the distortion at theT wave. For this result, we use m=31,t=1, dynamic ε. The manifold dimension Q is 2 (see Figure 8).
For extracting the fetal signal, the next filtering is done withm=81,t=1, using fix ε = 1.5. The manifold dimension Q is 15. The extracted FECG lacks many details of P wave and T wave, its shape is distorted a lot. Due to the nonstationary characteristic of the real ECGs, the neighbor versus distance graph becomes somehow unstable (some points do not lay on the FECG’s peak also have a slope as steep as the ones on the FECG’s peak), this makes it quite difficult to extract the FECG at the “nonstationary” section (using dynamic ε) (see Figure 9).
For comparison, we add here a result of Martín-Clemente et al. [21] which uses fast ICA. Clearly, the applied sample is more stationary than ours and its amplitude is a little bit larger than either of them may be in the same weeks. Hence, the result is very clear while ours is still interfered by some unwanted harmonics as Figure 7. Though the main purpose is to measure only the fetal heart beat, our algorithm still meets the requirement with just one channel.Figure 8
Blue line is the measured data. Green line is the clear ECG.Figure 9
The extracted FECG, although it cannot be used for diagnosis, it is still good to calculate the heart rate.(2) ECG 25th Weeks
In this case, the fetal signal is very small; the noise ratio is large so that any effort to recover FECG fails because our algorithm will average both noise and FECG. This phenomenon happens because at this time, the fetus will create a membrane to cover itself, thus the fetal heart beat signal received at the probe will be greatly reduced (see Figure10).(a) Almost blue line is the measured data. Red line is the clear ECG. (b) All peaks of the FECG have been disappeared. This result is totally useless.
(a)(b)(3) ECG 38th Weeks
At this time, the fetus has grown a lot, its heart beat is bigger as well. Thus the noise ratio is lower, then we can calculate its heart beat once again.
The first filtering is done withm=41,t=1,Q=2, using dynamic ε. Then the second filtering is done with m=111,t=1,Q=2, using fix ε = 0.75 (see Figure 11).(a) Green line is the measured data. (b)  The extracted FECG, due to the larger noise ratio (compare to ECG 23rd weeks), the result is not as good but it is good for heart beat counting.
(a)(b)


## 3.1. Artificial Signal

At first, we generate an artificial ECG by repeating one clear heart cycle of mother (the sample rate is 4 ms), plus the fake fetal signal created by scale artificial mother signal and then plus random noise following the Gaussian distribution (see Figure4).Figure 4
The artificial ECG.(a) Clean FECG RMS: Noise RMS = 1 : 1 (noise ratio = 1 : 1).Following the following strategy, at first, to extract the clear ECG, we form an embedded window of 200 ms (equal 1/3 heart cycle of the mother) withm=51 and t=1 and using dynamic ε. Q around 2 is enough to reconstruct the phase space. The noise reduction ratio R=1.426 (see Figure 5).Figure 5
The artificial ECG after the first filtering.After that, the secondary input (using dynamicε) is processed again with the embedded window (m=61,t=1).  With Q of about 3, we will get the noise reduction ratio R=1.265, and see that P wave and T wave are distorted. However, we just need to calculate the fetal heart beat so that the result is good enough (see Figure 6).(a) The artificial FECG after the second filtering with the secondary input is the result of subtracting the artificial ECG to the filtered itself. (b) The true FECG.
(a)(b)(b) Clean FECG RMS: Noise RMS = 1 : 5 (noise ratio = 1 : 5).The first filtering (using dynamicε) is done with m=71 and t=1, we will get the noise reduction equal to 2.58. However, the noise ratio is too large so that none of the characteristic of the FECG is reserved, thus the FECG extraction failed (see Figure 7).(a) The artificial ECG. (b) ECG after the first filtering. (c) The extracted FECG, nothing is revealed here cause the FECG extraction failed.
(a)(b)(c)


## 3.2. In the Real World

The entire following sample is taken from MIT website [20].(1) ECG 23rd Weeks
Because the fetus has grown a lot, the magnitude of the fetal signal is quite big so that its heart beat can be seen virtually.
The first filtering is quite good despite the distortion at theT wave. For this result, we use m=31,t=1, dynamic ε. The manifold dimension Q is 2 (see Figure 8).
For extracting the fetal signal, the next filtering is done withm=81,t=1, using fix ε = 1.5. The manifold dimension Q is 15. The extracted FECG lacks many details of P wave and T wave, its shape is distorted a lot. Due to the nonstationary characteristic of the real ECGs, the neighbor versus distance graph becomes somehow unstable (some points do not lay on the FECG’s peak also have a slope as steep as the ones on the FECG’s peak), this makes it quite difficult to extract the FECG at the “nonstationary” section (using dynamic ε) (see Figure 9).
For comparison, we add here a result of Martín-Clemente et al. [21] which uses fast ICA. Clearly, the applied sample is more stationary than ours and its amplitude is a little bit larger than either of them may be in the same weeks. Hence, the result is very clear while ours is still interfered by some unwanted harmonics as Figure 7. Though the main purpose is to measure only the fetal heart beat, our algorithm still meets the requirement with just one channel.Figure 8
Blue line is the measured data. Green line is the clear ECG.Figure 9
The extracted FECG, although it cannot be used for diagnosis, it is still good to calculate the heart rate.(2) ECG 25th Weeks
In this case, the fetal signal is very small; the noise ratio is large so that any effort to recover FECG fails because our algorithm will average both noise and FECG. This phenomenon happens because at this time, the fetus will create a membrane to cover itself, thus the fetal heart beat signal received at the probe will be greatly reduced (see Figure10).(a) Almost blue line is the measured data. Red line is the clear ECG. (b) All peaks of the FECG have been disappeared. This result is totally useless.
(a)(b)(3) ECG 38th Weeks
At this time, the fetus has grown a lot, its heart beat is bigger as well. Thus the noise ratio is lower, then we can calculate its heart beat once again.
The first filtering is done withm=41,t=1,Q=2, using dynamic ε. Then the second filtering is done with m=111,t=1,Q=2, using fix ε = 0.75 (see Figure 11).(a) Green line is the measured data. (b)  The extracted FECG, due to the larger noise ratio (compare to ECG 23rd weeks), the result is not as good but it is good for heart beat counting.
(a)(b)


## 4. Conclusion

According to all results we got, this algorithm can be mainly used for counting the heart beat because many details such asP wave and T wave are distorted, few peaks of FECG disappear sometimes. on the other hand, if we want a better result, the diagnosis will be done after the 38th week or before the 25th week. This is a physiological characteristic that was reconfirmed by our results.However, these results still show the dominance over the linear method which is based on frequency domain to separate signal. In our method, we define the difference between ECG and FECG in a very natural way: amplitude and time scale. The natural language to implement such filtering procedures is in terms of the geometry in a reconstructed state space. Here, we have estimated the geometry of the maternal ECG using projections onto locally linear surfaces, which proves effective at filtering FECG from the measured signal.In further works, some automatic information extraction method may be applied to test the efficiency of this method in reality as well as the development of a better algorithm or the research for the optimal parameters will be carried out to reserve as much information as possible for further diagnosis, manually or automatically.



---

*Source: 439084-2012-03-22.xml*