101
TECHNISCHE UNIVERSIT ¨ AT DRESDEN FAKULT ¨ AT ELEKTROTECHNIK UND INFORMATIONSTECHNIK INSTITUT F ¨ UR BIOMEDIZINISCHE TECHNIK Final Project Title: Processing of abdominal recordings by Kalman filters Submitted by: Marcos Cruz Santiago Born on: 04.06.1987 in Esplugues de Llobregat, Spain Supervisors: Dr.-Ing. Sebastian Zaunseder (IBMT) Responsible Professor: Prof.Dr.-Ing.habil. Hagen Malberg (IBMT) Submitted on: April 14 th , 2012

TECHNISCHE UNIVERSITAT DRESDEN

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: TECHNISCHE UNIVERSITAT DRESDEN

TECHNISCHE UNIVERSITAT DRESDEN

FAKULTAT ELEKTROTECHNIK UNDINFORMATIONSTECHNIK

INSTITUT FUR BIOMEDIZINISCHE TECHNIK

Final Project

Title: Processing of abdominal recordings by Kalmanfilters

Submitted by: Marcos Cruz Santiago

Born on: 04.06.1987 in Esplugues de Llobregat, Spain

Supervisors: Dr.-Ing. Sebastian Zaunseder (IBMT)Responsible Professor: Prof.Dr.-Ing.habil. Hagen Malberg (IBMT)Submitted on: April 14th, 2012

Page 2: TECHNISCHE UNIVERSITAT DRESDEN

Acknowledgement

I hereby declare that the present work submitted to the examination board from the FakultatElektrotechnik und Informationstechnik with the Final Project entitled

Processing of abdominal recordings by Kalman filters

that has been completely written by me, the undersigner, and that I have not used any otherdocument other than the specified means, materials and references. All references andresources used by me in this work are properly cited within it.

Dresden, April 14th, 2012

Marcos Cruz Santiago

Final Project - Marcos Cruz Santiago ii

Page 3: TECHNISCHE UNIVERSITAT DRESDEN

Abstract

Heart diseases are the cause of many deaths during prenatal, childbirth and newborn periods.Therefore, the study of the fetal cardiac signals might be very helpful in order to evaluate thefetal heart status for early detection of cardiac abnormalities.

The recent trend in obtaining the fetal electrocardiogram (fECG) is to record signals in a noninvasive way, by using surface electrodes placed on the maternal abdomen. Extracting the fetalcomponent from this abdominal recordings is a challenging task due to the low energy of thefECG, which often is buried into maternal electrocardiography and noise sources.

Although an extraction method for this purpose was developed at IBMT based on the EventSynchronous Canceller (ESC) method, the obtained results were still not enough accurate. Thus,this present study contemplates the implementation of a method that can improve the lastobtained results. The chosen implemented scheme within this work is a Kalman filter (KF)based approach. Besides, a theoretical base of KF’s algorithm, various examples of its usage inthe general area of the ECG processing are given. This work establishes the possibility of newworks related to this technique in the IBMT department.

Moreover, this work continues the collaboration between IBMT and the University Hospitalof Leipzig and therefore the algorithm has not only been tested with simulated data but alsowith real data obtained in the Hospital of Leipzig.

Finally, the obtained achievements have been contrasted and compared with the former de-veloped method within this department. The KF based scheme has not only been capable ofsuccessfully extracting the fECG from abdominal recordings, but also it has shown to be morerobust than the previous scheme.

Final Project - Marcos Cruz Santiago iii

Page 4: TECHNISCHE UNIVERSITAT DRESDEN

Zusammenfassung

Unerkannte Herzleiden des Fotus sind Ursache zahlreicher todlicher Komplikationen, welche vor,wahrend, und kurz nach der Geburt auftreten. Aus diesem Grund kann das Studium fetalerHerzsignale sehr hilfreich sein, um den kardialen Zustand zu bewerten und damit Auffalligkeitenfruhzeitig zu erkennen.

Der aktuelle technische Stand ist das nichtinvasive Ableiten des fetalen Elektrokardiogramms(fEKG) mittels auf den Unterleib der Mutter aufgeklebten Oberflachenelektroden. Die Ex-traktion der fetalen Komponente aus diesen Ableitungen ist eine große Herausforderung. Dieinteressierenden Signale besitzen nur eine geringe Energie, sie sind daher oft vom EKG derMutter und von allgemeinen Storungen verdeckt.

Ein am IBMT bereits entwickeltes Verfahren zur Extraktion, welches auf der ”Event Syn-chronous Canceller (ESC)”-Methode basiert, generierte verbesserungsfahige Ergebnisse. Ausdiesem Grund betrachtet diese Arbeit die Umsetzung einer Methode, welche die zuletzt erzeugtenResultate verfeinern kann. Der in dieser Arbeit genutzte Entwurf ist eine Kalman-Filter (KF)basierte Herangehensweise. Die theoretischen Grundlagen von KF-Algorithmen sind durch ver-schiedenartige Anwendungsbeispiele, im allgemeinen Bereich der EKG-Verarbeitung, gegeben.Diese Arbeit begrundet die Sinnhaftigkeit weiterer Forschungen am Institut mit diesem Ver-fahren.

Daruber hinaus wird die bestehende Zusammenarbeit zwischen dem IBMT und dem Univer-sitatskrankenhaus Leipzig fortgefuhrt. Der Algorithmus kann damit, neben simulierten Daten,auch an Patientendaten, welche am Universitatsklinikum aufgenommen wurden, getestet wer-den.

Zum Schluss werden die erreichten Ergebnisse der bereits entwickelten Methode gegenuber-gestellt. Der KF-basierte Entwurf ist nicht nur imstande das fEKG erfolgreich aus abdomi-nal gewonnenen Daten zu extrahieren, es hat sich außerdem gezeigt, dass er robuster als dasvorherige Verfahren ist.

Final Project - Marcos Cruz Santiago iv

Page 5: TECHNISCHE UNIVERSITAT DRESDEN

Resumen

Las enfermedades del corazon son la causa de muchas muertes prenatales, en el parto o durantelos primeros meses de vida. Por lo tanto, el estudio de las senales cardıacas fetales puede sermuy beneficioso para evaluar el estado del corazon del feto con motivo de detectar rapidamenteanomalıas cardıacas.

La reciente tendencia en la obtencion de electrocardiogramas fetales (fECG) es grabar senalesde manera no invasiva, usando electrodos superficiales ubicados en el abdomen materno. Laextraccion del componente fetal a partir de esas grabaciones abdominales se trata de una tareacomplicada debido a la pequena energıa del fECG, la cual a menudo, es enmascarada debido alelectrocardiograma materno y a las fuentes de ruido.

A pesar de que un metodo de extraccion para este proposito fue desarrollado en el IBMTbasado en el Event Synchronous Canceller (ESC), los resultados obtenidos no fueron aun losuficientemente precisos. Por lo tanto, este presente estudio contempla la posibilidad de la im-plementacion de un metodo que pueda mejorar los anteriores resultados obtenidos. El esquemaelegido a implementar en este trabajo es uno basado en filtro de Kalman (KF). Ademas sepresenta una base teorica del algoritmo del KF y varios ejemplos de su uso en el area gen-eral del procesamiento de ECG. Este trabajo establece la posibilidad de nuevas investigacionesrelacionados con esta tecnica en el departamento de IBMT.

Este proyecto continua la colaboracion entre IBMT y el hospital universitario de Leipzig, ypor lo tanto, el algoritmo no solo ha sido probado con datos simulados sino que tambien lo hasido con datos reales obtenidos en dicho hospital.

Finalmente, los resultados obtenidos han sido contrastados y comparados con los conseguidospor el metodo anterior desarrollado en este departamento. El esquema basado en KF no soloha sido capaz de extraer satisfactoriamente el fECG de las grabaciones abdominales, sino quetambien ha mostrado ser mas robusto que el esquema anterior.

Final Project - Marcos Cruz Santiago v

Page 6: TECHNISCHE UNIVERSITAT DRESDEN

Resum

Les malalties del cor son la causa de moltes morts prenatals, en el part o durant els primersmesos de vida. Per tant, l’estudi dels senyals cardıaques fetals pot ser molt beneficios per avaluarl’estat del cor del fetus amb motiu de detectar rapidament anomalies cardıaques.

La recent tendencia en l’obtencio de electrocardiogrames fetals (fECG) es gravar senyals demanera no invasiva, usant electrodes superficials ubicats a l’abdomen matern. L’extracciodel component fetal a partir d’aquestes gravacions abdominals es tracta d’una tasca com-plicada a causa de la petita energia del fECG, la qual sovint, es emmascarada a causa del’electrocardiograma matern i a les fonts de soroll.

Tot i que un metode d’extraccio per a aquest proposit va ser desenvolupat a l’IBMT basat en elEvent Synchronous canceller (ESC), els resultats obtinguts no van ser encara prou precisos. Pertant, aquest present estudi contempla la possibilitat de la implementacio d’un metode que puguimillorar els anteriors resultats obtinguts. L’esquema triat a implementar en aquest treball es unbasat en el filtre de Kalman (KF). A mes es presenta una base teorica de l’algorisme del KF idiversos exemples del seu us en l’area general del processament d’ECG. Aquest treball estableixla possibilitat de noves investigacions relacionats amb aquesta tecnica en el departament deIBMT.

Aquest projecte continua la col·laboracio entre IBMT i l’hospital universitari de Leipzig, i pertant, l’algorisme no nomes ha estat provat amb dades simulades sino que tambe ho ha estat ambdades reals obtingudes en aquest hospital.

Finalment, els resultats obtinguts han estat contrastats i comparats amb els aconseguits pelmetode anterior desenvolupat en aquest departament. L’esquema basat en KF no nomes ha estatcapac d’extreure satisfactoriament el fECG dels enregistraments abdominals, sino que tambe hamostrat ser mes robust que l’esquema anterior.

Final Project - Marcos Cruz Santiago vi

Page 7: TECHNISCHE UNIVERSITAT DRESDEN

Contents

List of Tables ix

List of Figures xi

Symbols xii

List of Abbreviations xiv

1. Introduction 11.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.2. Aim of the Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.3. Brief Overview of this Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2. State of the Art 32.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32.2. Kalman Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

2.2.1. Kalman Filter Formulation . . . . . . . . . . . . . . . . . . . . . . . . . . 52.2.2. Extended Kalman Filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212.2.3. Extended Kalman Smoother . . . . . . . . . . . . . . . . . . . . . . . . . 262.2.4. Other variants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26

2.3. Application of Kalman Filters in ECG processing . . . . . . . . . . . . . . . . . . 292.3.1. ECG denoising . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292.3.2. Parameters estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.3.3. Other related uses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

3. Implementation 343.1. Test Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

3.1.1. Simulated Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 343.1.2. Real Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

3.2. Extraction Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403.2.1. Preprocesing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423.2.2. Observation Equations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423.2.3. Dynamic ECG Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.2.4. Maternal ECG filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463.2.5. fECG subtraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523.2.6. Peak detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

3.3. Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

4. Results 554.1. Results on Simulated Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55

4.1.1. Results with different noise sources . . . . . . . . . . . . . . . . . . . . . . 554.1.2. Results with different wrapping times . . . . . . . . . . . . . . . . . . . . 58

4.2. Results with different peak detectors . . . . . . . . . . . . . . . . . . . . . . . . . 59

vii

Page 8: TECHNISCHE UNIVERSITAT DRESDEN

Contents

4.3. Results on Real Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 594.4. Results with different filter methods . . . . . . . . . . . . . . . . . . . . . . . . . 59

4.4.1. Results of EKF towards EKS . . . . . . . . . . . . . . . . . . . . . . . . . 614.4.2. Results of EKS towards ESC . . . . . . . . . . . . . . . . . . . . . . . . . 62

5. Discussion and Conclusions 665.1. Discuss of the Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

5.1.1. General performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 665.1.2. Noise sources evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695.1.3. Optimal time of phase wrapping . . . . . . . . . . . . . . . . . . . . . . . 715.1.4. Influence of the peak detector . . . . . . . . . . . . . . . . . . . . . . . . . 715.1.5. Comparison between different methods . . . . . . . . . . . . . . . . . . . . 71

5.2. Future works on this Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745.2.1. System improvement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 745.2.2. Improvement on QRS detector . . . . . . . . . . . . . . . . . . . . . . . . 745.2.3. Multichannel approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

5.3. Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

A. Publication a

B. Data CD f

Final Project - Marcos Cruz Santiago viii

Page 9: TECHNISCHE UNIVERSITAT DRESDEN

List of Tables

3.1. Noise sources from abdominal recordings characterization. . . . . . . . . . . . . . 343.2. Channels used in annotations of real data signals . . . . . . . . . . . . . . . . . . 383.3. Model parameters table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

4.1. Sensitivity for fixed wrapping time in different simulated noise sources for EKSfiltering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

4.2. Exemplary statistics for one specific noise source, fetal-maternal SNR and band-width . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56

4.3. Comparison of sensitivity and positive predictivity of EKS with a different peakdetector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59

4.4. Channels used in annotations of real data signals . . . . . . . . . . . . . . . . . . 604.5. Resulting statistics for real data . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604.6. Sensitivity and positive predictivity for fixed wrapping time for EKS and EKF . 614.7. Comparison of sensitivity and positive predictivity between ESC and EKS . . . . 64

5.1. Number of overlapping maternal and fetal R-peaks over the various datasets . . . 675.2. Sensitivity and positive predictivity for ESC and EKS with a different peak detector 73

ix

Page 10: TECHNISCHE UNIVERSITAT DRESDEN

List of Figures

2.1. General scheme of Kalman filter variants . . . . . . . . . . . . . . . . . . . . . . . 52.2. Typical Kalman filter application . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.3. Example of conditional probability density . . . . . . . . . . . . . . . . . . . . . . 72.4. Typical system bandpass curve on a plot of power spectral density vs frequency . 82.5. Conditional density of position based on an observed measurement, zt1 . . . . . . 92.6. Conditional density of position based on measurement zt2 . . . . . . . . . . . . . 102.7. Conditional density of position based on data zt1 and zt2 . . . . . . . . . . . . . . 112.8. Propagation of conditional probability density . . . . . . . . . . . . . . . . . . . . 122.9. A representation of a linear system . . . . . . . . . . . . . . . . . . . . . . . . . . 142.10. Model underlying the Kalman filter . . . . . . . . . . . . . . . . . . . . . . . . . . 152.11. The ongoing discrete Kalman filter cycle . . . . . . . . . . . . . . . . . . . . . . . 182.12. A complete picture of the operation of the Kalman filter . . . . . . . . . . . . . . 202.13. Example of error covariance vs iterations in a attempt to estimate a scalar random

value. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.14. Estimation of a constant value using with a correct estimated error covariance . . 212.15. Estimation of a constant value using with a high estimated error covariance . . . 222.16. Estimation of a constant value using with a low estimated error covariance . . . 232.17. A complete scheme of the operation of the Extended Kalman filter . . . . . . . . 262.18. Scheme with some of the most used Kalman filter variants . . . . . . . . . . . . . 272.19. ECG denoising example using a Bayesian filtering framework . . . . . . . . . . . 302.20. General method for deriving heart rate and blood pressure . . . . . . . . . . . . . 32

3.1. Example of resulting simulated datasets. . . . . . . . . . . . . . . . . . . . . . . . 363.2. Diagram of the new data from Leipzig configuration of the electrodes . . . . . . . 373.3. Screenshot of the program and example of the procedure to make manual anno-

tations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 383.4. Example of annotation procedure in case of evidences of peaks. . . . . . . . . . . 393.5. Example of annotation procedure in case of no evidences of peaks. . . . . . . . . 393.6. Block scheme of a complete system of fECG extraction. . . . . . . . . . . . . . . 413.7. Block scheme of a ECG processing block . . . . . . . . . . . . . . . . . . . . . . . 413.8. Input parameters for EKF/EKS. . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.9. Synthetic ECG generated for test purposes . . . . . . . . . . . . . . . . . . . . . 443.10. Phase Alignment example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473.11. Phase Wrapping example of abdominal recordings . . . . . . . . . . . . . . . . . 483.12. Model estimation example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 493.13. Example with inadequate number of Gaussians to construct the model. . . . . . 503.14. Maternal ECG subtraction from preprocessed data to obtain the estimated fetal

ECG. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

4.1. Behavior for one specific noise source: EM. . . . . . . . . . . . . . . . . . . . . . 564.2. Behavior for one specific noise source: MA. . . . . . . . . . . . . . . . . . . . . . 574.3. Statistical results for different wrapping times . . . . . . . . . . . . . . . . . . . . 58

x

Page 11: TECHNISCHE UNIVERSITAT DRESDEN

List of Figures

4.4. Real data processing example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614.5. Behavior of EKF and EKS while extracting fetal components from abdominal

recordings. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624.6. Analogy between the extraction schemes based on ESC and EKS . . . . . . . . . 634.7. Comparison in the behavior of ESC and EKS . . . . . . . . . . . . . . . . . . . . 65

5.1. Missdetected overlapped peak . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675.2. Erroneous behavior while extracting maternal component . . . . . . . . . . . . . 685.3. Error in peak detections while having big artifacts . . . . . . . . . . . . . . . . . 70

Final Project - Marcos Cruz Santiago xi

Page 12: TECHNISCHE UNIVERSITAT DRESDEN

Symbols

µ ........................................ Meanσ ........................................ Standard deviationσ2 ........................................ Variance or second order statisticE[x] ........................................ Expectation of a random variable xvk ........................................ Stochastic process associated to the sys-

temuk ........................................ Known input vectorwk ........................................ Stochastic process associated to the mea-

surexk ........................................ State of a discrete-time processx0 ........................................ Initial value of the state of a discrete-time

processx−k ........................................ A priori state estimate at step k of xkxk ........................................ A posteriori state estimate at step k of xkxk ........................................ Approximate system state vector at step

kzk ........................................ Output or the observation of a discrete-

time systemzk ........................................ Approximate measurement vector at step

kA ........................................ State transition model which is applied to

the previous state xk−1B ........................................ Control-input model which is applied to

the control vector ukH ........................................ Observation model which maps the true

state space into the observed space ukQk ........................................ Process noise covariance of the stochastic

process associated to the measureRk ........................................ Process noise covariance of the stochastic

process associated to the systeme−k ........................................ A priori estimate errorek ........................................ A posteriori estimate errorexk

........................................ Prediction errorezk ........................................ Measurement residualP−k ........................................ A priori estimate error covariance at step

kP k ........................................ A posteriori estimate error covariance ma-

trix at step kP 0 ........................................ Initial value of the posteriori estimate er-

ror covariance matrix k

xii

Page 13: TECHNISCHE UNIVERSITAT DRESDEN

List of Figures

Kk ........................................ Kalman gain or blending factor at step kI ........................................ Identity matrix kTr ........................................ Trace operator over a Matrixxk ........................................ Approximate state of a discrete-time pro-

cesszk ........................................ Approximate measurement or output of a

discrete-time systemAk ........................................ Jacobian matrix of partial derivatives of f

with respect to xW k ........................................ Jacobian matrix of partial derivatives of f

with respect to wHk ........................................ Jacobian matrix of partial derivatives of h

with respect to xV k ........................................ Jacobian matrix of partial derivatives of h

with respect to vf(·) ........................................ Non-linear function of the state evolutionh(·) ........................................ Non-linear function that describes the re-

lationship the state evolution and the ob-servations

θk ........................................ Phase system stateφk ........................................ Phase observation in form of maternal ref-

erencesai ........................................ Amplitude of the Gaussian terms that

form the KF’s dynamic modelbi ........................................ Width of the Gaussian terms that form

the KF’s dynamic modelη ........................................ Random additive noise that models the in-

accuracies of the dynamic modelω ........................................ Angular frequency required for the dy-

namic modelsk ........................................ Observation measurements in the dy-

namic ECG modelT ........................................ RR-interval period in each ECG cycletwrap ........................................ Wrapping time in secondsNavg ........................................ Number of averaged beats in the ESC

methodfxti |zt1 ,zt2 ...zti (x|z1, z2 . . . zi) ........................................ Conditional probability density of a ran-

dom variable x in a time instant i, condi-tioned to the knowledge of the value of thevector of observation measurement z indifferent time steps t1, t2 . . . ti. z1, z2 . . . zirelate the values of the observation mea-surements.

Final Project - Marcos Cruz Santiago xiii

Page 14: TECHNISCHE UNIVERSITAT DRESDEN

List of Abbreviations

Acc .................................................... AccuracyAR .................................................... Autoregressive processbWa .................................................... Baseline wanderECG .................................................... ElectrocardiogramEHG .................................................... ElectrohysterographyEKF .................................................... Extended Kalman filterEKS .................................................... Extended Kalman smootherEM .................................................... Electrode MotionEMG .................................................... ElectromyographicESC .................................................... Event synchronous cancellerfECG .................................................... Fetal ElectrocardiogramfHR .................................................... Fetal heart rateFIR .................................................... Finite impulse responseGUI .................................................... Graphic User InterfaceICA .................................................... Independent Component AnalysisKF .................................................... Kalman filterMA .................................................... Muscular ArtifactmECG .................................................... Maternal ElectrocardiogramMMSE .................................................... Minimum mean square errorNRSDB .................................................... Normal Sinus Rhythim DatabaseSe .................................................... SensitivitySNR .................................................... Signal to noise ratioUKF .................................................... Unscented Kalman Filter+P .................................................... Positive Predictivity Value

xiv

Page 15: TECHNISCHE UNIVERSITAT DRESDEN

1. Introduction

1.1. Motivation

The assessment of the heart activity represents an integral part in the prenatal medicine. Intothis area, the fetal ECG (fECG) provides a mean to characterize the functional state of thefetal heart. Within this topic a field of actual research and a recent trend in the case of fetalstatus evaluation is to record signals in a non invasive way, using surface electrodes placed on thematernal abdomen. Therefore the derivation of the fECG from abdominal recordings became aconsiderable research area. The most important parameter derived from fECG is fetal heart rate(fHR) [59]. It allows physicians to examine the evolution of the fetus, and classify arrhythmiasas well as identify possible heart diseases. Fortunately the fHR can be derived from abdominalrecordings.

However this extraction remains as an important problem for the biomedical engineeringcommunity, due to the low energy content of the fECG and to the existence of noise and artifactsin the measurements, particularly the maternal ECG (mECG) interference. Unfortunately,fECG and mECG are superimposed in time and frequency which makes the extraction of thefECG from abdominal recordings a challenging task. Thus some interesting clinical applicationslack reliable signal processing tools to extract the weak fECG components contaminated withbackground noise.

A previous work at IBMT [4] showed the possibility to extract the fECG. Moreover, anextraction system was build by applying template subtraction. The proposed method representsa very promising non invasive manner of to evaluating the state of the fetus. However, sincethe developed scheme was still not working perfectly in all the situations, more work had to bedone in this area.

Therefore, an alternative approach to extract the fECG should be developed and a comparisonbetween both methods performed. For the sake of comparison, a Kalman filter (KF) basedapproach was chosen. The choice of KF was derived from the old work, due to its good results,its optimality and structure. Since this is the first work from IBMT with KF, it not only triesto deal with fetal extraction, but the work also tries to provide the background regarding KFbasics as well as an overview of usage of KF in ECG processing, opening the possibility of futureprojects within this department.

This work has been developed at the IBMT from the Technische Universitat Dresden (TUDresden). Thereby, the work continues the collaboration between IBMT and the UniversityHospital of Leipzig, as the real patient-related data were performed and obtained at the Uni-versitatsfrauenklinik Leipzig.

1.2. Aim of the Work

As mentioned before, this work is going to deal two main topics: KF basics and fECG extraction.Regarding the first point and aiming to enable future works from IBMT, the presented studygives a detailed explanation about KF basics, so it can be used as reference for future works.Also, a bibliographical research is presented in order to depict the various usages of KF in ECGprocessing. Regarding the second point, half of this work is focused on describing a method able

1

Page 16: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 1. INTRODUCTION

to extract the fECG component from an abdominal recording along with tests and the study ofthe obtained results.

The aim of this project is, therefore, to cover the following topics:

• Literature research on the applications of Kalman filtering techniques in automated ECGprocessing;

• Implementation of a Kalman filter approach to extract the fetal ECG from abdominalrecordings;

• Editing of abdominal recordings which are derived from Universtatsklinik Leipzig;

• (Comparative) evaluation of the usability of the implemented method to extract the fetalECG.

1.3. Brief Overview of this Work

In the first chapter, an introduction to the work is delineated. Furthermore, motivation thatlead to this study is given. Also, the objectives of the work and a brief overview of the structureof the work are given.

On chapter 2 “State of the Art”, an introduction is done regarding the different methodsapplied in fECG processing. Moreover, a theoretical background of Kalman framework is given.Alongside, different usages of KFs in ECG processing are indicated.

In “Implementation”, chapter 3, is described the method to extract fECG from abdominalrecordings. Within this chapter, also the data used and its obtaining is described. Furthermore,the criterion and the methods for evaluating the results are detailed.

Then in chapter 4 results obtained with the purposed method described within this work areshown. Also comparative results between Kalman filtering and ESC method is held.

At last, in Chapter 5 “Discussion and Conclusions”, results are discussed. The discussionanalyzes weak points of the methods as long as suggestions for improve the described method.Finally, a discussion of future works that can arise from this work and conclusions that arisefrom the work are presented.

Final Project - Marcos Cruz Santiago 2

Page 17: TECHNISCHE UNIVERSITAT DRESDEN

2. State of the Art

In this chapter, the current state of KF applicability and KF bases are stated. First a briefoverview of the different existing techniques for extracting fECG from abdominal recordings isheld in section 2.1. Section 2.2 deals with KF theoretic bases. Finally, in section 2.3 possibleapplications of KF in ECG processing are discussed.

2.1. Introduction

The extraction of fECG from abdominal recordings has been recently an intense field of re-search. It supposes a great challenge due to the low amplitude of the desired signal. Moreover,mECG represents a huge obstacle in the acquisition of fECG, as it is overlapped in time andfrequency. Also the presence of numerous non cardiac ECG contaminants, such as electromyo-graphic (EMG) noise, that overlap with the cardiac components in the frequency domain com-plicate the processing. Bandpass filtering is therefore inadequate to suppress such contaminants.

Nevertheless, there are several approaches for the extraction of small cardiac components inhigh noise environments. However, due to the rather old history of the problem and the richliterature in this field, it is not possible to cover all the existing methods in detail. Neverthelessin this section some of the most commons approaches and their main drawbacks and benefitsare briefly described. An extended literature review can be found in [4].

In early works, fECG detection was done over raw data without any previous processing.In some special cases fetal R-Peaks were reported in which due to vertex presentation of thefetus, peaks appeared as positive peaks while maternal peaks had negative peaks. In such cases,the detection of the fetal RR intervals is rather simple and may be achieved by simple peakdetection, as Larks suggested [30], even without any kind of preprocessing.

Another suitable technique is ensemble averaging of maternal beats in order to subtract aclean mECG to create a template. Then this template is subtracted from abdominal recordingsin order to get the fECG. However this technique requires the average of many beats losing inthe process important inter-beat variations of the cardiac cycle. As an improvement of ensembleaveraging some classical adaptive filters appeared as possible architectures to cancel out noise.Moreover, a very similar group of techniques derived from ensemble averaging also exist. Theevent synchronous canceller (ESC) is a method that belongs to this group. It was developed byUngureanu [64], Andreotti’s version [4] states the precursor of this work.

Due to the non stationary nature of the cardiac signal, techniques as the Wiener filter arediscarded in the ECG processing field. However Wiener filter was designed to work in scenariosin which a signal is overlapped both in time and frequency with noise sources and also it can beapplied either in a casual sense in the time-domain or as the non casual case in the frequencydomain [48]. Nevertheless, Wiener filter was designed to work with stationary signals. Underthe restriction of work Wiener Filter is the optimal linear filtering technique in the MinimumMean Square Error (MMSE) sense [27]. Unfortunately, the Wiener Filter is not expected to givegood results for a noisy ECG.

Another possibility is the Wavelet Denoising, which had become a common practice for de-noising signals with multiresolution characteristics such as abdominal recordings signal in theECG [15].

3

Page 18: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Statistical techniques such as Principal Component Analysis [38], Independent ComponentAnalysis (ICA) and Neural Networks have also been used to extract a statistical-based model ofthe signal and noise, allowing the removal of noise by discarding the dimensions correspondingto noise. Although these are powerful noise filtering schemes and some interesting works arebeing developed with this technique, the model seems to be fairly arbitrary and can be extremelysensitive to small changes in either the signal or the noise. Furthermore, the number of electrodesor channels can be also a problem for methods such as ICA, as they require a minimum numberof channels to work.

Nonlinear projective filtering [55], is another similar method of forming an ad hoc statisticalmodel of the ECG. Although is a method extremely powerful, is extremely computationallyintensive and highly sensitive to outliers and changes in data [23].

Finally, adaptive filters are techniques capable of adapting themselves to different spectralshapes and temporal non-stationarities. From the filtering point of view this filters move thepoles and zeros of their transfer functions according to the signal and noise contents of the inputsignal and the prior model of the signal dynamics [50]. There are some filters, in which, somemodel of the cardiac signal is constructed (either explicitly or implicitly), and used as a referencesignal to constrain the filter to improve the signal-noise separation performance. One of suchtechniques is Bayesian filtering framework which includes Kalman Filters.

2.2. Kalman Framework

In 1960, R.E Kalman wrote his well-known paper describing a recursive solution to the discretedata linear filtering problem [24]. Since that time, Kalman filtering and its applications havebeen the subject of extensive research in large part because of the improvements in digitalcomputing.

Kalman filtering is a method capable to estimate hidden states of a system, that are observ-able through a set of measurements. Moreover, it is proven that KF it is the optimal filterminimizing the minimum mean square error (MMSE) [25] between the state of the system andits estimated value, under certain general constraints: linear system model, white noise andGaussian amplitude distribution of noise (justified in section 2.2.1.2).

One of these constraints states that the noise’s amplitude distribution should be Gaussian.Nevertheless, if the noise is not Gaussian with given only the mean and standard deviation ofnoise, the KF is the best linear estimator.

There are some reasons that make Kalman Filtering widely used, some of the most importantones are the following [26, 66]:

• It achieves good results in practice due to optimality and its structure.

• It is convenient for online real time processing.

• It is easy to formulate and implement given a basic understanding.

• Measurement equations do not need to be inverted.

• It supports estimations of past, present, and even future states.

• It can do so even when the precise nature of the system’s model is unknown.

Conventional KF assumes a linear model for the system dynamics and observation equations.However, in fact, real systems tend to be nonlinear, so for such systems, several variants of theoriginal KF have been developed. In fig. 2.1 a scheme of the most used KF variants is depicted.A explanation of these different types of variants is contained in section 2.2.4.

Final Project - Marcos Cruz Santiago 4

Page 19: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Kalman filter

Extended

Kalman filter

Kalman-Bucy

filter

Ensemble

Kalman filter

Fast Kalman

filter

Colored noise Kalman filter

Sub-optimal

Biased schemes

Non-linearity

Continous-time

Sparse matrices

Figure 2.1.: General scheme depicting the main division groups of Kalman filter variants.

In this section a review on Kalman Basics is contained as well as some of the most importantvariants in the KF family.

2.2.1. Kalman Filter Formulation

KF is a recursive data processing algorithm. It is going to be shown in this section that undercertain assumptions, KF is optimal. One aspect that contributes to its optimality is that theKF incorporates all information that can be provided to it. KF processes all available data,regardless of their degree of reliability 1, to estimate the current value of the variables of interest,by incorporating the following [14]:

• Knowledge of the system and measurement device dynamics.

• The statistical description of the system noises, measurement errors, and uncertainty inthe dynamics models.

• Any available information about initial conditions of the variables of interest.

In the previous description is indicated that KF follows a recursive scheme. This relates that,unlike certain data processing concepts, KF does not require all previous processed data tobe kept in storage and reprocessed every time a new observation measurement is taken. Thisrecursive characteristic is importance for the filter implementation because it makes its structuresimpler and also it allows the filter to work faster as it works with less data.

KF could be used advantageously in situations in which: a system of some sort is driven bysome known controls, and measuring devices provide the value of certain pertinent quantities.KF goal is to estimate these parameters by using the available data. The parameters involvedin the process are depicted in fig. 2.2. They are the following ones:

• System state: Also called hidden system state, as it cannot be measured directly. Thisparameter describe the state of the system system and it is composed by some finitenumber of parameters. System state represent the desired values of the system. In orderto obtain the system state, it must be estimated.

• Controls: The system can be driven by some sort by some known controls.

• System error sources: A system is affected to some degree by noise, biases, and deviceinaccuracies.

1KF is able to merge all available data and extract information from each data source. A different level of trustis put in every source according to how noisy is this data.

Final Project - Marcos Cruz Santiago 5

Page 20: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Figure 2.2.: Typical Kalman filter application. A system of some sort with a hidden and de-sired system state is driven by some known controls, and measuring devices. Thedashed box represent a black box. Only inputs (controls) and outputs (observedmeasurements) are explicitly available from the physical system. [44].

• Observed measurements: The system can be measured by a certain number of differentdevices, each with its own particular dynamics and error.

• Measurement error sources: Any measurement is corrupted to some degree by noise,biases, and device inaccuracies.

To sum up, the whole system can be considered as a black box ruled by some known inputs(controls) and it produce some outputs (observed measurements), being them all that can beexplicitly available from the physical system. Estimating the hidden system state uses to becomplicated by the certainty that the system is usually having more inputs than known controls:noise and uncertain controls. The relationships among this various system state variables andthe measured observations are known only with some degree of uncertainty. Besides, the systemcan be measured by different measuring devices, each with its own particular dynamics anderror characteristics. Thus, each of this measuring device is going to provide some informationabout a particular variable. It would be advantageous to merge their outputs in a systematicand optimal manner.

A KF combines all available measurement data and the prior information about the systemand measuring devices. In that way, KF is able to generate an estimate of the desired variablesin such a way that the error is minimized statistically.

2.2.1.1. Bayesian viewpoint

The KF can be considered to be a kind of the simplest dynamic Bayesian networks [33]. Bayesiannetworks are methods of estimation in which Bayes’ rule (see equation 2.1, P (A) and P (B) relatessome random probabilities and P (B|A) and P (B|A) the conditional probability between them)is used to update the probability estimate for a hypothesis as additional evidence is learned [16].These frameworks (and specifically KF) calculate estimates of the hidden system state over timeusing observed measurements and a mathematical process model.

Final Project - Marcos Cruz Santiago 6

Page 21: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Figure 2.3.: Example of a conditional probability density of the value of a fixed scalar quantity xat time instant ti (xti), conditioned on knowledge that the vector measurement zt1and also for instants between t2 to ti, plotted as a function of possible xti) values.[34].

P (A|B) =P (B|A)P (A)

P (B)(2.1)

Conceptually, what any type of filter tries to do is obtain an optimal estimate of some values orvariables from data provided by a noisy environment. Optimal meaning that the filter minimizeserrors under some criterion. There are many manners of accomplishing this objective, if aBayesian viewpoint2 for the filter is adopted, then it is desired that the filter propagates theconditional probability density of the aimed quantities, conditioned on knowledge of the actualobserved measurements [34].

To review briefly the concept explained in the last paragraph, fig. 2.3 gives an exampleof a probability density of a random variable x in a time instant i. This random variable isconditioned to the knowledge of the value of the vector of observation measurement z in differenttime steps t1, t2 . . . ti. z1, z2 . . . zi relate the values of the vector of observation measurements.It is termed probability density because its shape and location on the x axis is dependent onthe values of the measurements taken. It is noted as the following fxti |zt1 ,zt2 ...zti (x|z1, z2 . . . zi).Its shape transmit the amount of certainty that is contained in the knowledge of the value ofx. If the shape of the density plot is a narrow crest, then the probability weight is mostlyconcentrated in a narrow band of x values. Otherwise, if the plot has a dispersed shape, theprobability weight is expanded over a wider range of x. In other words, the probability weightof x taking a certain value is lower [34].

2.2.1.2. Basic Assumptions

Once such a conditional probability density function is propagated, the optimal estimate canbe defined. KFs perform this conditional probability density propagation under certain basicassumptions. They are the following ones:

2Bayesian inference may be viewed as an iterative process in which Bayes’ theorem is used to update how trustya variable is when evidence (actual observed measurements) becomes available.

Final Project - Marcos Cruz Santiago 7

Page 22: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Figure 2.4.: A typical system bandpass curve is drawn on a plot of power spectral density versusfrequency [34]

• The system can be described through a linear model.

• System and measurement noises are white noises.

• System and measurement noises have Gaussian amplitudes.

Under these constraints, the KF is shown to be the best filter of any conceivable form [34].Some of the restrictions can be relaxed, yielding a qualified optimal filter. For instance, if theGaussian assumption is removed, the KF can be shown to be the best filter, in the minimumerror variance sense, out of the class of linear unbiased filters.

On first inspection, the main three assumptions (linear system, white noise, Gaussian am-plitude distribution) may appear to be overly restrictive and unrealistic. However, they canbe justified for many potential applications and they are discussed in detail in the followingparagraphs.

Usually, a linear system model is justifiable for a number of reasons. Often such a modelis adequate for the purpose at hand, and when nonlinearities do exist, a typical engineeringapproach is to linearize about some nominal point or trajectory, achieving a perturbation modelor error model. In fact, linear systems are desirable as they are more easily manipulated withengineering tools. Moreover linear system theory is much more complete and practical thannonlinear one [34]. As it has been introduced in 2.2, there are means of extending the Kalmanfilter concept to some nonlinear applications or developing nonlinear filters directly, but theseare considered only if linear models prove to be inadequate.

Whiteness constraint of the noise implies that the noise value is not correlated in time andalso that it has equal power at all frequencies. Since this results in a noise with infinite power, awhite noise obviously cannot really exist. Nevertheless, the choice of a white noise model can bejustified in two ways: First, any physical system of interest has a certain frequency bandpass3.Thus, it is driven by wideband noise, having power at frequencies above the system bandpass,and essentially constant power at all frequencies within the system bandpass, as it is shownin fig. 2.4. On this same plot, a white noise would merely extend this constant power levelout across at frequencies. Within the bandpass of the system of interest, the fictitious whitenoise looks identical to the real wideband noise. Secondly, it turns out that the mathematicsinvolved in the filter are vastly simplified. Thus, mathematics become manageable by replacingthe real wideband noise with a white noise which, from the system’s point of view, is identical.Therefore, a white noise model can be considered.

3A frequency range of inputs to which it can respond. Above this range, the input either has no effect, or thesystem so severely attenuates the effect that it essentially does not exist.

Final Project - Marcos Cruz Santiago 8

Page 23: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Figure 2.5.: Conditional density of position based on an observed measurement, zt1 [34]

It can be argued that there are cases in which the noise power level is not constant overall frequencies within the system bandpass, or in which the noise is in fact time correlated.Nevertheless, for such instances, some solutions exists. White noise can be put through ashaping filter that can duplicate virtually any form of time-correlated noise [34]. The objectiveof this technique is to achieve overall linear system driven by white noise once again.

The last constraint has to do with the Gaussianes of the noise amplitude. The probabilitydensity of a Gaussian noise amplitude may take the shape of a normal bell-shaped curve. Thisassumption can be justified by the fact that a system or measurement noise is typically causedby a number of small sources. It can be demonstrated that when a number of independentrandom variables are added together, the summed effect can be approximated very closely by aGaussian probability density, regardless of the shape of the individual densities [11]. Moreover,the Gaussian densities assumption, as in the case of whiteness, makes mathematics manageable[25].

2.2.1.3. The Probabilistic Origins of the Filter

To understand the probabilistic origins of the filter and how KFs work, a simple example (basedon the one described in Maybeck [34]) is developed in this section. Suppose that it is searchedfor a single value, for instance, the exact position x of an object in a one-dimensional location.Consider now that at some time t1 it is possible to measure the position of the object with acertain sensor, calling this observed measurement: zt1 . However, because of device inaccuraciesand errors of the sensor, the result of the measurement zt1 is somewhat uncertain. The precisionis such that the standard deviation involved is σzt1 . In other words, the variance, or secondorder statistic, is σ2zt1

. Thus, the conditional probability of xt1 , the position of the object attime t1, conditioned on the observed value of the measurement being zt1 can be established.

Fig. 2.5 depicts these values. It is a plot of fxt1 |zt1 (x|z1) as a function of the location x, inother words, it shows the probability for the object of being in any location, based upon in themeasurement taken. Note that σzt1 is a direct indicator of the uncertainty: the larger σzt1 is,the broader the probability peak is, spreading the probability “weight” over a larger range ofx values4 [66]. The best possible estimate of the position based on this conditional probabilitydensity is the following one:

4For a Gaussian density, 68,3% of the probability “weight” is contained within the band σ units to each side ofthe mean [39].

Final Project - Marcos Cruz Santiago 9

Page 24: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Figure 2.6.: Conditional density of position based on measurement zt2 [34]

xt1 = zt1 (2.2)

Te variance of the error of this estimate is defined as follows:

σ2xt1= σ2zt1

(2.3)

Now it can be considered that the system receives measure from the sensor at time t2 ∼= t1(so that the real position has not changed at all), and it is obtained a measurement zt2 witha variance σ2zt2

. The variance of the new measurement may be different from the first one, forinstance can be smaller than the first measure, or in other words, more accurate. Fig. 2.6 showsa possible form of fxt2 |zt2 (x|z2) for this hypothesis. Note the peak has a narrow shape, this isdue to smaller variance. This shape indicates that the position is rather certain based on thenew measurement.

Now, having different measurements for estimating the position, the next step is to combinethis data. Subsequently is shown that, based on the previous assumptions, the conditionaldensity of the position at time t2 ∼= t1, given both zt1 and zt2 , is a Gaussian density with meanµ and variance σ2, with:

µ = [σ2zt2

σ2zt1+ σ2zt2

]zt1 + [σ2zt1

σ2zt1+ σ2zt2

]zt2 (2.4)

1

σ2=

1

σ2zt1+

1

σ2zt2(2.5)

Note that, from equation 2.5, σ is less than either σzt1 or σzt2 . In other words, the uncertaintyin the estimate of position has been lowered by combining the two pieces of information (as itis shown in fig. 2.7 graphically). Therefore, given this density, the best estimate is:

xt2 = µ (2.6)

with an associated error variance σ2. Note in equation 2.4, if σzt1 is equal to σzt2 . This meansthat both measurements are of equal precision, the equation shows that the optimal estimateof position is simply the average of the two measurements, as would be expected [34]. Even, if

Final Project - Marcos Cruz Santiago 10

Page 25: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Figure 2.7.: Conditional density (fxt2 |zt1 ,zt2 (x|z1, z2)) of position based on data zt1 and zt2 [34]

σzt1 is larger than σzt2 , which is to say that the uncertainty involved in the measurement zt1 isgreater than that of zt2 , then the equation dictates “weighting” zt2 more heavily than zt1 [34].

Finally, even if σzt2 is less than σzt1 , or if σzt2 is very large, the estimation will be improved.Therefore poor quality data also provide information. In consequence, it should increase theperformance of the filter output.

Furthermore, equation 2.4 and equation 2.5 are also the weighted least squares estimate, themaximum likelihood estimate, and the linear estimate with less than any other linear unbiasedestimate. Hence, it is the “best” that can be done according to just about any reasonablecriterion [34].

Too see the relationship with the KF algorithm, the equation for xt2 can be rewritten as:

xt2 = [σ2zt2

σ2zt1+ σ2zt2

]zt1 + [σ2zt1

σ2zt1+ σ2zt2

]zt2 = zt1 +σ2zt1

σ2zt1+ σ2zt2

[zt2 − zt1 ] (2.7)

Grouping the variances from equation 2.7 is possible to define the following K term:

Kt2 =σ2zt1

σ2zt1+ σ2zt2

(2.8)

Note that the subscript of K refers to the newest measurement available, or in other words, theactual measurement. Thus, the term K is defined with the variance of this actual measurementand the variance of the a priori information (in this case the previous measurement, at the endof this section, the concept is further clarified).

Finally, noticing from equation 2.2 that zt1 = xt1 and substituting term K (2.8) in 2.7, thislast equation can be rewritten as 2.2.1.3.

xt2 = xt1 +Kt2 [zt2 − xt1 ] (2.9)

The form shown in equation is actually the used form in KF implementations. Furthermore,equations 2.2.1.3 and 2.8, show that the optimal estimate at time t2, xt2 , is equivalent to thebest prediction of its value before zt2 is taken, xt1 , plus the difference between zt2 and the bestprediction of its value it is actually taken xt1 , corrected with a term of optimal weighting Kt2

[34].

Final Project - Marcos Cruz Santiago 11

Page 26: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Figure 2.8.: Propagation of conditional probability density [34]

It is worthwhile to understand this “predictor-corrector” structure of the filter (That is ex-plained in detail in section 2.2.1.6). Based on all previous information, a prediction of the valuethat the desired variables and measurement will have at the next measurement time is made.Then, when the next measurement is taken, the difference between this measurement and itspredicted value is used to “correct” the prediction of the desired variables.

Using the Kt2 in 2.8, the variance equation given by 2.5 can be rewritten as the follows:

σ2xt2= σ2xt1

−Kt2σ2xt1

(2.10)

Note that the values xt2 and σ2xt1incorporate all the information in fxt2 |zt1 ,zt2 (x|z1, z2). Stated

differently, by propagating these two variables, the conditional density of the searched locationx at time t2, given zt1 and zt2 , is completely specified.

The outlined equations solve the static estimation problem. Now, the incorporation of dynam-ics into the problem can be considered. It can be supposed that the object is moving forwardin one direction while the system try to estimate its position. It can be assumed that a goodmodel to describe this movement can be:

dx

dt= u+ w (2.11)

where u is a nominal velocity and w is a noise term used to represent the uncertainty inthe knowledge of the object’s velocity due to disturbances, offnominal conditions, effects notaccounted for in the simple first order equation, and other similar effects. The “noise” w ismodeled as a white Gaussian noise with a mean of zero and variance of σ2w.

As the object is moving, the density travels along the x axis at the nominal speed u, whilesimultaneously spreading out about its mean. This is due to the fact that as time progress theuncertainty about the position of the object increases too. The probability density starts at thebest estimate, but in a dynamic system it moves and spreads out in time. This represents theinsecurity of object’s exact position due to the constant addition of uncertainty over time [34].

Just before the measurement is taken at time t3 (noted like x−t3 , “super minus” is going to bealways used for a priori data) the density fxt3 |zt1 ,zt2 (x|z1, z2) is as shown in fig. 2.8. It can beexpressed mathematically as a Gaussian density described by the following mean and variance:

x−t3 = xt2 + u(t3 − t2) (2.12)

σ2x−t3

= σ2xt2+ σ2w(t3 − t2) (2.13)

Final Project - Marcos Cruz Santiago 12

Page 27: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Thus, x−t3 is the optimal prediction of value of x at time instant t−3 . In other words, beforethe measurement is taken at t3. The expected variance of that prediction is σ2

x−t3

.

Now a measurement is taken, and its value turns out to be zt3 . Its variance is assumedto be σ2zt3

. Similarly to the static case, there are now two Gaussian densities available thatcontain information about position: one encompassing all the information available before themeasurement, and the other being the information provided by the new observation measurementzt3 . By the same process as before, the density with mean x−t3 and variance σ2

x−t3

is combined

with the density mean zt3 and variance σ2zt3to yield a Gaussian density with mean:

xt3 = x−t3 +Kt3(zt3 − x−t3) (2.14)

and variance:

σ2xt3= σ2

x−t3

−Kt3σ2x−t3

(2.15)

Note that the definition of the gain K is done again taking into consideration the last availablemeasurement with the previous information and it is defined as:

Kt3 =σ2x−t3

σ2x−t3

+ σ2zt3(2.16)

The optimal estimate, xt3 , satisfies the same form of equation as previously seen in 2.2.1.3.The difference between zt3 and the best prediction of xt3 before zt3 is corrected by an optimalweighting value. Similarly, the variance and gain equations are of the same form as 2.8 and 2.10.

It can be observed in the equations, that, if σzt3 , the measurement noise variance, is large,then Kt3 is small; this says little confidence is put in a very noisy measurement by weighteningit lightly. In the limit as σzt3 → ∞, Kt3 becomes zero, and xt3 equals x−t3 , an infinitely noisymeasurement is totally ignored. If the dynamic system noise variance σ2w is large, then σ2

x−t3

will

be large (see equation 2.13) and so will Kt3 , in this case, certainty of the output of the systemmodel within the filter structure is very low and therefore would weight the measurement heavily.Note that in the limit as σw →∞, σ2

x−t3

→∞ and Kt3 → 1, so equation 2.14 yields:

xt3 = x−t3 + 1(zt3 − x−t3) = zt3 (2.17)

Thus in the limit of absolutely no confidence in the system model output, the optimal policyis to ignore the output and use the new measurement as the optimal estimate. Finally, if σ2

x−t3

should ever become zero, then so does Kt3 this is sensible since if σ2x−t3

= 0, you are absolutely

sure of your estimate before zt3 becomes available.To sum up, in this section it has been demonstrated the reasonableness of the filter structure

that is derived mathematically in further sections.

2.2.1.4. Underlying dynamic system model

As it has been introduced, KF addresses the general problem of estimating the hidden systemstate x ∈ Rn of a discrete-time controlled process that is described by a linear stochastic differ-ence equation. In other words, KF is based on a linear dynamic system discretized in the timedomain.

A discretized linear system can be represented as in fig. 2.9, and its evolution expressed in astate space[41] like in equation 2.18.

Final Project - Marcos Cruz Santiago 13

Page 28: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

B DT H

A

Wk-1

Uk-1 Xk-1Xk

Vk-1

Zk-1

Figure 2.9.: A representation of a linear system

xk = Axk−1 + Buk−1 + wk−1 (2.18)

zk = Hxk + vk (2.19)

Being xk the system state, uk ∈ Rm is the known input vector and zk ∈ Rm the observedmeasurements or the output of the system. In other words, in a direct way it is only possibleto observe the value of zk, but this measure includes some associated uncertainty. Therefore, incase of requiring the complete evolution of xk is required to estimate that value.

The random variables, wk and vk, describe the stochastic process associated to the measureand to the system, respectively. The statistics of this random variables are assumed as eq. 2.20and eq. 2.21 respectively. In addition they are independent of each other, white, and withGaussian probability distributions.

p(w) ∼ N(0,Q) (2.20)

p(v) ∼ N(0,R) (2.21)

In practice, the process noise covariance Q and measurement noise covariance R matrices canchange with each time step or measurement. Nevertheless, they are assumed to be constant. Inaddition, covariance matrices Q and R are considered diagonal and therefore symmetric.

The n x n matrix A in the difference equation 2.18 describes the state at the previous timestep k−1 to the state at the actual step k, in the absence of either a driving function or processnoise5. The n x l matrix B relates the optional control input u ∈ Rl to the state x. The m x nmatrix H in the measurement equation 2.19 relates the state to the measurement zk

6. To sumup, these matrices define the system dynamics [66].

2.2.1.5. The Computational Origins of the Filter

x−k ∈ Rn is defined to be a priori state estimate at step k, carrying information of the previousprocess until step k. xk ∈ Rn to be a posteriori state estimate at step k measurement zk. KFsearches for this estimated value by reducing a criterion. This criterion, is an error, that shouldbe minimized. Two different errors can be defined: a priori (equation 2.22) and a posteriori(equation 2.23) estimate errors.

5In practice A might change with each time step, but here it is assumed to be constant.6In practice C might also change with each time step, but here it is assumed to be constant.

Final Project - Marcos Cruz Santiago 14

Page 29: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Sup

plie

d b

y u

ser

Ob

serv

edH

idd

en

Time = k +1Time = kTime = k - 1

Xk-1,Pk-1

A B H

0,Q

0,R

Wk-1 Vk-1

Uk-1

Zk-1

Xk,Pk

A B H

0,Q

0,R

Wk Vk

Uk

Zk

Xk+1,Pk+1

A B H

0,Q

0,R

Wk+1 Vk+1

Uk+1

Zk+1

...

...

Figure 2.10.: Model underlying the Kalman filter. Squares symbolize matrices. Ellipses sym-bolize multivariate normal distributions (with the mean and covariance matrixenclosed). Values outside shapes are vectors. In the simplier case, the various ma-trices are constant with time, and thus the subscripts are dropped, but the Kalmanfilter allows any of them to change each time step. Modified from [2].

e−k = xk − x−k (2.22)

ek = xk − xk (2.23)

The a priori estimate error covariance and the a posteriori estimate is then:

P−k = E{e−k e−Tk } (2.24)

P k = E{ekeTk } (2.25)

Error covariance matrices are of special relevance in the KF algorithm as they are used betweenall KF cycles, as it is depicted in fig. 2.10.

To derive the equations for the KF, it is necessary to begin with the goal of finding anexpression that computes an a posteriori state estimate xk as a linear combination of an a prioriestimate x−k and a weighted difference between an actual measurement zk and a measurementprediction Hxk as shown in equation 2.26. Note that in section 2.2.1.3 the justification of thefollowing equation is contained.

xk = x−k + K(zk −Hx−k ) (2.26)

The difference (zk −Hx−k ) in equation 2.26 is called measurement innovation, or residual.The residual relates the discrepancy between the predicted observed measurement (Hx−k )7 andthe actual measurement (zk). A residual of zero means that the two are in complete agreement.

The n x m matrix K in 2.26 is chosen to be the gain or blending factor that minimizes the aposteriori error covariance equation 2.25.

To find the value of the system state, the following equation can be considered:

7Note that x−k is the predicted system state, to build the predicted measurement the information of the obser-vation model, H, should be used too.

Final Project - Marcos Cruz Santiago 15

Page 30: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

xk = x−k + Kk[zk −Hx−k )]︸ ︷︷ ︸Correctionfactor

(2.27)

Where zk is the last observed value, and x−k is the most updated available value from thestate (calculated on further section 2.2.1.6). As the goal of any filter is to minimize an error insome sense, the proper value of Kk to achieve an optimal value of xk is required such that thecovariance matrix of error becomes minimal. For this purpose the error from equation 2.23 canbe redefined, by substituting equation 2.27 into equation 2.23:

ek = xk − x−k −Kk(zk −Hx−k ) (2.28)

Now, the value of zk (equation 2.19), being it the output of the system, should be considered.Therefore, by substitution:

ek = xk − x−k −KkHxk −Kkvk + KHx−k (2.29)

Grouping terms, and using the a posteriori error covariance form in equation 2.25:

P k = E{〈(I −KkH)(xk − x−k )−Kkvk〉〈(I −KkH)(xk − x−k )−Kkvk〉T } (2.30)

Operating over the last equation:

P k = E{〈(I −KkH)(xk − x−k )〉〈(I −KkH)(xk − x−k )〉T }+ E{KkvkvTk K

Tk } (2.31)

From equation 2.21, it is known that as E{vkvTk } is Rk, the covariance matrix associated tothe measurements. So, substituting this value and operating the deterministic values over theexpectation value:

P k = (I −KkH)E{(xk − x−k )(xk − x−k )T }(I −KkH)T + KkRkKTk (2.32)

Taking into account equation 2.24 and by substitution, it results:

P k = (I −KkH)P−k (I −KkH)T + KkRkKTk (2.33)

Operating over the previous sentence:

P k = P−k − P−k HTKT

k −KkHP−k + KkHP−k HTKT

k + KkRkKTk (2.34)

This minimization can be accomplished taking the derivative of the trace of the whole equation,setting result equal to zero, and then solving for Kk [66].

Therefore, the trace operator (Tr : Trace of the matrix8) it is applied to equation 2.34:

Tr{P k} = Tr{P−k } − 2Tr{P−k HTKT

k } −+Tr{KkHP−k HTKT

k }+ Tr{KkRkKTk } (2.35)

As said before, to found the minimum, equation 2.35 has to be differentiated and its resultset zero.

∂Tr{P k}∂Kk

= −2Tr{P−k HT

k }+ 2Tr{KkHP−k HT }+ 2Tr{KkRk} = 0 (2.36)

8In linear algebra, the trace of an n x n square matrix M is defined to be the sum of the elements on the maindiagonal (the diagonal from the upper left to the lower right).

Final Project - Marcos Cruz Santiago 16

Page 31: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Finally, the resulting Kk that minimizes the a posteriori estimate error covariance P k9 is:

Kk = P−k HT (HP−k H

T + R)−1 =P−k H

T

HP−k HT + R

(2.37)

It can be proved that K is the minimum by using the Hessian, by making a substitution ofequation 2.37 in equation 2.33.

On the one hand, looking at equation 2.37, it can be seen that as the measurement errorcovariance R approaches zero, the gain K weights the residual more heavily. Specifically:

limRk→0

Kk = H−1 (2.38)

On the other hand, as the a priori estimate error covariance P−k approaches zero, the gain Kweights the residual less heavily. Specifically:

limP−

k→0Kk = 0 (2.39)

Another way of understanding the weighting by K is that as the measurement error covarianceR approaches zero, the actual measurement zk trust grows, while the predicted measurementHx−k trust decreases. Moreover, as the a priori estimate error covariance P−k approaches zerothe actual measurement zk is trusted less and less while predicted measurement Hx−k is trustedmore and more.

2.2.1.6. The Discrete Kalman Filter Algorithm

In this section, a high-level operation scheme of one form of the discrete KF is covered. Afterpresenting this high-level view, specific equations of the filter and their use is given.

KF estimates a process by using cyclically a form of feedback control: first, the filter estimatesthe process state at some time step by using its inner parameters (model, covariance matrices andthe past estimate) and after it obtains feedback by using the observed measurements. As such,the equations for the KF fall into two groups: time update and measurement update equations.Therefore, it can be concluded, that the KF algorithm has two steps that are executed in aniterative way [66]:

• Time update: This step is responsible for projecting forward (to the next time step) thecurrent state and error covariance estimates in order to obtain the a priori estimates forthe next time step.

• Measurement update: This part of the algorithm is responsible for the feedback. In thisstep the new measurement information is incorporated into the a priori estimate to obtainan improved a posteriori estimate.

The time update equations can also be thought of as predictor equations, while the measure-ment update equations can be thought of as corrector equations [66]. Indeed the final estimationalgorithm resembles that of a predictor-corrector algorithm for solving numerical problems, asis depicted in 2.11.

9All of the Kalman filter equations can be algebraically manipulated into to several forms, here it is showed oneof the most used forms.

Final Project - Marcos Cruz Santiago 17

Page 32: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Time Update (Predict)

Measurement Update (Correct)

Figure 2.11.: The ongoing discrete Kalman filter cycle. The time update projects the currentstate estimate ahead in time. The measurement update adjusts the projected esti-mate with the actual measurement.

Step 1 : Time Update / Prediction The objective of this step is twofold:

1. Predict the current state x−k .

2. Predict the estimate error covariance matrix P−k .

On the one hand, this step compromises the prediction of xk, named x−k . The predicted valueis calculated from the most current value of the state (later it is seen that it is the correctedstate from the final part of the algorithm). See equation 2.40, note that A and B are fromequation 2.18.

x−k = Axk−1 + Buk−1 (2.40)

On the other hand, the algorithm has to predict the value of the covariance matrix P−kof the previous error to the measurement. In the following lines it is revised how to reachmathematically the appropriate equation that is executed by KF algorithm to make this measure.

To find the right expression for prediction stage in KF algorithm the definition of e−k fromequation 2.23 and the definition of the covariance matrix P−k from equation 2.22 is used. Bysubstituting 2.40 in both, they can be expressed as:

e−k = Axk−1 + Buk−1 + wk−1 −Axk−1Buk

(2.41)

P−k = E{[A(xk−1 − xk−1) + wk−1][A(xk−1 − xk−1 + wk−1)]T } (2.42)

By just operating:

P−k = E{[A(xk−1 − xk−1)][A(xk−1 − xk−1]T }+ E{wk−1wTk−1} (2.43)

E{wk−1wTk−1} it is defined as the covariance matrix associated to the process: Q, seen before

in equation 2.20. Therefore, finally:

P−k = AP k−1AT + Q (2.44)

Being equation 2.40 with equation 2.44 the practical time update equations used in KF im-plementations. Notice how these equations refresh the state and covariance estimates from timestep k − 1 to step k.

Final Project - Marcos Cruz Santiago 18

Page 33: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Step 2 : Measurement Update / Correction This part of the KF algorithm has three maingoals:

1. Compute the Kalman gain Kk.

2. Update the estimate state with the measurement zk.

3. Update the error covariance P k.

As in the previous section it is given some mathematical manipulations to achieve the properequations used on KF implementations.

As it had been said in the previous section 2.2.1.6 the value of the state is going to be calculatedusing the previous state and a correction that is in function of the error.

The first task during the measurement update is to compute the Kalman gain Kk. Noticethat in previous sections we have justified the form of Kalman gain. So to compute the Kalmangain, KF algorithms use equation 2.37.

The next step is to actually measure the process to obtain zk, and then to generate a prioristate estimate by incorporating the measurement. This step could be achieved by using equation2.26, justified in previous sections.

The final step is to obtain an a posteriori error covariance estimate. So substituting equation2.37 into equation 2.33, the following equation it is obtained:

P k = [1−KkH]P−k (2.45)

To sum up, the whole algorithm, after each time and measurement update step, the processis repeated cyclically but with the previous a posteriori estimates. This recursive processingscheme is one of the most interesting features of the KF (it make a practical implementationsmuch more feasible than for instance an implementation of a Wiener filter which operates onall of the data directly for each estimate [7]). The KF instead recursively conditions the currentestimate on all of the past observation measurements. Fig. 2.12 depicts the operation of thefilter, merging the high-level diagram of fig. 2.11 with the equations showed in this section.Equations that in fact are the basis of any KF algorithm.

2.2.1.7. Filter Parameters and Tuning

To initiate the algorithm it is necessary to know the following boundary conditions: An initialvalue of the state: x0, and the value of the error covariance matrix, P 0. It can be assumedthat P 0 = Q, in fact, usually it can be chosen almost any P 0 6= 0 and the filter will eventuallyconverge (see fig. 2.13). In addition, the values of the covariance matrices associated to thesystem and the measurement (Q and R) are needed.

The measurement noise covariance R is usually measured before the filter starts working. Tofind out the measurement error covariance R is generally possible because it is needed to becapable to measure the process anyway (while operation the filter) so it should generally possibleto take some offline sample measurements in order to estimate the variance of the measurementnoise.R’s choice becomes a very important part of the filter tuning. If the “true” measurement error

variance is chosen, it is expected the “best” performance in terms of balancing responsivenessand estimate variance (see fig. 2.14) [34].

However, when the value of R is very different from the “true” measurement error variance,the filter has a worse performance. In the case that a R higher than the error variance is used,the filter use to be “slower” to believe the measurements (see fig. 2.15) and in the case that

Final Project - Marcos Cruz Santiago 19

Page 34: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Kk Pk-HT HPk

-HT R+( )

1–=

(1) Compute the Kalman gain

xk 1–Initial estimates for and Pk 1–

xk xk-

Kk zk H xk-

–( )+=

(2) Update estimate with measurement zk

(3) Update the error covariance

Pk I KkH–( )Pk-

=

Measurement Update (“Correct”)

(1) Project the state ahead

(2) Project the error covariance ahead

Time Update (“Predict”)

xk-

Axk 1– Buk 1–+=

Pk-

APk 1– AT Q+=

Figure 2.12.: A complete picture of the operation of the Kalman filter [66]

0 20 40 60 80 100 120 140 1600

0.05

0.1

0.15

0.2

0.25

0.3

0.35

Iterations (n)

Errorcovariancevalue

Figure 2.13.: Example of error covariance P−k vs iterations in a tryout to estimate a scalarrandom value (in this case the scalar was 30). As it can be seen the value convergequickly.

Final Project - Marcos Cruz Santiago 20

Page 35: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

0 20 40 60 80 100 120 140 16025

26

27

28

29

30

31

32

Estimated

value

Number of iterations (n)

Figure 2.14.: Simulation of an estimation of a constant value corrupted by noise. Being theblue line the estimation, the red line the real value, and the green line the noisymeasurement of the constant. The graphic show iterations (x axis) vs value (yaxis). It has been used R equal to the true measurement error variance.

the measurement variance R is much smaller than its optimal value, the filter tend to be very“quick” to believe noisy measurements (See fig. 2.16).

In case of process noise covariance Q the determination of it, is generally more difficult asit is typically not able to be observed directly the process that is being estimated. Sometimesa simple process model can generate acceptable results if it is “injected” sufficient uncertaintyinto the process via the selection of Q [34].

In either case, whether or not if it is given a rational basis for choosing the parameters, oftentimes superior filter performance (in a statistical way) can be obtained by tuning the filterparameters Q and R. This tuning is usually done off-line, frequently by means of a distinct KFin a process generally referred to as system identification.

Under conditions where Q and R are in fact constant. Furthermore, both the estimation errorcovariance P k and Kalman gain Kk will stabilize rapidly and then remain constant. If this isthe case these parameters can be previously computed by either running the filter off-line or forinstance by determining the steady-state value of P k [18].

2.2.2. Extended Kalman Filter

As described in section 2.2, the main goal of KF is to estimate the state x ∈ Rn of a discrete-timecontrolled process that is described by a linear stochastic difference equation. Unfortunately, inpractice most of the interesting systems tend to be nonlinear. Nevertheless, some of the mostinteresting and notable applications of Kalman filtering have been such situations [66].

In order to extend the KF to nonlinear systems, a modified version of it, known as theExtended Kalman Filter (EKF) was developed. Due to the issue of nonlinearity, the EKF is nolonger an optimal filter in the MMSE sense as it was the KF, but in practice it has been proved

Final Project - Marcos Cruz Santiago 21

Page 36: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

0 20 40 60 80 100 120 140 16025

26

27

28

29

30

31

32

Estimatedvalue

Number of iterations (n)

Figure 2.15.: Simulation of an estimation of a constant value corrupted by noise. Being theblue line the estimation, the red line the real value, and the green line the noisymeasurement of the constant. The graphic show iterations (x axis) vs value (y axis).It has been used R equal to 1. The filter is slower to react to the measurements,resulting in reduced estimate variance.

to be a truly powerful adaptive filter [21].

2.2.2.1. The Process to be Estimated

In something similar to a Taylor series, the estimation can be linearized around the currentestimate using the partial derivatives of the process and the measurement functions to calculateestimates even in the face of non-linear relationships [66].

Therefore EKF can be formulated in the following way: consider a discrete-time nonlinearsystem with the unobserved underlying state vector xk ∈ Rn and observation vector (or mea-surement) zk ∈ Rn at time instant k. A dynamic model of this system may be represented asfollows [19]:

xk = f(xk−1, uk−1, wk−1) (2.46)

zk = h(xk, vk) (2.47)

Where f(·) describes the non-linear function of the state evolution and describes the state atthe previous time step k−1 to the state at the current time step k. h(·) embody the relationshipbetween the state vector and the observations. The process and measurement noise vectors arethe random variables wk and vk respectively, with the following associated covariance matricesQk = E{wkw

Tk } and Rk = E{vkvTk }. Notice that, as like in KF, xk is the actual state vector (the

quantity that is going to be estimated) and is not possible to measure it directly. Nevertheless,it is possible to access to the actual measurement zk, that is going to be used to estimate xk.

Final Project - Marcos Cruz Santiago 22

Page 37: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

0 20 40 60 80 100 120 140 16025

26

27

28

29

30

31

32

Estimatedvalue

Number of iterations (n)

Figure 2.16.: Simulation with a KF of an estimation of a constant value corrupted by noise.Being the blue line the estimation, the red line the real value, and the green line thenoisy measurement of the constant. The graphic show iterations (x axis) vs value(y axis). It has been used R equal to 0.0001. The filter responds to measurementsrapidly, increasing the estimate variance.

In practice it is not possible to know the individual values of the noise wk and vk at each timestep. However, the state and measurement vector can be approximated without them as:

xk = f(xk−1, uk−1, 0) (2.48)

zk = h(xk, 0) (2.49)

where xk−1 is some a posteriori estimate of the state (from a previous time step k).It is important to note that a main drawback of the EKF is that the distributions of the

various random variables are not anymore normal after applying the respective nonlinear trans-formations [66]. The EFK is just an adhoc state estimator that only approximates the optimalityof Bayes’ rule by linearization [34]. However, some interesting works have been done to preservethe normal distributions of the random variables in non-linear KF’s [22].

2.2.2.2. The Computational Origins of the Filter

In order to use a KF formalism to estimate a process with non-linear difference and measurerelationship, it is mandatory to derive a linear approximation of equations 2.46 and 2.47. Thisbrings the following linear approximate model:

xk ≈ xk + Ak(xk−1 − xk−1) + W kwk−1 (2.50)

zk ≈ zk + Hk(xk − xk) + V kvk (2.51)

Final Project - Marcos Cruz Santiago 23

Page 38: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

where:

• xk and zk are the actual state and measurement vectors,

• xk and zk are the approximate state and measurement vectors from equations 2.48 and2.49,

• xk is a posteriori estimate of the state at step k,

• the random variables wk and vk represent the process and measurement noise,

• Ak is the Jacobian matrix of partial derivatives of f with respect to x, that is

Ak[i,j] =∂f[i]

∂x[j](xk−1, uk−1, 0)

• W k is the Jacobian matrix of partial derivatives of f with respect to w,

W k[i,j] =∂f[i]

∂w[j](xk−1, uk−1, 0)

• Hk is the Jacobian matrix of partial derivatives of h with respect to x,

Hk[i,j] =∂h[i]

∂x[j](xk, 0)

• V k is the Jacobian matrix of partial derivatives of h with respect to v,

V k[i,j] =∂h[i]

∂v[j](xk, 0)

Note that in the definitions of Jacobians Ak, W k, Hk and V k is used the time step subscriptk. The reason is because they are different at each time step. Hence they must be recomputedfor each k. Following, there is necessity to define a new nomenclature for the prediction errorand the measurement residual:

exk≡ xk − xk (2.52)

ezk ≡ zk − zk (2.53)

Error process equation can be rewritten, by substituting equation 2.50 in equation 2.52 andsubstituting equation 2.51 in equation 2.53:

exk≈ Ak(xk−1 − xk−1) + εk (2.54)

ezk ≈Hkexk+ ηk (2.55)

where εk and ηk relate new independent random variables. They have zero mean and covari-ance matrices W kQkW

Tk and V kRkV

Tk , with Qk and Rk as in equation 2.20 and equation 2.21

respectively.Notice that equation 2.54 and equation 2.55 are linear, and that they are very similar to the

measurement equations 2.18 and 2.19 from the discrete KF.

Final Project - Marcos Cruz Santiago 24

Page 39: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

This motivates the use of the actual measurement residual ezk in equation 2.53 and a second(hypothetical) KF to estimate the prediction error exk

given by equation 2.54. Therefore, ekcould then be used along with equation 2.52 to obtain the a posteriori state estimates for theoriginal non-linear process as [34]:

x = xk + ek (2.56)

The random variables from equations 2.54 and 2.55 have approximately the following proba-bility distributions:

p(exk) ∼ N(0, E(exk

eTxk)) (2.57)

p(εk) ∼ N(0,W kQkWTk ) (2.58)

p(ηk) ∼ N(0,V kRkVTk ) (2.59)

Given this approximations and letting the predicted value of ek be zero, the KF equation toestimate ek is:

ek = Kkezk (2.60)

By substituting equation 2.60 back into equation 2.56 and making use of equation 2.53 it canbe seen that there is no need of a second (hypothetical) KF:

xk = xk + Kkezk = xk + Kk(zk − zk) (2.61)

Equation 2.61 can be used for the measurement update step in the EKF, with xk and zkcoming from equations 2.48 and 2.49, and the Kalman Gain Kk coming from equation 2.37withthe suitable substitution for the measurement error covariance .

2.2.2.3. The Discrete Extended Kalman Filter Algorithm

The EKF algorithm is similar to the KF algorithm, so in this section a review of the filteralgorithm is done emphasizing the differences between KF and EKF is given (for more detailson the algorithm see section 2.2.1.6, where the KF algorithm is more detailed). Fig. 2.17 offersa complete scheme of the operation of the EKF with the complete set of EKF equations neededfor the implementation algorithm.

Note that xk has been substituted for x−k to remain consistent with the previous “superminus” a priori notation. The reason for not doing it before is to introduce in a somehowintuitive manner the construction of EKF, however in this section the formal equations used bythe EKF are described, so a formal notation must be used.

As with the basic discrete KF, the time update equations in fig. 2.17 update the state andcovariance estimates from the previous time step k− 1 to the current time step k and measure-ment update equations correct the system state and covariance estimates with the measurementzk.

An important benefit of the EKF algorithm is that the Jacobian Hk in the equation forthe Kalman gain Kk serves to correctly propagate or “magnify” only relevant components ofthe measurement information. For instance, if there is not a one-to-one mapping between themeasurement zk and the state via h, the Jacobian H affects the Kalman gain so that it onlymagnifies the portion of the residual zk − h(x−k , 0) that does affect the state [66]. Indeed ifover all measurements there is not a one-to-one mapping between the measurement zk and the

Final Project - Marcos Cruz Santiago 25

Page 40: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Welch & Bishop, An Introduction to the Kalman Filter 11

UNC-Chapel Hill, TR 95-041, July 24, 2006

Figure 2-1. A complete picture of the operation of the extended Kalman fil-ter, combining the high-level diagram of Figure 1-1 with the equations from Table 2-1 and Table 2-2.

An important feature of the EKF is that the Jacobian in the equation for the Kalman gain serves to correctly propagate or “magnify” only the relevant component of the measurement information. For example, if there is not a one-to-one mapping between the measurement and the state via , the Jacobian affects the Kalman gain so that it only magnifies the portion of the residual that does affect the state. Of course if over all measurements there is not a one-to-one mapping between the measurement and the state via , then as you might expect the filter will quickly diverge. In this case the process is unobservable.

3 A Kalman Filter in Action: Estimating a Random Constant

In the previous two sections we presented the basic form for the discrete Kalman filter, and the extended Kalman filter. To help in developing a better feel for the operation and capability of the filter, we present a very simple example here. Andrew Straw has made available a Python/SciPy implementation of this example at http://www.scipy.org/Cookbook/KalmanFiltering (valid link as of July 24, 2006).

The Process Model

In this simple example let us attempt to estimate a scalar random constant, a voltage for example. Let’s assume that we have the ability to take measurements of the constant, but that the measurements are corrupted by a 0.1 volt RMS white measurement noise (e.g. our analog to digital converter is not very accurate). In this example, our process is governed by the linear difference equation

,

Kk Pk-HkT HkPk

-HkT VkRkVk

T+( )1–

=

(1) Compute the Kalman gain

xk xk-

Kk zk h xk-

0,( )–( )+=

(2) Update estimate with measurement zk

(3) Update the error covariance

Pk I KkHk–( )Pk-

=

Measurement Update (“Correct”)

(1) Project the state ahead

(2) Project the error covariance ahead

Time Update (“Predict”)

xk-

f xk 1– uk 1– 0, ,( )=

Pk-

AkPk 1– AkT WkQk 1– Wk

T+=

xk 1–Initial estimates for and Pk 1–

Hk Kk

zkh Hkzk h xk

-0,( )–

zk h

xk Axk 1– Buk 1– wk+ +=

xk 1– wk+=

Figure 2.17.: A complete scheme of the operation of the Extended Kalman filter [66]

state via h, then the filter will quickly diverge as might be expected. In this case the process isunobservable.

2.2.3. Extended Kalman Smoother

By the moment, in this work only the “past” information relative to the hidden state hasbeen considered. By incorporating the “future” observations relative to that hidden state, it ispossible to obtain a more refined state estimate. Estimators that take into account both pastand future are often called “smoothers”

As with the Kalman Smoother, the extended Kalman Smoother (EKS) uses the informationof future observations to give better estimates of the current state. EKS is expected to be moreeffective compared with the EKF due to this non-causal nature [51].

Before running the smoother, first the filter must be run. The smoother then proceeds back-ward in time. Depending on the smoothing strategies, smoothing are usually classified intofixed-lag or fixed-interval smoothers [57]. For real-time applications of the proposed EKS meth-ods, the fixed-lag smoother is usually more appropriated.

2.2.4. Other variants

As it has been shown in fig. 2.1 there are different groups of KF variants. Each of this groups isprepared to work under certain constraints or scenarios that are different to those which meetthe requirements of the original KF. As in this work only EKF and EKS are used, and as there isa huge family of KF variants (see fig. 2.18), only a short review of usage of the most importantgroups of variants is done.

Final Project - Marcos Cruz Santiago 26

Page 41: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Kal

man

filt

er (

KF)

Ex

ten

ded

Kal

man

fi

lter

(EK

F)

U

nsc

ente

d K

alm

an

filt

er (

UK

F)

Inva

rian

t/It

erat

ed

Exte

nd

ed K

alm

an

filt

er (

IEK

F)

B

ias

awar

e K

alm

an

filt

er (

BA

KF)

K

alm

an-B

ucy

filt

er

H

ybri

d K

alm

an

filt

er

En

sem

ble

Kal

man

fi

lter

(En

KF)

Fa

st K

alm

an f

ilter

(F

KF)

R

edu

ced

ran

k sq

uar

e ro

ot

Kal

man

filt

er

(RR

SQR

T K

F)

St

ead

y K

alm

an

filt

er

C

olo

red

no

ise

Kal

man

filt

er

- P

arti

al O

rto

gon

al E

nse

mb

le K

alm

an F

ilter

(P

OEn

KF)

Hyb

rid

s o

f en

sem

ble

an

d r

edu

ced

ran

k K

alm

an F

ilter

-Co

mp

lem

enta

ry O

rth

ogo

nal

su

bsp

ace

Filt

er F

or

Effi

cien

t En

sem

ble

s (C

OFF

EE)

Sub

-op

tim

al s

chem

es

Bia

sed

sch

emes

N

on

-lin

eari

ty

Si

ngu

lar

Evo

luti

ve

Kal

man

filt

er (

SEEK

)

Sin

gula

r Ev

olu

tive

In

terp

ola

ted

Kal

man

fi

lter

(SE

IK)

Co

nti

no

us-

tim

e

Spar

se m

atri

ces

Exte

nsi

on

s o

f Ex

ten

ded

Kal

man

Fi

lter

- C

on

tin

uo

us-

tim

e ex

ten

ded

K

alm

an f

ilter

-Co

nti

nu

ou

s-d

iscr

ete

Kal

man

filt

er

Fig

ure

2.18

.:Sch

eme

wit

hso

me

ofth

em

ost

use

dK

alm

anfilt

erva

riants

Final Project - Marcos Cruz Santiago 27

Page 42: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

2.2.4.1. Sparce matrices variants

The most famous approach in this group is Fast Kalman Filter. It is used with real-timefiltering applications such as real imaging and satellite imaging of the Earth. Fast Kalmanfilter is generally to systems with sparce matrices. Sparce matrices are big matrices with hugeamounts of zero elements, requiring a great amount of memory and process time [29].

2.2.4.2. Continuous-time variants

KF only works with discrete systems, so in order to use this technique on a continuous systemsome interesting techniques had been developed. One of the most wide used approaches isKalman Bucy filter. The algorithm of this filter is based on two main differential equations: onefor the state estimate and another one for the covariance. Another important point regardingKalman Bucy filter is that the prediction and update steps of discrete Kalman filtering methoddoes not exist in a distinguished manner as it works with continuous time [10].

2.2.4.3. Non-linearity variants

One of the most restrictive constraints in KF usage is that of a linear model. As showedin previous sections some variants had been developed, as EKF and EKS (further developedin section 2.2.2 and 2.2.3 respectively), to work with non-linear systems. This variants workbasically in the same way as KF but have a previous step of linearization of the non-linearmodel. This branch is the most interesting for the purpose of this work, so interesting variantsare introduced in this subsection;

The Unscented Kalman Filter An improvement to the extended Kalman filter led to thedevelopment of the Unscented Kalman Filter (UKF), also a nonlinear filter, developed for highlynonlinear systems. Sometimes, the linear estimate of the nonlinear model does not provide agood approximation of the model. Hence EKF does not track the desired signal around sharpturning points. UKF is a filter based on the unscented transform, a method for the estimationof the first and second order statistics of the outputs of highly nonlinear systems with Gaussianinputs. In fact, for the UKF the linearization of the system model is no longer necessary since theprior estimate of the state covariance matrix, which is required for the Kalman gain calculations,is directly estimated using the UT. The theory of the UKF and its implementation issues havealready been discussed in the literature [19].

Invariant Extended Kalman Filter The invariant extended Kalman filter (IEKF) is a modifi-cation of the EKF for nonlinear systems possessing symmetries (or invariance). It merges theadvantages of both the EKF and the recently introduced symmetry-preserving filters. It notuses a linear correction term based on a linear output error, but also it uses a geometricallyadapted correction term which is based on an invariant output error. In the same manner thegain matrix is not refreshed from a linear state error, but from an invariant state error. Themain advantage is that the gain and covariance equations converge to constant values on a muchbigger set of trajectories than equilibrium points as it is the case for the EKF, which results ina better convergence of the estimation [8].

2.2.4.4. Biased variants

KF initial restrictions regarding to noise have been treated too. There exist some algorithmsprepared for working with biased schemes, like Colored-Noise Kalman Filter [9].

Final Project - Marcos Cruz Santiago 28

Page 43: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

2.2.4.5. Sub-optimal variants

Finally, different kind of sub optimal schemes exists for working with huge amounts of variablesin which optimally is sacrificed in order to achieve faster algorithms. One of the most represen-tatives techniques of this branch is ensemble Kalman filter. It was originated as a version of theKF for large problems (essentially, the covariance matrix is substituted for a sample covariance),and it is now an important data assimilation component of ensemble forecasting. This techniqueis related to the particle filter but taking the hypothesis that all probability distributions in-volved are Gaussian. Also, when it is applicable, it has much more efficient performance than aconventional particle filter [20].

2.3. Application of Kalman Filters in ECG processing

KF is a very powerful tool for controlling noisy systems. KF applications are numerous, beingcommonly used in different fields as tracking objects (e.g., missiles, faces), economics, navigation,computer vision applications, weather forecasting, seismology, orbit determination, etc [26].

Although KF is designed with the purpose of finding the hidden state of a system, it can beused in lot of scenarios. Actually, it can be combined with different techniques to achieve veryinteresting schemes.

This chapter contains a review of the most interesting applications of KF in the field of interestof this work: ECG processing. Within this section, KF applications have been divided in threegroups:

• Applications related with ECG denoising. Including here general applications of cleaninga noisy signal, as well as systems to remove concrete noise signals.

• Applications dedicated to estimate or extract a parameter.

• Applications related with other uses.

2.3.1. ECG denoising

2.3.1.1. ECG denoising using Bayesian filtering framework

Noisy ECG recordings can be denoised using Bayesian filtering framework. An efficient filteringprocedure based on the EKF can be achieved [52]. The required dynamic models of the ECG arebased on a modified nonlinear dynamic model (this model is explained in section 3.2.3), suggestedfor the generation of a highly realistic synthetic ECG. A modified version of this model is usedin several Bayesian filters, including the EKF, EKS, and UKF. Also, an automatic parameterselection method can be introduced, this make easier the adaptation of the model parametersto a vast variety of ECGs [48].

The results obtained by different authors [52, 48] prove superior results compared with con-ventional ECG denoising approaches such as bandpass filtering, adaptive filtering, and waveletdenoising, over a wide range of ECG SNRs. Schemes based on Bayesian filtering have alsosuccessfully tested on real nonstationary muscular artifact. Thus, this schemes may serve as aneffective framework for the model-based filtering of noisy ECG recordings [3]. An example offilter performance can be seen in fig. 2.19.

2.3.1.2. An Adaptive Kalman Filter for ECG Signal Enhancement

Although in section 2.2 it had been said that KF is not appropriated for real systems, severalschemes had been developed for this purpose. Basic KF architecture should be avoided for

Final Project - Marcos Cruz Santiago 29

Page 44: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

19 19.5 20 20.5 21

-200

-100

0

100

200

300

400

Time (sec)

Am

plit

ude

(mV

)

Noisy Clean EKF17

Figure 2.19.: ECG denoising example using a Bayesian filtering framework. EKF17 denotes thatan EKF had been used with a model of 17 state variables [52].

signals like ECGs. Nevertheless it can be used for the construction of an adaptive filter fordenoising an ECG signal, as it has been done by Vullings et al. [65].

As it had been introduced in section 2.1, a possible method for ECG denoising is to averageseveral beats. By doing this some possible clinically relevant physiological signal dynamics canbe lost. From this, it is clear that the averaging of ECG complexes entails a tradeoff between thepursued increase in the signal to noise ratio (SNR) and the time scale at which physiologicallyrelevant changes in ECG morphology are expected to occur.

In Vullings scheme, a filter adaptively varies the number of complexes included in the av-eraging based on the attributes of the ECG signal. This filter includes a KF. KF makes thefilter capable to adaptively estimate the process and its measurement noise covariances. Thisis achieved by giving more weight to newly arriving measurements when they contains morpho-logical variability, and of reducing the weigh in cases of no morphological variability [62].

2.3.1.3. ECG denoising while compressing using modified extended Kalman filter

An efficient denoising and lossy compression scheme for ECG signals can be achieved by using amodified EKF structure. A two-dimensional EKF structure can be used. Its governing equationsmodified to be extended to a 17-dimensional case (5 Gaussians with 3 parameters per Gaussian,and two additional control parameters). With the advantage of that this scheme is used notonly for denoising, but also for compression, since it provides estimation for each of the new 15model parameters. Using these specific parameters, the signal is reconstructed with regard tothe dynamical equations of the model [54].

Final Project - Marcos Cruz Santiago 30

Page 45: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

2.3.1.4. KF for removing Baseline Wander in ECG signals

Baseline wander might induce misleading measurement and annotation of the signal’s features.An adaptive KF for the real time removal of baseline wandering using a polynomial approxi-mation independent of the signal characteristics is described by Mneimneh et al. [37]. A statespace model is used with an adaptive KF to estimate the state variables, including the baselinewander approximation from the previous values of the original ECG signal.

2.3.1.5. Kalman filtering for removing cardiopulmonary resuscitation artifacts

Ventricular fibrillation has been observed as the initial rhythm in almost the half of sudden car-diac arrest patients. Immediate cardiopulmonary resuscitation and early electrical defibrillationare the recommended treatment for ventricular fibrillation cardiac arrest. Each minute delay indefibrillation reduces the probability of survival to hospital discharge [45].

The removal of cardiopulmonary resuscitation artifacts from the ECG would enable the anal-ysis of the underlying rhythm without pauses in chest compressions. However, cardiopulmonaryresuscitation artifacts are very variable, and show an important spectral overlap with humanventricular fibrillation. This artifacts have been removed successfully using adaptive filters, thatusually require reference signals from extra equipment to characterize the chest compressions[43].

Cardiopulmonary resuscitation suppression can also be designed based on a Kalman filters[45,32]. The artifact is modeled in this approach using a dynamical estimate of its fundamental fre-quency, obtained from a spectral analysis of the surface ECG. Artificial mixtures of humanshockable rhythms and cardiopulmonary resuscitation artifacts can be used to design the algo-rithm.

2.3.2. Parameters estimation

2.3.2.1. Blood pressure and heart rate estimators using Kalman filtering

Arterial blood pressure, within the intensive care unit, is typically recorded at different samplingfrequencies, and from different sensors. Moreover it is often corrupted by troublesome artifactsand noise which are often non-Gaussian, nonlinear and nonstationary. The extraction of robustparameters from such signals, and to provide confidences in the estimates is therefore a chal-lenging task. Therefore, the method requires an adaptive filtering approach which accounts forartifact types [31].

A solution described in the literature is to construct an arterial blood pressure signal qualityindex [31]: based upon the combination of two previously reported signal quality measuresweighted together. One index measures morphological normality, and the other degradation dueto noise. A robust tracking algorithm was designed by Li [31] for estimating blood pressure andheart rate based upon a KF with an update sequence. Which is modified by the KF innovationsequence and the value of the signal quality index. A complete scheme of the procedure can beseen in fig. 2.20.

2.3.2.2. Time-varying spectrum estimation of heart rate variability signals

A design for estimating the time-varying spectrum of heart rate variability has been describedby Tarvarien [60]. Heart rate variability signal was modeled at first with a time-varying au-toregressive (AR) model. These AR model parameters were solved recursively with a Kalmansmoother algorithm. Time-varying spectrum estimates were then obtained from the estimated

Final Project - Marcos Cruz Santiago 31

Page 46: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

Figure 2.20.: General method for deriving heart rate and blood pressure [31].

model parameters. Finally, the obtained spectrum was further decomposed into separate com-ponents. This model is especially advantageous in heart rate variability applications where lowfrequency and high frequency components are generally aimed to be distinguished [60, 61].

2.3.2.3. Data Fusion for Improved Respiration Rate Estimation

An application to estimate the respiratory rate from multiple physiological sources had beendeveloped by Nemati [40]. This method is based on a modified KF framework for data fusion.Having the main advantage that it is robust to background noise. To develop the system a novelindex of the underlying signal quality of respiratory signals was designed. Then, the index wasused to modify the noise covariance matrix of the KF. This operation discounts the effect ofnoisy data. The signal quality index, together with the KF innovation sequence, is also used toweight multiple independent estimates of the respiratory rate from independent KFs [40].

2.3.2.4. Study of cardiac arrhythmias

Detecting arrhythmias from an ECG is of great importance for the continued developmentof intelligent cardiovascular monitors. The main goal is to present to the experts a ’high-level’analysis of the patient’s condition based upon ’low-level’ physiologic signals (e.g., blood pressure,heart rate, etc.) [56].

It is known that the variability of the R-R intervals in the ECG yields valuable informationconcerning the various types of arrhythmia that might be present. A detector of cardiac ar-rhythmias had been developed by Wolfson et al. [67] with a KF identifier. The KF identifierwas used in the calculation of time varying spectra of the data which allows to study the onsetof arrhythmia and also short bursts of arrhythmia.

In KF identifier the interbeat interval is modeled as an autoregressive process (AR) with ARcoefficients being allowed to vary with time. At each time point, an “instantaneous” spectrumat a particular time may be constructed from the AR coefficients. KF was applied in trackingfrequency changes in simulated data.

Final Project - Marcos Cruz Santiago 32

Page 47: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 2. STATE OF THE ART

2.3.2.5. Detection of QRS-Wave based on Kalman and Wavelets

A promising approach to detect QRS complexes was developed by Chen et al [12]. The detectioncould be done by using an algorithm composed of wavelet and Kalman filters. The constructedadaptive algorithm first was set to establish a model of the electrocardiogram. Thus the algo-rithm was able to change its own model according to the changes on the ECG signal. Secondly,based on the model established, the Wavelet and Kalman algorithms were combined, to decom-pose the signal in several scales and filtering the signal within each scale. Finally, a decisionrule was used to determine the QRS complex.

2.3.2.6. Kalman Filter in fECG extraction

Bayesian Framework is a very promising technique in the field of fetal ECG (fECG) extractionin a non invasive way. Several approaches of different authors, like Sameni [48, 47, 46] andSayadi [51] had proven that good results can be achieved using Bayesian framework for thispurpose. As one of the goals of this project is to develop a fECG extraction system, that pointise reviewed with further detail in section 3.2.

2.3.3. Other related uses

2.3.3.1. Intelligent classification of ECG using EKF based neuro fuzzy system

A system for intelligent classification of ECGs was developed by Meau et al. [36]. The methodconsists of a hybrid EKF based Multi Layer Perceptron Network and an one-pass learning FuzzyInference System using Look-up Table Scheme for the recognition of ECG signals.

EKF was employed in the training algorithm for the neural model. In essence, the neuralnetwork’s training problem was cast into the framework of a classic state estimation problem.In such a scenario, the neural network was described as a nonlinear dynamic system in a state-space model. In this model the weights were treated as the state of the system. The goal is touse a series of measurements to determine the optimal estimate of the state variables [36]. Inthe EKF method, the output error, was scaled by the Kalman gain and then used to updatethe weights according to the EKF equations. The training continues in this fashion for severalepochs through the training data until a satisfactory neural model is achieved.

2.3.3.2. Modeling of nonstationary time series with various analysis purposes

KF is able to model lot of different parameters if it is provided with valid a priori data. Thisdata is used to build a dynamic model that mimic the system to study. One manner to buildsuch a model is by using an AR model.

For instance, this base has been used by Arnold et al. [6] to develop an adaptive on-line pro-cedure for AR modeling of nonstationary multivariate time series. In this scheme, instantaneousmeasures of linear dependence had been computed by using the parameters of the estimatedtime-varying model. The usefulness of the mentioned procedures is the analysis of physiologi-cal signals: Analysis of respiratory movements, heart rate fluctuations, blood pressure and theanalysis of multichannel electroencephalogram signals.

However, this kind of scheme can be applied in order to develop complexer models, in addition,by combining different advanced techniques (for instance, non linear techniques) very interestingmodels can be generated in order that a KF approach can extract useful parameters.

Final Project - Marcos Cruz Santiago 33

Page 48: TECHNISCHE UNIVERSITAT DRESDEN

3. Implementation

This chapter deals with the methodology applied to the fetal ECG extraction system. Firstsection 3.1 treats the acquisition of the data (both real and simulated). Further on section 3.2the extraction method which is applied is described in detail. Finally, in section 3.3 the qualityindices used to evaluate the obtained results are described.

3.1. Test Data

3.1.1. Simulated Data

With the purpose of testing the fetal extraction algorithm in different controlled scenarios sim-ulated data has been used. Within this work the same datasets of Andreotti [4] were used.

This simulated data was generated by using the well-known online datasets available fromMIT-BIH Physiobank [17]. These datasets are composed by many adult ECG recordings, in-volving the most distinguished health conditions and durations of time. From there, the “Nor-mal Sinus Rhythim Database” (NSRDB) [42] was selected for creating the generated data. Thisdatabase contains eighteen long-term ECG recordings of two channels from subjects withoutsignificant arrhythmias. Datasets from the NRSDB (and respective annotations) were originallysampled at 128 Hz but to create the simulated data the records were resampled at 500 Hz (formECG and remaining noise sources) and 1 kHz (for fECG) before usage.

As the aim of simulated data is to test the algorithm over different types of noise that can befound in real recordings, and to determine how this noise sources affect the signal, it is importantto include in the simulated abdominal signals also simulated noise sources. The simulated noisesources were superimposed to the maternal ECG signal with calibrated amplitudes. This noisesources were the following ones: baseline wander (bWa), electrohysterography (EHG), electrodemotion (EM) and muscular artifact (MA). The description of this noise sources is found in table3.1.

From the mentioned noise sources EM and MA are specially meaningful and they are treatedin detail in the performed tests. The reason is that EM artifacts are generally considered in theliterature the most troublesome noise sources, since they can mimic the appearance of ectopicbeats and cannot be removed easily by simple filters [17]. However, in the former work withinthis department, it was proven that the most harmful noise source for the developed scheme isthe MA noise source [4]. Thus, more attention may be paid with these two cases in order toextract some conclusions.

Table 3.1.: Noise sources from abdominal recordings characterization [63]. Table modified from [4].Noise Source Characteristics

mECG Repetitive disturbing signal

EMG Random signal with zero mean, Gaussian distribution andfrequency range between 100-200 Hz

Table continues on the next page..

34

Page 49: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

Continued TableNoise Source Characteristics

EHG Random signal with zero mean and Gaussian distribution.The frequency range is limited between the bands of0.2-0.45 Hz and 0.8-3 Hz, with the first band has threetimes the amplitude of the second. These contractionsoccur during 40-60 s every 10-120 min (0.5-6 contr/h),during pregnancy, and every 60-150 s (0.4-1 contr/min),during labor. An amplitude modulation, using a sinefunction, is applied to simulate the increase and decreaseof EHG during contractions

bWa Sine wave within the respiratory frequency range(0.15-0.3 Hz)

PLif Simply modeled by a 50 Hz sinusoid (in case of signalsrecorded in Europe) or 60 Hz.

A total of 324 signals were generated in the precursor of this work in IBMT [4] and are usedin this work. In this work they have been tested in EKF, EKS and ESC methods. Thesesignals include 9 different simulated “’patients” (by merging two resampled signals of NSRDB),4 different SNR rations between mother and fetal ECG’s (3dB, 6dB, 9dB, 12dB) and 9 differentkind of noises (bWa, EHG, EM and MA with two different SNR values and a no noise set).The detailed proceeding for simulated data creation is described in appendix B of [4]. Fig. 3.1depicts some of the simulated signals.

3.1.2. Real Data

One of the goals of this project is to work with real data recorded at the Department of Obstetricsand Gynecology (University of Leipzig). For this purpose, new data which was obtained froma modified recording scheme had to be annotated. This means that fetal and maternal QRScomplexes were annotated in order to have them as references.

This section is divided in two different subsections: Section 3.1.2.1 specifies the method, theelectrode positions and the characteristics of subjects which were included in this study. Section3.1.2.2 outlines the procedure which was applied to obtain manual annotations.

3.1.2.1. Acquisition and subjects

Ten measurements were selected for manual annotations. Recordings were carried out usingthe ADInstruments ML 138 Octal Bio Amp and the ADInstruments PowerLab 16/30. Theabdominal recordings were obtained by using the electrode configuration shown in fig. 3.2.Each dataset has a duration of 20 minutes. The measurements were obtained from six differentpatients (five measurements belong to the same patient, the remaining ones originate fromfive different patients). The records have been chosen to reflect a representative cross-section ofoccurring signal qualities. The women subjected to this study were aged between 21 and 33 years(µ = 29.5, σ = 4.4). Week of gestation of the patients was between 24 and 39 weeks (µ = 27.1,σ = 4.4). The body mass index of the patients ranged from 20.41 to 30.11 (µ = 25.95, σ = 4.02).The women and respective fetuses that were hospitalized at the Universitatsfrauenklinik Leipzigsuffered from the most various diseases such as preeclampsia, arrhythmias, IGUR, anemia andrupture of membranes.

Final Project - Marcos Cruz Santiago 35

Page 50: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

7.84 7.85 7.86 7.87 7.88 7.89

x 105

−2

−1

0

1

2

3

4

5

6

Samples (n)

No

rmal

ized

Am

plit

ud

e

rawdatafetal peaksmaternal peaks

(a) Comb. 1 (SNRfm = -3 dB)

7.84 7.85 7.86 7.87 7.88 7.89

x 105

−7

−6

−5

−4

−3

−2

−1

0

1

2

Samples (n)

No

rmal

ized

Am

plit

ud

e

rawdatafetal peaksmaternal peaks

(b) Comb. 1 (SNRfm = -3 dB, SNRfbWa=12 dB)

1.36 1.361 1.362 1.363 1.364 1.365

x 106

−2

−1

0

1

2

3

4

5

6

Samples (n)

No

rmal

ized

Am

plit

ud

e

rawdatafetal peaksmaternal peaks

(c) Comb. 3 (SNRfm=-6 dB)

1.36 1.361 1.362 1.363 1.364 1.365

x 106

−2

−1

0

1

2

3

4

5

6

Samples (n)

No

rmal

ized

Am

plit

ud

e

rawdatafetal peaksmaternal peaks

(d) Comb. 3 (SNRfm=-6 dB, SNRfehg=24 dB)

1.366 1.367 1.368 1.369 1.37 1.371 1.372

x 106

−2

−1

0

1

2

3

4

Samples (n)

No

rmal

ized

Am

plit

ud

e

rawdatafetal peaksmaternal peaks

(e) Comb. 5 (SNRfm=-9 dB)

1.366 1.367 1.368 1.369 1.37 1.371 1.372

x 106

−2

−1

0

1

2

3

4

Samples (n)

No

rmal

ized

Am

plit

ud

e

rawdatafetal peaksmaternal peaks

(f) Comb. 5 (SNRfm=-9 dB, SNRfem=12 dB)

9.6 9.61 9.62 9.63 9.64 9.65

x 105

−1

0

1

2

3

4

5

Samples (n)

No

rmal

ized

Am

plit

ud

e

rawdatafetal peaksmaternal peaks

(g) Comb. 7 (SNRfm=-12 dB)

9.6 9.61 9.62 9.63 9.64 9.65

x 105

−2

−1

0

1

2

3

4

5

Samples (n)

No

rmal

ized

Am

plit

ud

e

rawdatafetal peaksmaternal peaks

(h) Comb. 7 (SNR fm=-12 dB, SNRfma=24 dB)

Figure 3.1.: Example of resulting simulated datasets. For each plot, the respective annotationsare shown. Plots (a), (c), (e) and (g) contain no additional noise. [4]

Final Project - Marcos Cruz Santiago 36

Page 51: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

Front

Ref 6

7 8

Front

1

Ref4

3

2

5Ref Ref

Figure 3.2.: Diagram of the new data from Leipzig configuration of the electrodes. Note thatthe reference is not localized but used on either of the sides.

3.1.2.2. Annotation procedure

For manual annotations, a program which exists at IBMT was used. The program providesa GUI (Graphic User Interface) that allows the user to move through the signal, change thescale, load annotations, delete, correct and add annotation points and finally save them. Twodifferent types of reference annotations are required in this work: maternal R-peak and fetalR-peak annotations.

Maternal R-peak annotations are done almost automatically, by applying first a peak detector(In this work the detection algorithm used was the one developed by Suhrbier et. al [58], seesection 3.2.6 for further details) in the maternal reference signal (channel one of the depictedelectrode configuration). Normally this procedure can be done without any error, as the qualityof the maternal reference channel is good enough. Therefore, for this kind of annotations onlya rough supervising work must be done on the GUI using only the maternal reference signal.

In the case of fetal R-peak annotations the procedure is quite similar, but more complex.Similarly as regards maternal references, the procedure is to detect automatically fetal peaksby using a fetal extraction algorithm. In the case of this work the fetal extraction algorithm isbased on KF (detailed in next section 3.2). Note that to perform this step, in case of requiringmaternal annotations for the fetal extraction algorithm, this maternal annotations must be donebefore.

Unlike maternal annotations, automated fetal peak detections use to have errors. Thereforethis annotations must be carefully supervised on the mentioned GUI. Moreover, in some sectionsof the observed channel the signal can be very weak or enough noisy to have the fetal signalmasked by noise. A good practice to be able to detect correctly all the fetal peaks is to use morethan one channel at a time to correct the annotations.

For ease of annotation, in this project, the maternal reference and two abdominal channelshad been used in order to annotate fetal ECG, as depicted in fig. 3.3. The two channels chosenare the ones with better quality. This choice was done by visual inspection. Additionally, ifthere is the possibility, one of the two channels is chosen with inverted fetal QRS complexes, inorder to distinguish fetal peaks in noisy scenarios. Also this two channels are preprocessed (seesection 3.2.1) in order to avoid some uncomfortable noise sources. The respective channels usedfor the manual created annotations are listed in table 3.2.

Fetal peak annotations had been done according the following rules:

1. A peak must be annotated as long as it is visible in at least one of the two abdominal

Final Project - Marcos Cruz Santiago 37

Page 52: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

Figure 3.3.: Screenshot of the program and example of the procedure to make manual annota-tions on real data.

Signal Chanel 1 Chanel 2

AB080882 6 7

AD251091 5 6

LD141088 6 7

SJ010284 5 7

SL290885 4 6

SH180479IV 7 8

SH180479V 7 8

SH180479VI 6 8

SH180479VII 4 8

SH180479VIII 2 7

Table 3.2.: Channels used on the annotations of real data signals. Note that this channels havebeen used preprocessed first in order to avoid uncomfortable noise sources.

channels.

2. If one or two consecutive peaks were hidden by noise or overlapped by a maternal QRScomplex, they must be annotated in case that there are some visual evidences that theremust be a peak there. See fig. 3.4.

3. In any other case no annotation is made, see fig. 3.5.

Final Project - Marcos Cruz Santiago 38

Page 53: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

Figure 3.4.: Example of annotation procedure in case of evidences of peaks in a noisy scenario.Note that the first depicted peak is almost masked. Nevertheless with the referenceof the following peaks is possible to detect its position. Therefore, it must be marked.SH180479V is the depicted signal. The picture is a screenshot of the GUI used forthe manual annotation.

Figure 3.5.: Example of annotation procedure in case of no evidences of peaks. SH180479V isthe depicted signal. The picture is a screenshot of the GUI used for the manualannotation. The picture is a screenshot of the GUI used for the manual annotation.

Final Project - Marcos Cruz Santiago 39

Page 54: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

3.2. Extraction Method

As it has been justified in previous sections, the Bayesian framework constitutes a promisingapproach for fECG extraction. Specifically when the Kalman based filter is used with a prioriinformation, or in other words, with a inner nonlinear dynamic model. This model is introducedin 3.2.3.

As this work is the pioneer on IBMT while using Kalman filtering framework, two methodshave been developed in order to held a comparison between both. The developed methods wereEKF and EKS. The choice of them among the huge Kalman family (see fig. 2.18) is due to thenon-linearity of the system. As it has been previously stated, the ECG is a clear example ofnon-linear signal. Therefore if a branch of KF variants needs to be selected, that branch shouldbe the non-linearity one. Amongst KF’s non-linear variants, EKF and EKS are chosen for theirsimplicity over other more complex methods such as UKF or KF hybrids. Moreover, the choiceof EKF and EKS allows to compare between a system that does not use future or a posterioriinformation (EKF) and a system that does it (EKS).

A general structure for fECG extraction based on Kalman filtering can be constructed withfour blocks. They can be summarized, as follows:

• Preprocessing block : In this stage noise sources as power-line interference and a part ofthe EHG are suppressed.

• Maternal ECG filtering block : This block has the goal to extract a clean mECG from pre-processed data. It is composed of a EKF or EKS and the procedures to obtain EKF/EKSparameters.

• Fetal signal subtraction block : In this step the clean maternal ECG is subtracted from thepreprocessed signal. Obtaining a signal without maternal reference.

• Fetal ECG filtering block : This final step is optional and recommended if not only fHR iswanted but also information on the morphology. This block has the goal to extract a cleanfECG. It is composed of another EKF or EKS and the procedures to obtain EKF/EKSparameters, but can be changed for any other filter designed to clean an ECG signal. Notethat maternal and fetal filtering blocks are similar blocks, but with different inputs and inconsequence with different inner parameters.

As the aim of this study is to develop a system able to extract the fHR, the fourth block isnot going to be used withing this work. Instead of the post-processing block, an additional stepof peak detection is applied to the output of the third block (fetal signal subtraction block). Ina scheme provided with a fetal ECG filtering block, the peak detector must be applied in theoutput of this last one. The extraction method implemented in this work can be structured infour different steps, as depicted in fig. 3.6.

The depicted four steps are treated with more detailed in the following sections. Specially,the maternal ECG filtering block. A global overview of this block is depicted in fig. 3.7.

As stated, the maternal filtering block has the goal to obtain from the processed data (whichincludes fECG and mECG) a clean mECG signal. This process is done through four differentsub processes:

• Phase alignement : A phase is generated in order to synchronize the observed measurementswith the model. This phase is generated by using maternal QRS complexes references andassigning a linear phase between maternal R-peaks.

Final Project - Marcos Cruz Santiago 40

Page 55: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

Pre-Processing

Fetal signal substraction

Peak detection

MaternalECG

filtering

Figure 3.6.: Block scheme of a complete system of fECG extraction.

Phase AlignementPhase wrapping and ensemble average

calculation

KF and model parameters derivations

Cleaned ECGKalman Filtering

Processed Data

Figure 3.7.: Block scheme of a ECG processing block. Green shapes represent data, blue squaresrepresent processes and purple box a Kalman filter (EKF or EKS).

• Phase wrapping and ensemble average calculation: The signal is cut into segments of a de-termined length and these segments are aligned and transformed to cylindrical coordinateswith the help of the previous obtained phase. The aligned beats are averaged.

• KF and model parameters derivations: From the obtained mean a model is constructedby means of Gaussians. This Gaussians try to fit into the previous obtained mean. Also,in this step parameters required for KF are estimated or calculated.

• Kalman filtering : EKF or EKS is applied to the preprocessed signal using the modelconstructed in the previous step. As output of this block the maternal clean ECG isobtained.

In the following sections, each one of the four general blocks depicted in fig. 3.6 and the specificfour sub routines regarding the maternal extraction blocks are detailed. Moreover, additionalsections are included in order to specify the observation equations, to explain the used innermodel and its derivation in EKF/EKS.

Final Project - Marcos Cruz Santiago 41

Page 56: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

3.2.1. Preprocesing

For the sake of comparison with the former work developed at IBMT [4] work the same prepro-cessing module was selected as in [4]. As the impact of preprocessing is not in the scope of thiswork, only a high level review of scheme is given here. For further details on the chosen method,section 5.1.2 of Andreotti [4] provides a detailed description.

Firstly a finite impulse response (FIR) bandpass filter is applied to the raw data on the band ofinterest. That produces the suppression of existing noise sources and also the partial suppressionof harming noises like the electrohysterography noise source (EHG) 1. Harmonics belonging tothe power-line interference and some of the motion artifacts with muscular activity are alsosuppressed by this bandpass filter.

Finally, the residual power-line interference (50 Hz for the real data as it was recorded inEurope, and 60 Hz for the simulated data as the NRSDB was recorded in America) is suppressedwith a 1000 tap notch FIR filter. The notch filter is a bandstop filter around the band of interestthat is wanted to be canceled (50 Hz for real recordings and 60 Hz for simulated data).

3.2.2. Observation Equations

In order to understand the behavior of the extraction technique which developed in this study itis interesting to clarify before which are the used inputs for the filter. The approach presentedhere not only uses the measured abdominal recordings as input but also the maternal peakdetections. In detail:

• ECG recordings: Abdominal recordings (zk) are assumed the main observations forthe KF. The relationship between the states and observations of the KF depends on thelocation of the electrodes and the origin of the measurement noise. For example, motionartifacts, environmental noise or bioelectrical artifacts such as EMG or electrogastric noise,may be assumed as additive measurement noises.

• Maternal peaks: In addition to the noisy ECG observations, maternal reference peaksare used to build a phase (θk) that can also be added as a second observation. Thisadditional phase information is chosen to help to synchronize the dynamical KF trajectorieswith the reference noisy signals, without the need for manual synchronization.

The used input parameters can be seen graphically in fig. 3.8. Note that this two inputs (zkand θk) are affected by observation noise. In addition, every input is related with a noise source(uk and vk) which are supposed to be uncorrelated. The noisy ECG zk with the measurementnoise vk is considered as the observation parameter sk. The R-peak detections, that are usedfor the phase extraction is named φk.

Therefore the phase observations φk and the noisy ECG measurements sk may be related tothe state vector as follows: [

φksk

]=

[1 00 1

].

[θkzk

]+

[ukvk

](3.1)

In addition, Rk = E{[uk, vk]T [uk, vk]} the observation noise covariance matrix can be defined.This matrix describes the degree of reliability of a single observation. In other words, a ratherprecise measurement of the states of a system is valid if the diagonal entries of Rk are small,and the KF gain is adapted so as to rely on that specific measurement. However, where the

1EHG can not be completely suppressed as its frequency spectrum is overlapped with the fECG’s spectrum. Acomplete filtering of this noise source would cause the lost of fECG information.

Final Project - Marcos Cruz Santiago 42

Page 57: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

594 595 596 597 598 599 600 601 602

0

2

4

time (sec.)

Arb

itrar

y un

its

Preprocessed dataPhase reference

Figure 3.8.: Input parameters for EKF/EKS. Blue line depicts abdominal recordings and redcircles maternal phase references.

measurements are too noisy or there are no measurements available, the Rk entries are largeand the KF tends to follow its internal dynamics rather than tracking the observations [46].

3.2.3. Dynamic ECG Model

3.2.3.1. Syntethic ECG Generator

Before entering in details with the maternal ECG filtering block, it must be discussed themathematical form of the dynamic model of the filter. KFs are expected to achieve betterperformance compared to other filters in part due to their ability to merge all the informationprovided to them, including a priori information. This a priori information can be translated asthe KF inner dynamic model. KF should estimate the hidden desired parameters by evaluatingthe measures received from the system and its inner dynamics. This evaluation is done throughKF gain.

There are several ways to design this inner dynamic model. The most commonly used in theliterature is the synthetic ECG generator proposed by McSharry et al. [35]. This model hasa variable number of free parameters that make it adaptable to many normal and abnormalECGs. The dynamic model consists of a set of nonlinear dynamic state equations in Cartesiancoordinates:

x = px− ωyy = py + ωx

z = −∑

i∈{P,Q,R,S,T}

ai∆θiexp(−∆θ2i2b2i

)− (z − zo)(3.2)

Being x, y, and z the state variables. p defined as p = 1 −√x2 + y2. ∆θi is defined as

∆θi = (θ − θi)mod(2π) θ = atan2(y, x) 2 being the four quadrant arctangent of the elementsof x and y, with −π ≤ atan2(y, x) ≤ π. w represents the angular velocity of the trajectory

2In a variety of computer languages, the two-argument function atan2 is a variation of the arctangent function.For any real number (e.g., floating point) arguments x and y not both equal to zero, atan2(y, x) is the angle inradians between the positive x-axis of a plane and the point given by the coordinates (x, y) on it. The angleis positive for counter-clockwise angles (upper half-plane, y > 0), and negative for clockwise angles (lowerhalf-plane, y < 0).

Final Project - Marcos Cruz Santiago 43

Page 58: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

2.74 2.76 2.78 2.8 2.82 2.84 2.86 2.88 2.9

x 104

0

0.5

1

samples (n)

Arb

itrar

y un

its

Figure 3.9.: Synthetic ECG generated for test purposes. KF generate a signal like this one touse as model. KF output is a weighted devision between observed measurementsand model.

as it moves around the x − y plane [53]. The ai, bi, and θi terms in 3.2 correspond to theamplitude, width and center parameters of the Gaussian terms of this equation. ω relates theangular frequency. In this model, the baseline wander of the ECG is modeled with the parameterz0 that is assumed to be a relatively sinusoidal noise component coupled with the respiratoryfrequency [35].

As it can be seen in 3.2, formally each of the P , Q, R, S and T waves of the ECG waveform arelocated at a specific angular positions θi and they are modeled by means of Gaussian functions.However, assigning only one Gaussian to every wave is not a good practice. Waves belonging toQRS complex do not have the same importance, and some of them are going may require morethan one Gaussian to be constructed. Thus, in the model construction step, this Gaussians aredivided between the important waves of the QRS complex. Section 3.2.4 discuss the relevanceof the number of Gaussians.

It can be noticed that these equations consist in a circular limit cycle in the x − y planethat is pushed up and down as it approaches each of the θi [53]. The z coordinate of thisthree dimensional trajectory, when plotted versus time gives the synthetic ECG. By introducingsome random variations into the parameters it is possible to generate quasi-periodic signals thatappear to be realistic ECG.

Some typical values of this last parameters are listed in the literature in form of tables [35] aswell as techniques to estimate this parameters [13]. These techniques involve methods for esti-mating values of model parameters in realistic ECGs. They are based on nonlinear optimizationof 3.2 for a given ECG dataset.

Note also, that the described dynamic ECG model can also work as a synthetic ECG generator(see fig. 3.2.3.1). In fact, KF works generating this model (a synthetic ECG) to compare it withthe observed measurements. During Kalman filtering, the filter generates online the model. Atevery time instant, there is only one model sample within the filter. So the filter, do not needto store two vectors (observed measurements and model).

3.2.3.2. Modification of the Dynamic ECG Model

In spite of its general applicability, the model and the dynamic equations proposed by McSharryet al. [35] can be largely improved by some modifications. As it was reported by R.Sameni in

Final Project - Marcos Cruz Santiago 44

Page 59: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

[47], Cartesian coordinates are not the best approach for equation 3.2. Polar coordinates aremore appropriate as it is discussed in this section. Furthermore, assuming the z state variablein 3.2 to be in millivolts, bi’s and θi’s in radians, and time in seconds, it is clear that the ai’sterms in 3.2 can be replaced with:

ai =αiω

b2ii ∈ {P,Q,R, S, T} (3.3)

where the αi relates the peak amplitudes of the Gaussian functions used to model each ofthe ECG components, in millivolts. By using this nomenclature, neglecting the baseline wanderterm (z − z0) and integrating the z equation with respect to t a new form of the dynamicequations can be expressed in polar coordinates as follows:

r = r(1− r)θ = ω

z = −∑

i∈{P,Q,R,S,T}

aiω

b2i∆θiexp(−

∆θ2i2b2i

)(3.4)

Where r and θ are, respectively, the radial and angular state variables expressed in polarcoordinates. These new sets of equations have some benefits compared to the original equationsproposed by McSharry [35]. In first term, the polar form is much simpler and its interpretationis straightforward [48]. Accordingly, the first equation in 3.4 represents the radial behavior ofthe generated trajectory, and converges to the limit cycle of r = 1 for initial value of r ≥ 1.Nevertheless, the second and third equations are independent from r, making the first differentialequation redundant. Therefore, the first equation may be discarted as it does not affect thesynthetic ECG (the z state variable). Another strong point of this modified representation isthat the phase parameter θ, is an meaningful state variable that describes the angular positionof the P , Q, R, S and T waves. This point is used in the implementation of the filter.

Moreover, equation 3.4 may be further simplified by discarding the baseline wander term(z−z0). In this case, the simplified dynamic model of 3.4 in its discrete form, with the assumptionof a small sampling period of δ is as follows:

θk+1 = (θk + ωδ)mod(2π)

zk+1 = −∑i

δaiω

b2i∆θiexp(−

∆θ2i2b2i

) + zk + η (3.5)

where ∆θi = (θk − θi)mod(2π), η is a random additive noise that models the inaccuracies ofthe dynamic model, and the summation over i is taken over the number of Gaussian functionsused for the modeling the shape of the desired ECG channel. In fact, due to the flexibility ofGaussian mixtures, it is believed that by using a sufficient number of Gaussian functions, theycan be fitted to signals recorded from different ECG leads. Moreover, θk and zk are assumed asthe state variables. w, αi, θi, bi, and η are assumed as independent and identically distributedGaussian random variables considered to be process noises. To be consequent with the notationproposed on 2.2.2 about Kalman Filter, the system state and process noise vectors are definedas follows:

xk = [θk, zk]T

wk = [αP , ...αT , bP , ..., bT , θP , ..., θT , ω, η]T (3.6)

Final Project - Marcos Cruz Santiago 45

Page 60: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

And the process noise covariance matrix is given by Qk = E{wkwTk }.

3.2.3.3. Linearization of the nonlinear dynamic model

As it has been stated on section 2.2.2, in order to set up an EKF it is needed to have alinearized version of the model. Consequently, the state equation 3.5 requires linearization.This linearization is performed by linearizing both, model and process noise components. Infirst term, the non linear state equations can be defined:

{θk+1 = F0(θk, ω, k)zk+1 = F1(θk, zk, ω, αi, θi, bi, η, k)

(3.7)

This equations must be derived in order to linearize the system. Regarding the model, thefollowing partial derivatives are defined:

∂F0

∂zk= 0

∂F0

∂θk=∂F1

∂zk= 1

∂F1

∂θk= −

∑i∈{P,Q,R,S,T}

δαiω

b2i[1− ∆θ2i

b2i]exp(−∆θ2i

2b2i)

(3.8)

These equations represent the linearized model with respect to the state variables θk andzk. In addition, a second set of equations regarding the linearization of 3.7 with respect to theprocess noise components must be defined:

∂F0

∂ω= δ

∂F1

∂η= 1 i ∈ {P,Q,R, S, T}

∂F0

∂αi=∂F0

∂bi=∂F0

∂θi=∂F0

∂η= 0

∂F1

∂αi= −δω∆θi

b2iexp(−∆θ2i

2b2i)

∂F1

∂bi= −2δ

αiω∆θib3i

[1− ∆θ2i2b2i

]exp(−∆θ2i2b2i

)

∂F1

∂θi= δ

αiω

b2i[1− ∆θ2i

2b2i]exp(−∆θ2i

2b2i)

∂F1

∂ω= −

∑iδω∆θib2i

exp(−∆θ2i2b2i

)

(3.9)

3.2.4. Maternal ECG filtering

The main goal of this processing block is to extract a clean mECG. mECG is considered as oneof the most harmful interference when trying to obtain the clean fECG component because bothmECG and fECG are overlapped in time and frequency. Therefore, the maternal interferencemust be extracted by first being it estimated.

This section follows the scheme depicted in fig. 3.7. The intuitive steps within this blockis to build a dynamic model which is used as reference for KF. The dynamic inner KF model,represents the a priori knowledge over the studied system. In general terms, KF execution relieson two factors: the observation equations and its inner model. Depending on how reliable are

Final Project - Marcos Cruz Santiago 46

Page 61: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

these factors, the filter will put more weight in one or the other. Unlike the observations, themodel can be designed. To sum up, the better model is designed, the better results are obtained.

3.2.4.1. Phase alignment

In section 3.2.3 the equations that are going to describe the model have been discussed. Thesemodel equations 3.4 are dependent of some parameters. So in order to construct the model, infirst term, these parameters should be estimated from the signal.

As it has been stated on section 3.2.2, observation equations are formed from the noisy ECGrecordings and a phase θk. This additional phase information also help to synchronize thedynamical KF model with the observations. Therefore, in first term, this phase should beobtained.

For this purpose, the following assumption can be made. R-peaks are always assumed to belocated at θ = 0 and the ECG contents lying between two consecutive R-peaks are assumed tohave a phase between −π and π. To achieve this configuration, in first term, a peak detectionhas to be done (or in case of having correct annotations of R-peaks, they are loaded). Then aphase 0 is given to those R-peak points and the remaining points are linearly assigned between−π and π. Fig. 3.10 depicts a typical phase alignment.

75 75.5 76 76.5 77 77.5 78 78.5 79 79.5 80

−3

−2

−1

0

1

2

3

4

5

Phase Calculation

time (sec.)

Arb

itrar

y un

its

Scaled ECGmECG referencesAsigned phase

Figure 3.10.: Linear phase alignment of a signal made from maternal peak annotations.

Note that an improved phase alignment could be achieved by considering P, Q, R, S and Twaves and giving the phase between R-peaks not linearly but according with this [48]. Nev-ertheless, the R peak is far more reliable, especially in noisy signals. Therefore the alignmentusing only R-peak detections seem to be justified.

3.2.4.2. Phase wrapping and ensemble average calculation

Once the phase is extracted, the next step is to obtain the mean and standard deviation of thesignal to estimate from these values the correct parameters for the KF and to produce a model.

Final Project - Marcos Cruz Santiago 47

Page 62: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

−1−0.5

00.5

1

−1−0.5

00.5

1−2

0

2

4

6

X (Arbitrary units)

Phase−wrapped ECG

Y (Arbitrary units)

EC

G (

Arb

itrar

y un

its)

Figure 3.11.: Phase Wrapping example of abdominal recordings. To produce this graphic, first alinear phase alignment is done over preprocessed data and then a phase wrapping isapplied to time segments. In this figure, phase wrapping was made with a wrappingtime twrap of 200 seconds. The wrapping procedure is to transform the segmentinto cylindrical coordinates with a radius of 1.

As there is a phase assigned to each sample of the signal, a phase wrapping is an easy methodto get these parameters.

A phase wrapping consists in the transformation to a three-dimensional representation of asignal with a phase assigned. The procedure is to assign the observed signal versus the periodicphases that are assigned to each sample in polar coordinates on the unit circle (r=1). A typicalphase-wrapped abdominal ECG may be seen in fig. 3.11.

Note that, while working with real signals of considerable duration, the phase should notbe wrapped using all the samples. This is due to dynamism in biomedical signals. From aphysiological point of view, it is defective to consider too long periods as exhibiting equal heartrates. Contrariwise, the mean of the ECG is extracted from this wrapped signal, so a too smallnumber of beats may fail to provide a trustful average beat. The mean may be severely affectedby noise and artifacts if the number of beats is insufficient. Therefore, there exists a tradeoffbetween physiological accuracy and the number of beats. In order to solve this requirements,the signal is processed in segments of a fixed length duration. This length duration is definedas the wrapping time, its units are considered in seconds and it is noted as twrap.

It must be highlighted that even if the R to R peak time varies significantly, the system isgoing to be enough “smart” to align this peaks efficiently, as it is using information on the phaseprovided to the signal in the previous step.

Once the phase is wrapped, by projecting the signal and averaging it, it is possible to obtainthe mean and the standard deviation of the wrapped beat cycles. These two parameters areused to design the model and to obtain the parameters that KF requires before start working.

Final Project - Marcos Cruz Santiago 48

Page 63: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

−4 −3 −2 −1 0 1 2 3 4−1.5

−1

−0.5

0

0.5

1

1.5

2

2.5

3

Phase (rads.)

Arb

itrar

y un

its

Mean, SD extraction and Model

SD BarMean ECGModel

Figure 3.12.: Model estimation example through a mean and a standard deviation achieved usinga signal of 200 seconds wrapped. The error bar in this figure corresponds with thestandard deviation (SD) of different ECG cycles around the mean ECG, red thinline the calculated mean and the green fat line represents the estimated model. Tomodel this shape, four Gaussians have been chosen.

3.2.4.3. KF and model parameters derivations

This block is responsible of obtaining the required parameters to perform the mECG cleaning. Infirst term, the model is build by using the obtained mean. Then the filter needs some covariancematrices and variables, therefore they must be estimated.

Firstly the proper values for the parameters (θi, ai and bi) of equation 3.5 must be chosen.They must be selected in order that fit the mean ECG (see fig. 3.12). The goal is to achievea model as similar as possible with the extracted mean beat. Note that equation 3.5 is asummation of Gaussians, being the number of Gaussians a design parameter.

The choice of this parameter must be done considering the following statements:

• An insufficient number of Gaussians will not be able to adapt the model properly to themean (see fig. 3.13(a)).

• A very high number of Gaussians over a noisy mean will cause that the model will takethis noisy shape (see fig. 3.13(b)).

In this work, the chosen number of parameters was five. The criterion of this choice was testsdone with different number of Gaussians over the simulated data.

One way to fit the model in the obtained mean is by a nonlinear regression. This problem canbe solved on Matlab R© by using the function nlinfit and providing some initial values for theestimation. However, it presents the drawback that the values to estimate can not be boundedand in case of choosing a bad initial values, the optimization can diverge. This can lead toproblems if the estimated values for the Gaussians have unusual high or small values out of ourdesired range. Note that linearization equations of section 3.2.3.3 depend heavily on the inverse

Final Project - Marcos Cruz Santiago 49

Page 64: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

−4 −2 0 2 4−1

−0.5

0

0.5

1

1.5

2

2.5

3

Phase (rads.)

Arb

itrar

y un

its

Mean, SD extraction and Model

SD BarMean ECGModel

(a) 2 Gaussians

−4 −2 0 2 4−1

−0.5

0

0.5

1

1.5

2

2.5

Phase (rads.)

Arb

itrar

y un

its

Mean, SD extraction and Model

SD BarMean ECGModel

(b) 12 Gaussians in a noisy mean

Figure 3.13.: Example with inadequate number of Gaussians to construct the model. Fig. (a)shows the behaviour while using an insufficient number of Gaussians, the model isnot able to adapt itself to the mean. Contrariwise, fig. (b) shows the behavior ofa big number of Gaussians while having a noisy mean. The model take the shapeof some undesired peaks.

P Q R S T

θ -0.7415 -0.2 0 0.36 1.86

α mean(-0.7415) mean(-0.2) mean(0) mean(0.36) mean(1.86)

b 0.04 0.04 0.04 0.04 0.04

Table 3.3.: Model parameters table. mean represent the mean function extracted from thewrapped-phase signal being dependent of the phase instead of time. These param-eters, which been obtained empirically by doing some tests during this work, definefive Gaussians.

of the Gaussian width squared or cubed. Therefore an unusual and erroneous small value of thisquantity would cause big problems on the dynamic model, leading to errors in the output of thefilter.

Another good possibility is using a nonlinear least-squares approach, as suggested by Cliffordet al.[13]. This problem can be treated too on Matlab R© by using lsqnonlin function. Beingpossible to bound the estimated values, in order to avoid problems as the ones mentioned before.

Mathematical procedures as nonlinear least-squares problems, require initial points, fromwhich the algorithm attempts to find the optimum values. This initial values are particularlyimportant in order to enhance the performance of the procedure and to ensure that the algorithmfinds a result and will not diverge. These initial parameters have been listed in some documents[35]. As there is no rule to find this values, they are calculated empirically by using this methodrecursively. Proposed initial parameters in this work can bee seen in Table 3.3. Note that theECG waveform may be very different particularly in case of anomalies. This parameters onlyshould be regarded as starting point that might suit most of the options.

Prior to the implementation of the filter, it not only must generated a model but also it is

Final Project - Marcos Cruz Santiago 50

Page 65: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

necessary to select the values of KF parameters. Firstly, the process and measurement noisecovariance matrices must be estimated. In fact there are several ways to find these parameters,some of them were already very well studied [28].

As the automatic processing is one of the objectives of this work, parameters should beestimated from the signal itself. This parameters are extracted using the mean and standarddeviation previously calculated.

Regarding, Qk, the process noise covariance of the stochastic process associated to the mea-sure, first of all it is necessary to consider the size and characteristics that this matrix shouldhave. If the model uses m Gaussian kernels, the process noise vector defined in equation 3.6will have 3m+ 2 entries, leading to a (3m+ 2)2 process noise covariance matrix Qk. But if thenoise sources are assumed to be uncorrelated with each other then the matrix becomes diag-onal. That approximation is reasonable and makes mathematics more manageable. Knowingthe dimensions and shape of the matrix, an approximate value of this matrix can be proposedor estimated. Some methods had been reported in the literature like a nonlinear least-squaresproblem for estimating this matrix [48]. However, this matrix can be approximated in a simplerway just by filling the diagonal of an empty matrix with the N (number of Gaussian kernels ofthe model) ai’s (amplitudes of the Gaussians), 2 ∗N times 0.052, the heart rate standard devi-ation in rads and the following numbers with the fist samples of the scaled standard deviationsof the phase-wrapped signal squared [50].

The angular frequency ω required for the model, can easily be estimated as ω = 2π/T , beingT the RR-interval period in each ECG cycle. As the signal is divided in short segments, agood approximation here is to consider only one ω for each segment. Therefore considering ωas the average is the chosen option for this work. It should be noted however, that ω can alsobe considered to vary on an intra-beat basis too, since the PR and QT intervals are knownto change with varying autonomic tone, heart rate therewith, and to some extend, with eachchanging RR-interval [47].

The variance of process noise, η, should also be estimated. This parameter represents theimprecision of the dynamic model, a simple estimate for this parameter is a zero mean Gaussianrandom variable with an appropriate variance. This variance may be found from the standarddeviation from the phase-wrapped mean.

Also the variance of the observation or measurement noise, vk, and the phase measurementnoise uk must be estimated. As for the previous parameters, even for vk there are also differentpossibilities to estimate this parameter. A suitable option for vk, is to estimate the noise powerfrom the deviations of the whole signal around the phase-wrapped ECG. Another easier method,is just to consider this parameter as zero. For the sake of simplicity, within this work the lastapproach has been chosen. Regarding uk it is possible to assume that the R-peak detector donot have errors while operating, or in our case, that the correct peak detections are provided,considering this parameter approximately zero too.

3.2.4.4. Kalman filtering

The aim of previous steps was to obtain the right parameters to enable Kalman filtering. TheKalman filtering step itself has the goal to estimate the maternal interference. It should benoted that before implementing such a filter in code, first, state equations should be derivedas well as observation equations. Then this state equations of the ECG dynamic model shouldbe linearized, this information is used directly in the EKF or EKS code. Therefore, withoutthis previous linearization it is not possible to write the necessary code for EKF or EKS as thisequations are going to appear within the code.

Using the explained methods in previous subsections, the mean ECG waveform should beextracted for each ECG segment and the parameters of all the Gaussian kernels can be calculated

Final Project - Marcos Cruz Santiago 51

Page 66: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

using the nonlinear least-square method for each ECG segment. Then, from the calculated meanthe rest of the required parameters must be estimated.

That represents all the assumptions to run EKF or EKS, once this requirements are achieved.The filter can then start processing the data cyclically.

3.2.5. fECG subtraction

After KF operation the mECG is obtained in a clean signal. Then this maternal interference issubtracted from the preprocessed abdominal recordings in order to obtain an estimation of thefetal ECG (see fig. 3.14).

7.66 7.665 7.67 7.675 7.68 7.685 7.69 7.695 7.7

x 105

−5

0

5

���������Arbitrary

units

(a) Preprocessed abdominal recordings

x 10

7.66 7.665 7.67 7.675 7.68 7.685 7.69 7.695 7.7

x 105

−5

0

5

���������Arbitrary

units

(b) Estimated mECG signal

x 10

7.66 7.665 7.67 7.675 7.68 7.685 7.69 7.695 7.7

x 105

−1

0

1

���������Arbitrary

units

(c) Estimated fECG signal

Figure 3.14.: Maternal ECG subtraction from preprocessed data to obtain the estimated fetalECG. Maternal ECG estimated by means of an EKF/EKS filter (Second depictedsignal, (b)) is subtracted from the preprocessed data (first depicted signal (a)) toget the fetal estimation (third signal) (c).

3.2.6. Peak detection

Once the maternal signal is removed, the result can be post processed or fetal peaks can bedetected from the obtained signal. Within this work, peak detection was based on the detectionalgorithm developed by Suhrbier et. al [58] in IBMT at the TU Dresden. The choice of this

Final Project - Marcos Cruz Santiago 52

Page 67: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

algorithm was due to the robustness for ECG signals, according to the author [58], and alsofor comparability with the previous developed method within this department [4]. More detailsregarding the peak detection are contained in chapter 5.1.5 of Andreotti’s thesis [4] or Suhrbier’spublication [58].

Furthermore, another peak detector was used to be compared with the last one described inthis section. As the final aim of the described extraction method is to detect fetal R-peaks itmake sense to compare the results with one peak detector with another peak detector with adifferent working scheme. The other detector chosen is the one provided in the Open-SourceElectrophysiological Toolbox (OSET)[49]. The reason of this choice is that it works different, andtherefore, different results are expected from it. OSET peak requires as input the approximateECG beat-rate in Hertz. The suitability and comparison of these methods is discussed in section5.1.4.

3.3. Evaluation

As in the previous work of Andreotti, the evaluation of the method is done in terms of QRSdetection accuracy according to the American National Standard EC57-1998 [5], there are fourpossible outcomes of an experiment in which a detector is presented with an input that is eitheran event or a nonevent:

• True positive (TP): Correctly detected event (every time the fetal R-peaks are correctlydetected).

• False negative (FN): Missdetected event (non-detected fetal R-peak).

• False positive (FP): Erroneously detected nonevent (such as artifacts detected as fetalR-peaks).

• True negative (TN): Correctly rejected nonevent event. In this work, a TN does not makemuch sense since it determines that there was no detection in a stretch where there wasactually no fetal R-peak to be detected. Also, as it is possible to have jitter on detectionsand annotations it makes this parameter difficult to use, so it is discarded.

The mentioned quantitative measures (TP, FN, FP) used in this work are the most com-mon method for performance appraisal on both, simulated and real data. From the availablemeasurements, three performance indexes can be derived:

• Sensitivity (Se): Define the probability of detecting a TP. In other words, that an existingfetal R-peak is detected. This parameter is defined mathematical as eq. 3.10.

Se =TP

TP + FN(3.10)

• Positive Predictivite Value (+P ): Define the probability that a detection is actually aTP. In other words, a detected fetal R-peak is actually a fetal R-peak. This parameter isdefined mathematical as eq. 3.11.

+ P =TP

TP + FP(3.11)

Final Project - Marcos Cruz Santiago 53

Page 68: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 3. IMPLEMENTATION

• Accuracy (Acc): Metric between positive and negative results. This parameter is definedmathematical as eq. 3.12.

Acc =TP

TP + FP + FN(3.12)

The algorithm presented in this work, obtains quantitative measures (TP, FN, FP) by run-ning the function myBxb mod() (described in appendix D of Andreotti [4]) after each signalis processed. An important design parameter of this function is the acceptance interval. Theacceptance interval represents the range around the reference annotation in which a detectionis accepted. Normally a valid acceptance interval in ECG peak detection is (150ms , −150ms).Nevertheless, this range is appropriated for adult ECG but, too wide for a fetal ECG. Fetalheart rates are quite higher, so within this work a range of (50ms , −50ms) has been selected.

Final Project - Marcos Cruz Santiago 54

Page 69: TECHNISCHE UNIVERSITAT DRESDEN

4. Results

In this chapter, the results of the extraction of the fECG from an abdominal recording areshown. Moreover, conflictive situations in which the algorithm does not work as expected aredescribed. Statistics and graphics for simulated data are shown in section 4.1. Statistic resultswhile using different peak detectors are given in section 4.2. Results for real data are shownin section 4.3. Finally results regarding comparison between different methods (ESC, EKF andEKS) are shown in section 4.4.

4.1. Results on Simulated Data

Note that all the statistic results shown here are according to the definition of average statisticsof American National Standard EC57-1998 [5]. As all the signals treated on this work have thesame length in time (therefore about the same number of “events” or in other words fQRS-complexes). Thus, average and gross statistics are expected to have close values.

The goal of the results presented in this section is to study if Bayesian framework is ableto extract successfully the fECG from an abdominal recording. In order to characterize thebehavior and functionality of the purposed method various tests were done. In first term, as oneof the design variables on the purposed method based on KF is the wrapping time, is worth toselect the best value of this variable in order to achieve the best performance in further results.In order to achieve so test with different wrapping times must be done and they are shownin section 4.1.2. Then, the other interesting study held with real data is the analysis of theobtained results while extraction fECG in the different possible noisy scenarios. The impact ofthe different noise sources over the system is evaluated in section 4.1.1.

4.1.1. Results with different noise sources

The main objective of using simulated data in the extraction algorithm is to allow it to be testedinto different noise scenarios. This allows to proof what noise sources are more harmful to theproposed scheme. Table 4.1 depicts the average of the sensitivity of the nine different simulatedrecords with the different noise sources. Note that table 4.1 is not included with one tableregarding the positive predictivity because all the obtained values for the positive predictivitytable were 0.9998 with the exception of 4 values with 0.9997.

As previously discussed in section 3.1.1, EM and MA noise turn out specially meaningfulamong the other noise source. Thus an special evaluation is done over this two noisy scenarios.As discussed, the literature point that EM constitutes the most harmful noise. Table 4.2 providesspecific results for the nine different simulated signals with the EM noise source (EM = 12 dB,fetal-maternal SNR (-6 dB). Also fig. 4.1 depicts the behavior of the worst signal (in achievedsensitivity terms) of EM (see table 4.2).

Regarding the MA noise source, it was proven in the previous work of this department thatit was even more harmful than the EM artifacts. In order to extract conclusions of its behaviorand to conclude the reason of this possible fact, fig. 4.2 shows a simulated signal including thisnoise source.

55

Page 70: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

Table 4.1.: Sensitivity for fixed wrapping time (twrap = 200) in different simulated noise sourcesfor EKS filtering. Note that this table is not included with the table regarding thepositive predictivity. The reason is because all the obtained in positive predictivityvalues were 0.9998 with the exception of 4 values with 0.9997.

SNRfm/NS a bWa12 bWa24 EHG12 EHG24 EM12 EM24 MA12 MA24 No Noise

-3 dB 0.92 0.92 0.92 0.92 0.92 0.92 0.82 0.91 0.91

-6 dB 0.89 0.90 0.90 0.90 0.89 0.90 0.75 0.89 0.90

-9 dB 0.86 0.87 0.88 0.88 0.84 0.87 0.65 0.85 0.87

-12 dB 0.82 0.84 0.85 0.85 0.77 0.84 0.65 0.85 0.84

a The number after the noise source refers to the SNR of this source (in dB). e.g. bWa12 refersto bWa with 12 dB.

Table 4.2.: Resulting statistics for one specific noise source (EM = 12 dB), fetal-maternal SNR(-6 dB). Wrapping time (twrap = 200s)

Comb. Nr. Comb. Name TP FN FP Se +P Acc

Comb. 1 ’17052 16265’ 3458 860 1 0.80 1.00 0.80Comb. 2 ’17453 16272’ 3815 978 1 0.80 1.00 0.80Comb. 3 ’18177 16273’ 5275 358 1 0.94 1.00 0.94Comb. 4 ’18184 16420’ 4564 465 1 0.91 1.00 0.91Comb. 5 ’19088 16483’ 4176 1366 1 0.75 1.00 0.75Comb. 6 ’19090 19090’ 3826 825 1 0.82 1.00 0.82Comb. 7 ’19093 16773’ 3118 888 1 0.78 1.00 0.79Comb. 8 ’19140 16786’ 4737 587 1 0.89 1.00 0.89Comb. 9 ’19830 16795’ 5955 830 1 0.88 1.00 0.88

’Average’ 4324.89 795.22 1 0.84 1.00 0.84

580.5 581 581.5 582 582.5 583

−0.4

−0.2

0

0.2

0.4

0.6

time (sec.)

Arb

itrar

y un

its

EKS outputQRS detectorFetal Reference

Figure 4.1.: Behavior for EKS (twrap = 200s) filtering approach for one specific noise source: EMof 12 dB. Depicted signal is 19088 16483 (9dB between maternal and fetus signals)from the simulated dataset. Blue signal is the output of the fetal extraction system.Red circles are the results of the peak detector. Green crosses are fetal annotationreferences. Note that the presence of noise can lead to mistakes while detecting fetalpeaks.

Final Project - Marcos Cruz Santiago 56

Page 71: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

698 699 700 701 702 703 704 705 706 707

−1

−0.5

0

0.5

1

1.5

time (sec.)

Arb

itrar

y un

its

EKs outputQRS detectorFetal Reference

Figure 4.2.: Behavior for EKS (twrap = 200s) filtering approach for one specific noise source:MA of 12 dB. Depicted signal is 17052 16265 (9dB between maternal and fetussignals) from the simulated dataset. Blue signal is the output of the fetal extractionsystem. Red circles are the results of the peak detector. Green crosses are fetalannotation references. Note that muscular artifacts become specially harmful tothe filter performance.

Final Project - Marcos Cruz Santiago 57

Page 72: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

4.1.2. Results with different wrapping times

Regarding the aspect of the number of samples (or in other words, the wrapping time) used tocreate the mean that is used in order to obtain the model, and its optimal value. Some testswere done with the simulated data and the different wrapping times, fig. 4.3 depicts statisticalresults from different values of this variable. Results were obtained by processing the wholesimulated dataset, and then averaging the results in groups of different maternal-fetal SNRs.

50 100 150 200 2500.8

0.85

0.9

0.95

1

Wrapping time (secs)

−3dB

Se+PAcc

50 100 150 200 2500.8

0.85

0.9

0.95

1

Wrapping time (secs)

−6dB

Se+PAcc

50 100 150 200 2500.8

0.85

0.9

0.95

1

Wrapping time (secs)

−9dB

Se+PAcc

50 100 150 200 2500.8

0.85

0.9

0.95

1

Wrapping time (secs)

−12dB

Se+PAcc

Figure 4.3.: Statistical results for different wrapping times. This results were obtained by pro-cessing the whole simulated dataset (with EKS), averaging the results and distin-guishing them for their maternal-fetal SNR. As it can be observed, the impact ofthis value is modest. The dashed line relates the maximum value. In average, forthe different fetal-maternal SNR values, the best value for the wrapping time isbetween 200(secs) and 250(secs).

Final Project - Marcos Cruz Santiago 58

Page 73: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

Table 4.3.: Sensitivity and positive predictivity for EKS (twrap = 200) by using two differentpeak detectors. Peak detectors used were the one developed by Suhrbier et. al[58] and the one provided in Open-Source Electrophysiological Toolbox (OSET)[49].With the purpose of further comparisons with ESC, this table was done skiping thefirst 20 seconds of the signal. Results shown are the average of simulated signals inabsence of noise (distinguished by their SNR between maternal and fetal signal) andthe average of the real datasets (which contain all kind of different noises).

Test set EKS Suhrbier Se EKS Suhrbier +P EKS OSET Se EKS OSET +P

-3 dB 0.94 1.00 0.99 0.99

-6 dB 0.92 1.00 0.97 0.97

-9 dB 0.90 1.00 0.95 0.96

-12 dB 0.89 1.00 0.92 0.94

Real data 0.77 0.83 0.86 0.86

4.2. Results with different peak detectors

The aim of the described a method is to be able to detect fetal R-peaks, thus it makes senseto take into consideration the way in which these peaks are detected. Nevertheless, as peakdetection is not directly in the scope of this work, only a comparison between two differentdetection schemes are hold in this work. The details regarding the two peak detectors usedare contained in previous section 3.2.6. The obtained results by Suhrbier’s peak detector arecompared with the ones obtained by using the peak detector provided in the Open-SourceElectrophysiological Toolbox (OSET)[49]. This results are shown in table 4.3).

4.3. Results on Real Data

As the final goal of any fetal extraction algorithm is to work with real data, a really meaningfultest is to run the developed scheme with real data as input.

The real data recorded at the Department of Obstetrics and Gynecology (University of Leipzig)that was manually annotated during this work contain 8 different channels, being 7 of feasible forfetal extraction (the remaining channel is the maternal reference). Nevertheless, results exposedin this section belong only to one of this channels, the chosen channel for each recording isindicated in table 4.4. The criterion for the choice of this channels was to choose the bestchannel for processing. For deciding this, only a not very exhaustive visual inspection was done.

Table 4.5 shows statistics obtained from real data by using EKS with a twrap = 200s. Thereason to chose this wrapping time is because it is the best value, as it is discussed in next section5.1.2. Statistics are complemented with fig. 4.4 which shows the general good performance ofthe extraction method while working with real signals.

4.4. Results with different filter methods

As this is not the first work done within this department in the area of fetal extraction it makessense to compare the results with the former developed method. Furthermore, as during thiswork not only one method was developed but two, is also meaningful to make some comparativeworks between the available methods. Notice that to ensure consistency with the majority of theresults shown in this work, tables and figures shown in this section were made with a wrappingtime of twrap = 200s.

Final Project - Marcos Cruz Santiago 59

Page 74: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

Signal Used channel

AB080882 7

AD251091 6

LD141088 7

SJ010284 7

SL290885 4

SH180479IV 7

SH180479V 8

SH180479VI 4

SH180479VII 8

SH180479VIII 2

Table 4.4.: Channels used in annotations of real data signals. Note that this channels have beenused preprocessed first in order to avoid uncomfortable noise sources.

Table 4.5.: Resulting statistics for real data using EKS (twrap = 200s). The last column showsthe weeks of gestation (WOG) of the patients, for further comparison.

Record TP FN FP Se +P Acc WOG (+ days)AB080882 2747 480 238 0.85 0.99 0.79 39 (+1)AD251091 1494 1264 723 0.54 0.63 0.43 25 (+2)LD141088 2281 370 395 0.86 0.38 0.75 26 (+1)SJ010284 2068 983 869 0.68 0.76 0.53 29 (+1)SL290885 1330 1770 662 0.43 0.86 0.35 24 (+0)SH180479IV 2710 519 251 0.84 0.91 0.78 24 (+2)SH180479V 3056 146 114 0.95 0.96 0.92 26 (+0)SH180479VI 2912 550 248 0.84 0.92 0.78 26 (+2)SH180479VII 2264 812 367 0.74 0.86 0.66 28 (+0)SH180479VIII 1798 1259 743 0.59 0.70 0.47 28 (+2)

Final Project - Marcos Cruz Santiago 60

Page 75: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

482 483 484 485 486 487 488 489 490

−1

0

1

x 10−4

time (sec.)

Arb

itrar

y un

its

Raw dataEKS OutputQRS detectorFetal ReferenceMaternal Reference

Figure 4.4.: Real data processing example. Depicted signal is AB080882 of the real dataset.Gray line represent preprocessed data while purple squares over it are maternalR-peak annotations. Blue line is the output of the EKS scheme (twrap = 200s).Red circles and green crosses are the detected points by the QRS and the fetalannotations respectively. The picture shows the good results obtained while usingthe described technique.

4.4.1. Results of EKF towards EKS

As two different Bayesian filters where built for this work, it is interesting to show the differentachieved results. Also, is interesting to compare that EKF is a filter which do not work withfuture samples (is a causal filter) and EKS works analogous to EKF but it also incorporatethe information of the future samples. The Fig. behavior of EKF and EKS in the describedextraction system of this work is shown in fig. 4.5 . Moreover table 4.6 contains the averagedsensitivity and positive predictivity of all the simulated signals distinguished by their SNRbetween maternal and fetal signal.

Table 4.6.: Sensitivity and positive predictivity for fixed wrapping time (twrap = 200) for EKFand EKS. Results shown are the average of all the signals distinguished by their SNRbetween maternal and fetal signal.

Test set EKF Se EKF +P EKS Se EKS +P

-3 dB 0.92 1 0.94 1

-6 dB 0.90 1 0.92 1

-9 dB 0.88 1 0.90 1

-12 dB 0.85 1 0.87 1

Final Project - Marcos Cruz Santiago 61

Page 76: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

589 589.5 590 590.5 591 591.5 592 592.5 593 593.5 594

−1

−0.5

0

0.5

1

1.5

2

2.5

3

time (sec.)

Arb

itrar

y un

its

Preprocessed dataEKS approach outputEKF approach output

Figure 4.5.: Behavior of EKF and EKS while extracting fetal components from abdominalrecordings. The depicted signal is 18177 16273 from the simulated dataset. Graysignal is the preprocessed data, while blue and red are EKS and EKD fECG extrac-tion respectively. The behavior of both methods is almost identical. However, it canbe observed that EKS is able to remove slightly better the maternal component.

4.4.2. Results of EKS towards ESC

As mentioned, this is the second work within this department in the area of fECG extractionfrom abdominal recordings. Thus, a comparison between the previous method and the actualdeveloped one can show weak and strong points of both schemes and it helps in order to determinewhich one is more suitable for fECG extraction.

Also is interesting to consider that the Bayesian framework approach and the ESC methodto extract the fECG from abdominal recordings have similar structures but with a completelydifferent processing core. Both methods share the same operation order: preprocessing, extrac-tion of the maternal component, subtraction of this component to the preprocessed signal andpeak detection (see fig. 4.6). Mainly, the difference is how the maternal signal to be subtractedis estimated. Nevertheless, a fundamental requirement for this estimation is shared betweenboth methods: both require to average some maternal beats of the preprocessed abdominalrecordings. Kalman filtering require this average to create the mean which is used to build themodel and ESC to create a maternal template. Both averaging processes work over fixed lengthsegments. Although the same operation is done over this segments, this segments are defined ina different manner in each method. The length in KF is defined as the wrapping time (twrap)in seconds. ESC define this length as a number of averaged beats (Navg).

An additional detail to consider is that the results shown in this work for the ESC basedextraction algorithm differ slightly from the presented on Andreotti’s thesis [4] even for thesame data. This is due to two main reasons:

• Obtained results in Andreotti’s work used an acceptance interval (range around the refer-ence annotation in which a detection is accepted) in myBxb mod function of (150ms,−150ms).As discussed in 3.3, this range is appropriated for adult ECG but too wide for a fECG.

Final Project - Marcos Cruz Santiago 62

Page 77: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

Preprocessing

Maternal subtraction based

on ESC

Maternal subtraction based

on EKS

Substraction

Peak detection and evaluation

Abdominal recordings

Clean mECG Clean mECG

Figure 4.6.: Analogy between the extraction schemes based on ESC and EKS. As it can be seen,both methods share all their process blocks excluding the maternal subtractionblock. Note, that the figure do not says that the subtraction block needs two cleanmECG blocks, it says that it can be used one or the other. The system works byusing the preprocessing data and the clean mECG. Therefore, the mECG signalcan be estimated either by using the subtraction block based on ECG or eitherusing the one based on EKS. In other words, the maternal subtraction block isinterchangeable.

Final Project - Marcos Cruz Santiago 63

Page 78: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

Table 4.7.: Comparison of sensitivity and positive predictivity between ESC (Navg = 15) andEKS(twrap = 200). With the purpose of comparison with ESC, this table was doneskiping the first 20 seconds of the signal for both ESC and EKS. Results shown are theaverage of simulated signals in absence of noise (distinguished by their SNR betweenmaternal and fetal signal) and the average of the real datasets (which contain allkind of different noises).

Test set ESC Se ESC +P EKS Se EKS +P

-3 dB 0.93 1.00 0.94 1.00

-6 dB 0.86 1.00 0.92 1.00

-9 dB 0.75 1.00 0.90 1.00

-12 dB 0.57 1.00 0.89 1.00

Real data 0.73 0.81 0.79 0.86

There is no rule about which is the appropriated acceptance interval for fECGs, so in thiswork an interval of (50ms,−50ms) has been selected. This interval, as it is more restrictivethan the previous one, has lowered ESC results. Note that all the results shown here forKalman approach are calculated with this more restrictive interval.

• In ESC method, approximately the first fifteen seconds (for a Navg = 15) of recording,the filter is not yet adapted. Thus, maternal signal is not extracted from this signalsegment and some errors were obtained. Firstly, as no process is done while the filteradaptation, maternal peaks are not extracted. This leads to the undesired behavior ofdetecting maternal peaks instead of the fetal peaks (generating a FP). Secondly, peakdetectors, like the one developed by Suhrbier et. al [58] adapt themselves to the results,so in case of leaving the mECG, the peak detector will adapt itself to that slopes, and itwill not detect fetal peaks (generating FN). This bad behavior can also long for some filtercycles. Thus, comparative results during this work between EKS and ESC had been takenomitting the first 20 seconds of record and their respective annotations for both methods.This consideration has increased ESC performance for the previous reasons.

However despite these changes, the trend in ESC results remains unchanged. Also the ten-dency in KF approaches remains quite similar with these changes. Comparative results betweenESC and EKS can be seen in table 4.7. Also, fig. 4.7 depicts a fetal extraction of the samesignal but using separately both methods.

Final Project - Marcos Cruz Santiago 64

Page 79: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 4. RESULTS

745 745.5 746 746.5 747 747.5 748 748.5 749 749.5 750 750.5

−1

0

1

2

3

time (sec.)

Arb

itrar

y un

its

Raw data

745 745.5 746 746.5 747 747.5 748 748.5 749 749.5 750 750.5

−0.5

0

0.5

1

time (sec.)

Arb

itrar

y un

its

EKS output

745 745.5 746 746.5 747 747.5 748 748.5 749 749.5 750 750.5

−1

0

1

2

time (sec.)

Arb

itrar

y un

its

ESC output

Figure 4.7.: Comparison in the behavior of ESC and EKS. First depicted picture is raw dataof signal 17052 16265. Second and third pictures are the outputs of EKS (twrap =200s) and ESC (Navg = 15) schemes, respectively. Even having a same extractionstructure, the behavior is completely different. Note in the figure that the amplitudescales are different in each signal.

Final Project - Marcos Cruz Santiago 65

Page 80: TECHNISCHE UNIVERSITAT DRESDEN

5. Discussion and Conclusions

This last chapter, show the results of the implemented algorithm and also comparison resultswith the previous fetal extraction technique developed in IBMT. Section 5.1 contains a discussionregarding the obtained results. Section 5.2 deals with works that can arise from this project.To conclude, section 5.3 describes the conclusions extracted from this work.

5.1. Discuss of the Results

In this section, the obtained results shown in section 4 are discussed. Special emphasis is placedin situations in which the method for fECG extraction described in this work, does not work asexpected, as they allow further discussion. This situations are characterized along this sectionand also possible solutions and upgrades that should improve the performance of the system aresuggested.

5.1.1. General performance

Results obtained both in real and simulated data show that the scheme based on a KF is able tosubtract the fECG from an abdominal recording. Even, despite real data results reveal a lowerperformance compared to simulated signals, it can be stated that the recordings are reliable andthe extraction technique is accurate.

Nevertheless, studying the signals in which a lower performance is obtained, some conclusionscan be extracted. Two general situations exist in which the peak detector fails while analyzingthe output of the proposed scheme. This situations are the following ones:

• Fetal peaks are overlapped in time with maternal ones (leading to a FN)

• The presence of noise artifacts (leading to FP, and also to FN depending on the peakdetector)

Both problems and their impact are characterized and possible solutions for them in thefollowing subsections are suggested.

5.1.1.1. Overlapped maternal and fetal peaks

One of the hardest situations for a system responsible for fetal extraction of an abdominalrecording is when both maternal and fetal peaks occur in the same time segment. That kind ofsituation justifies an adaptive filter like KF, since conventional filters are not able to distinguishtwo signals that are overlapped both in time and frequency. Although the scheme detailed inthis work is able to handle this problem, it is not always able to manage it perfectly, leading tominor errors. This errors can be translated as FN. An example can be seen in fig. 5.1.

Note that, this does not mean that all the overlapped peaks are not detected. Table 5.1shows the number of fetal and maternal peaks overlapped in time in the nine different simulatedsignals. The number of overlapped beats was found using myBxB mod with mother and fetalreferences as input. myBxB mod had been used with an interval of tolerance of (50ms to 50ms).These values can be compared with table 4.2 where FN are contained. From this, it can be seen

66

Page 81: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 5. DISCUSSION AND CONCLUSIONS

649 649.5 650 650.5 651 651.5 652 652.5

−1

0

1

2

3

time (sec.)

Arb

itrar

y un

its

Raw dataEKS OutputQRS detectorFetal ReferenceMaternal Reference

Figure 5.1.: Missdetected overlapped peak. Depicted signal is 17052 16265 of the simulateddataset filtered with EKS and a wrapping time of 200 seconds. Gray line repre-sents raw data, blue line is the output of the EKS fetal extraction approach, redcircles are peak detections by the algorithm developed by Suhrbier et. al [58], greencrosses are fetal annotation references and purple squares depict maternal referenceannotations.

that the number of overlapped peaks is bigger than the number of FN. Thus, it can be concludedfrom the tables and the results that when maternal and fetal R-peaks are completely overlappedin the same point the fetal extraction will have poor quality, meanwhile if the overlap is partiala good fetal component will be extracted.

However, this problem is not an intrinsic limitation for KF approaches. In fact, this badbehavior can be easily explained by resorting the intuitive KF rules. KFs produce their outputby using two sources: measurements and its dynamic model. This two inputs are merged andweighted by the Kalman gain. Kalman gain is produced by noise covariance matrices, that wereestimated from the signal before filtering. This matrices and hence Kalman Gain are the onesresponsible for the filter to follow the observations or the model.

Obtained results suggest that while extracting the maternal signal, the filter tends to trust

Table 5.1.: Number of overlapping maternal and fetal R-peaks over the various datasets. Thenumber of overlapped beats was found with myBxB mod. myBxB mod had beenused with an interval of tolerance of (50ms to 50ms) and with maternal and fetalreferences as input.

Comb. Nr. Peak overlaps

Comb. 1 664Comb. 2 506Comb. 3 745Comb. 4 664Comb. 5 836Comb. 6 665Comb. 7 469Comb. 8 633Comb. 9 692

Final Project - Marcos Cruz Santiago 67

Page 82: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 5. DISCUSSION AND CONCLUSIONS

in the observations much more than it should do. This effect can be seen in fig. 5.2. In thisstep, everything but the maternal ECG should be considered as noise and hence fetal complexesshould not appear in the extracted maternal signal. In other words, when the filter finds afetal ECG it must consider the observations too noisy and rely in its inner dynamics. Thisconsideration is done throw noise covariance matrices. By considering the obtained results, itcan be established that the estimation of this noise covariance matrices is not as accurate as itwill be necessary for an optimal performance.

6.66 6.665 6.67 6.675 6.68 6.685 6.69 6.695 6.7

x 105

−2

−1

0

1

2

3

6.66 6.665 6.67 6.675 6.68 6.685 6.69 6.695 6.7

x 105

−2

−1

0

1

2

3Estimated maternal ECG

6.66 6.665 6.67 6.675 6.68 6.685 6.69 6.695 6.7

x 105

−1

−0.5

0

0.5

1

1.5Estimated fetal ECG

Arbitrary

units

Arbitrary

units

Arbitrary

units

Samples (n)

Samples (n)

Samples (n)

(a) Preprocessed abdominal recordings6.66 6.665 6.67 6.675 6.68 6.685 6.69 6.695 6.7

x 105

−2

−1

0

1

2

3Preprocessed data

6.66 6.665 6.67 6.675 6.68 6.685 6.69 6.695 6.7

x 105

−2

−1

0

1

2

3Estimated maternal ECG

6.66 6.665 6.67 6.675 6.68 6.685 6.69 6.695 6.7

x 105

−1

−0.5

0

0.5

1

1.5Estimated fetal ECG

Arbitraryunits

Arbitraryunits

Arbitraryunits

Samples (n)

Samples (n)

Samples (n)

(b) Estimated mECG signal

6.66 6.665 6.67 6.675 6.68 6.685 6.69 6.695 6.7

x 105

−2

−1

0

1

2

3Preprocessed data

6.66 6.665 6.67 6.675 6.68 6.685 6.69 6.695 6.7

x 105

−2

−1

0

1

2

3Estimated maternal ECG

6.66 6.665 6.67 6.675 6.68 6.685 6.69 6.695 6.7

x 105

−1

−0.5

0

0.5

1

1.5Eaima

Arbitrary

units

Arbitrary

units

Arbitrary

units

Samples (n)

Samples (n)

Samples (n)

(c) Estimated fECG signal

Figure 5.2.: Erroneous behavior while extracting maternal component. Depicted signal is17052 16265 of the simulated dataset with bWa of 24dB and filtered with EKS(Wrapping time of 200 seconds). Second depicted signal (b) is subtracted to thefirst one (a) to get the fetal estimation (c). Note that on the maternal peaks somepart of the fetal components can be observed. Note also that the produced modelafter the phase wrapping and the mean extraction was well fitted to the mean.

Final Project - Marcos Cruz Santiago 68

Page 83: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 5. DISCUSSION AND CONCLUSIONS

Therefore, one possible solution for this problem is to try different estimations of these vari-ance matrices. In the literature no denitive solution is established, however some estimationalternatives are depicted in [48].

Additionally, other possible solutions exists. A post processing process in order to denoisethe fECG signal could be a possibility. Also the usage of a different peak detector capable ofdetecting smaller peaks using information of the periodicity of the signal. This last solution,can be controversial, the reduced results obtained on real data suggest that the detectors aresensible to the noises, and if they become more sensible, results will be even worse. However,the comparative results of table 4.3 show that changing the detector is possible to improve theperformance of the system. Thus, in case of selecting this solution, it may be studied carefully.

5.1.1.2. Noise artifacts

From various results in real recordings and simulated records with different noise sources (asmuscular activity) it can be noticed that in certain circumstances results tend to be worse asexpected.

This undesired effect is due to the presence of artifacts with high amplitudes (high in compar-ison with fetal R-peaks). If these artifacts are big enough they will be erroneously considered bythe detector as fetal peaks. Unless otherwise stated, all results shown here have been taken withthe peak detector developed by Suhrbier et. al [58]. This detector is based on a slope detectionalgorithm and work by adapting itself to the found peaks. Therefore, if a huge peak is found,the algorithm will expect more big peaks after. Thus, many FN can be obtained by this effect(see fig. 5.3)

Two different solutions arise to solve this problem:

• The usage of a post processing algorithm as stated in previous section 3.2.

• The usage of different peak detectors. This solution is deeply characterized in next section5.1.4.

5.1.2. Noise sources evaluation

This subsection regards the performance of the algorithm to different noise sources. Note fromtable 4.1 that the most harmful noise source is MA. In its strongest version, 12 dB, it producessensitivities of 65% in cases in which maternal-fetal SNR is -9 and -12 dB. Even more than EMartifacts, however in the literature was mentioned that EM noise source is the most warmful one[17]. EM artifacts in their strongest version, 12 dB, produce their worst sensitivities (77%) onlyfor the worst case of maternal-fetal SNR (-12 dB). So in the worst case of both noise sources,MA is more than a 10% lower than EM with the purposed extraction method. This resultsconfirm what was said in the previous work in this department regarding fECG extraction [4].

Also from table 4.1, is confirmed what it was expected, that the most troublesome noisesources are EM and MA. This match up with the arguments presented in section 3.1.1. Thebehavior of EM and MA noise sources are shown graphically in fig. 4.1 and fig. 4.2 respectively.Both noise sources effects are separately discussed in the following lines.

Regarding EM fig. 4.1 shows that errors done while the peak detection step in this kind ofnoisy scenario are due to the existence of noise components with the same amplitude order offetal peaks. Similarly as it was described before, this problem could be fixed by a postprocessingstep to denoise the obtained signal.

Regarding MA fig. 4.2 shows the same effects as described in the previous section regardingnoise artifacts 5.1.1.2. The presence of huge artifacts trick the slope detector used, making itunable to detect after lower peaks (fetal R-peaks).

Final Project - Marcos Cruz Santiago 69

Page 84: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 5. DISCUSSION AND CONCLUSIONS

298 300 302 304 306 308 310 312 314 316

−6

−4

−2

0

2

4

x 10−4

time (sec.)

Arb

itrar

y un

its

rawdataEKS OutputQRS detectorFetal ReferenceMaternal Reference

Figure 5.3.: Error in peak detections while having big artifacts. The depicted signal isSH180479IV of the real dataset. Grey line is raw data, blue line the output ofthe fetal extraction system based on EKS, red circles the detected peaks, greencrosses, fetal reference and blue squares the maternal reference. On the picture it ispossible to see how the slope detection algorithm developed by Suhrbier et. al [58]missdetects a big amount of peaks near huge artifacts.

Final Project - Marcos Cruz Santiago 70

Page 85: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 5. DISCUSSION AND CONCLUSIONS

Otherwise, in general, it can be observed that KF filtering remains robust to the presenceof noise sources (without taking into account the strongest version of muscular activity) and itremain robust even if SNR between maternal and fetal peaks decrease.

5.1.3. Optimal time of phase wrapping

The results in fig. 4.3 show the behavior for varying twrap. Although there is no great differencewith the surrounding values, results achieved by the usage of 200 seconds are slightly superior.Interestingly this time segment is quite long. The reason is due to the phase synchronization.This synchronization allow to fit a lot of different maternal beats in order to minimize the errors.Moreover, a huge number of averaged beats are translated into a good way to remove the existentnoise.

Is also interesting to contrast the optimal value of this design variable, using a KF approach,with the value obtained in other methods. In section 5.1.5.2 is contained a comparison betweenthe time obtained with Kalman filtering and ESC method.

5.1.4. Influence of the peak detector

Artifacts can became a great problem in performance terms while using Suhrbier’s peak detec-tor. Therefore, the usage of another peak detector with a different working scheme should beconsidered. By using the detector provided in the Open-Source Electrophysiological Toolbox(OSET)[49] obtained results are quite different (see table 4.3). The enhancement is obvious.Generally, a a superior sensitivity is achieved loosing in some cases slightly positive predictivity.In addition, the set of signals that was giving worst results (real datasets) with this differentpeak detector achieves an improvement in the sensitivity of approximately 10%.

Nevertheless, this last peak detector has a main drawback, it requires as input the approximateECG beat-rate in Hertz. Then, this value normalized by the sampling frequency is used togenerate a window in which R-peaks are detected. This requirement may be tricky, as thisparameter is almost what the system was built for, to detect the fHR. The option taken withinthis work to solve this problem is to just use a default approximate ECG beat-rate of 2.5Hz 1.

5.1.5. Comparison between different methods

As previously discussed, it is very meaningful to discuss the obtained results between differentmethods. In this section, firstly a comparison between the two developed methods in this workis held. Then the better scheme of the previous comparison is contrasted with the formerelaborated method.

5.1.5.1. Comparison between EKF and EKS

Since results of two methods were obtained during this work it is interesting to compare themto state the best solution in the topic at hand. From table 4.6 can be observed that EKS, asexpected, gives better results than EKF. This is due to the incorporation of a posteriori infor-mation. The more valuable information is provided to a Bayesian filter, the better performanceit gets.

However, results seem to be quite similar, and also the behavior of both filters is almostidentical (see fig. 4.5). Observing carefully the output of both signals, it can be observed thatEKS is able to remove slightly better the maternal component.

1This value remain quite arbitrary, and it was selected in order to try to satisfy as good as possible all thedifferent heart rates presented on the testing database. Note that a default value of fetal HR is 130bpm(2.1Hz)

Final Project - Marcos Cruz Santiago 71

Page 86: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 5. DISCUSSION AND CONCLUSIONS

Note also that, the fetal extraction technique described in this work is an offline approach.Nevertheless, this does not mean that EKS can be used only in offline approaches due to itsusage of a posteriori information as fixed lag solutions exists for EKS online filters.

5.1.5.2. Comparison with ESC

As it has been discussed in 4.4.2, Bayesian framework approach and the ESC based methodto extract the fECG from abdominal recordings have similar structures but with a completelydifferent processing core. Surprisingly even having an identical procedure, both techniques givedifferent results and also, a different behavior can be observed on the obtained output of thistwo signals. In fig. 4.7 interesting differences on the behavior can be observed. Regardingthe maternal extraction, KF approaches are capable to remove almost completely the maternalinterference, whereas ESC leaves a maternal component that can lead to errors. However, whenmaternal and fetal peaks are completely overlapped in time, ESC provides usually a betterperformance than KF approaches. This because in cases of complete overlap the KF schemetends to give as output a diminished peak which might exhibit a too small amplitude to bedetected (fig 5.1).

In general terms, Kalman filtering approach shows to be more robust than ESC method, asthe presence of noise or a lower SNR affects less dramatically the performance of the filter ascompared to ESC (see table 4.7). Furthermore, it is also interesting to note from the previoustable, that the behavior of both methods is completely different, and hence their results.

Another interesting outcome of the comparison of both methods is to study how the maternalsignal is subtracted. As only at this point there are differences between the methods, under-standing the subtraction or the methods become useful to find out the origin of their differentbehavior. Both require to average some maternal cycles in order to obtain a maternal estimate(thus they require to average a certain number of samples). This average is used differently ineach technique. ESC uses this average to create a maternal template that would be synchronizedand adapted to the signal by scaling it and synchronizing it to the measurements. However, KFfilters use this average to generate a model, which is used as long as the measurements last togenerate a maternal estimate. The proposed KF model in this work does not need to be syn-chronized with an additional step like ESC and neither to be scaled. By using both abdominalrecordings and a phase generated by maternal peak detections (or references) as KF outputs themodel become automatically synchronized. Also the scaling is not necessary as the adjustmentson the maternal R-peak amplitudes are done through the Kalman gain (if this points are notnoisy the filter trusts the measurements and hence the same amplitude is achieved).

Due to previous reasons stated the number of samples required for the average to the ma-ternal estimation is quite different in both mentioned techniques. Whilst ESC requires a verysmall number of samples (approximately 15 maternal beats) to achieve its bests results, KF ap-proaches need a big number of samples (around 200 seconds). This huge difference is due to thesynchronization between template/model and the signal (KF do not need such synchronizationso can have a big number of samples in the average).

As a final point to be discussed in this comparison, both methods can be tested by means ofchanging the peak detector. As discussed in section 5.1.4 the usage of a different peak detectorcan vary dramatically the results. By using the peak detector provided in OSET [49] bothmethods were tested obtaining results as the ones depicted in table 5.2. From the previous tableit can be seen that the ability of KF to suppress totally the maternal signal can be very beneficialin comparison with other methods. Meanwhile KF improves its results, the ESC approach caneven get worse results with this kind of detector. This can be seen by comparing table 5.2 withtable 4.7.

Final Project - Marcos Cruz Santiago 72

Page 87: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 5. DISCUSSION AND CONCLUSIONS

Table 5.2.: Sensitivity and positive predictivity for ESC (Navg = 15) and EKS (twrap = 200) usingthe peak detector provided in OSET. Results shown are the average of simulatedsignals in absence of noise (distinguished by their SNR between maternal and fetalsignal) and the average of the real datasets (which contain all kind of different noises).

Test set ESC Se ESC +P EKS Se EKS +P

-3 dB 0.93 0.94 0.99 0.99

-6 dB 0.88 0.90 0.97 0.97

-9 dB 0.76 0.80 0.95 0.96

-12 dB 0.69 0.73 0.92 0.94

Real data 0.70 0.70 0.86 0.86

Moreover it must be highlighted that if the results from the combination of ESC plus the de-tector which gives to it better results (Suhrbier’s detector) are considered and they are comparedwith the results obtained by EKS plus the detector which gives to it better results (OSET), thedifference is very significative. By averaging the sensitivities of table 4.7 achieved by ESC ita value of 0.776 is obtained while doing the same with the EKS with its best peak detectorcombination (sensitivity values of table 5.2) the obtained result is 0.944. The improvement isquite important, of 22%.

Final Project - Marcos Cruz Santiago 73

Page 88: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 5. DISCUSSION AND CONCLUSIONS

5.2. Future works on this Field

This work is the pioneer work from IBMT’s group on medical sensing and signal processing onthe usage of KF, therefore, a consistent base about KF has been exposed. Section 2.3 showedmany different applications of KF in ECG processing, thus further studies may arise from this.Also, the development of a system to extract fetal components from abdominal recordings, hassuggested some directions of work in order to further enhance the proposed system.

5.2.1. System improvement

KF based methods have proven to be able to perform correctly a fetal extraction from anabdominal recording. Although as it has been described the performance of the EKS basedmethod can be improved. On the one hand, to tune and improve the proposed method, studyingthe noise sources and implementing a better estimation of them could be beneficial in terms offECG extraction and fQRS detection, respectively. On the other hand, another interestingalternative could be also the implementation of a UKF, another non-linear variant of KF thatinstead of linearization uses the unscented transform. However, as EKS has proven to be veryrobust, the latter approach should not be a priority.

A second aspect regarding the system performance, is regarding how the channel is selectedfor processing. The fetal extraction approach in this work, deals only with one channel, being itselected manually. Working only with one channel is a great advantage but also, in completelyautomatic procedures, require the automatic selection of that channel. Further studies shouldbe concerned with selecting the best abdominal ECG channel with best fetal-maternal SNR orusing information of all channels (data-fusion), in order to obtain better extraction results.

5.2.2. Improvement on QRS detector

As discussed and proved in previous section 5.1.4 the presented approach depends heavily onthe QRS detector. Thus, a more sophisticated algorithm would be extremely helpful in order toimprove the results.

Also the selected detector must be able to automatically detect a variety of different ECGpresentations (as upside-down complexes).

5.2.3. Multichannel approach

Abdominal real data used in this work has been of enough quality to be suitable for fetalextraction. This data, have more than one channel of good quality. Thus, a logical step inthe research is to develop a multi-channel KF approach. That is possible by considering asinput variable all the channels and the maternal reference. However this approach make themathematical model somehow more complex, requiring concepts regarding the cardiac dipolerepresentation on a 3D space. Also, the model on a multichannel approach should be preferabledone with an AR model. Also the existence of this approach, will lead to interesting comparisonwith extraction methods of different procedures as the independent component analysis (ICA)algorithm.

5.3. Conclusions

The present study accomplished its given tasks and has proven the feasibility of extracting fetalelectrocardiogram from both real and simulated abdominal recordings while using a KF basedapproach. Main goals of this study are once more listed bellow:

Final Project - Marcos Cruz Santiago 74

Page 89: TECHNISCHE UNIVERSITAT DRESDEN

CHAPTER 5. DISCUSSION AND CONCLUSIONS

• Literature research on the applications of Kalman filtering techniques in automated ECGprocessing;

• Implementation of a Kalman filtering approach to extract the fetal ECG from abdominalrecordings;

• Editing of abdominal recordings which are derived from Universtatsklinik Leipzig;

• (Comparative) evaluation of the usability of the implemented method to extract the fetalECG.

As shown in this work, each and every topic was accordingly approached. Also interestingconclusions had been obtained from each of this points.

In first term, the bibliographic research regarding KF has reached the following results: agood KF base for future works about the usage of KFs on ECG processing, which can leadalso to more related works. Following, the implementation of the extraction method with anKF based scheme has proven to be enough accurate and robust. Then, the work done editingabdominal recordings and the following tests with this data have also proven that the actualtechnique of abdominal signal subtraction is good enough for automatic processing.

Also, the comparative evaluation has shown very interesting facts about KF and also of ESCthe previous developed extraction technique developed in IBMT. Moreover, it has shown thesuperiority of KF when comparing with the previous achievements. Hence, the importance ofthis work is justified and it might be helpful for future works of the IBMT.

Finally the promising results obtained in this work have lead to a contribution in a publicationbased on them. This publication, titled “Fetal QRS detection by means of Kalman filtering andusing the Event Synchronous Canceller” (included in appendix A and contained digitally on thedata CD in appendix B) has been submitted in the 7th International Workshop on BiosignalInterpretation in Como, Italy.

Final Project - Marcos Cruz Santiago 75

Page 90: TECHNISCHE UNIVERSITAT DRESDEN

Bibliography

[1] http://www.biomed.polimi.it/BSI2012/

[2] Wikipedia Kalman filter model graphic. http://en.wikipedia.org/wiki/File:Kalman_

filter_model.svg

[3] Acharya, U. R. ; Krishnan, S.M. (Hrsg.): Advances in Cardiac Signal Processing.Springer, 2007

[4] Andreotti, Fernando: Extraction of the Fetal ECG from Electrocardiographic Long-termRecordings, Technische Universitat Dresden, Diplomarbeit, 2011

[5] ANSI, American National S.: Testing and reporting performance results of cardiac rhythmand ST-segment measurement algorithms. http://www.aami.org/. Version: 1998

[6] Arnold, M. ; Miltner, W. H. ; Witte, H. ; Bauer, R. ; Braun, C.: Adaptive ARmodeling of nonstationary time series by means of Kalman filtering. In: IEEE TransBiomed Eng 45 (1998), May, Nr. 5, 553–562. http://dx.doi.org/10.1109/10.668741. –DOI 10.1109/10.668741

[7] In: Berkhout, A. J. ; Zaanen, P.R.: A comparision between Wiener Filtering, KalmanFiltering, and Deterministic Least Square Estimation. 1976, 142-197

[8] Bonnabel, S. ; Martin, P. ; Salaun, E.: Invariant Extended Kalman Filter: theory andapplication to a velocity-aided attitude estimation problem. In: Proc. 48th IEEE Conf.held jointly with the 2009 28th Chinese Control Conf Decision and Control CDC/CCC2009, 2009, S. 1297–1304

[9] Bryson, A. ; Johansen, D.: Linear filtering for time-varying systems using measurementscontaining colored noise. 10 (1965), Nr. 1, S. 4–10. http://dx.doi.org/10.1109/TAC.

1965.1098063. – DOI 10.1109/TAC.1965.1098063

[10] Bucy, R.S. ; Joseph, P.D. ; Publ., AMS C. (Hrsg.): Filtering for Stochastic Processeswith Applications to Guidance. 2nd Edition. John Wiley & Sons, 1968 ISBN0-8218-3782-6

[11] Casella, Roger L. George; Berger B. George; Berger ; Brooks, The Wadsworth (Hrsg.):Statistical inference. 2 edition. Duxbury Press; 2 edition, 2001 (978-0534243128). – 660pages S.

[12] Chen, Yu ; Yan, Zhuangzhi ; He, Weixin: Detection Of QRS-Wave In Electro-cardiogram: Based On Kalman And Wavelets. In: Conf Proc IEEE Eng Med BiolSoc 3 (2005), 2758–2760. http://dx.doi.org/10.1109/IEMBS.2005.1617043. – DOI10.1109/IEMBS.2005.1617043

[13] Clifford, G. D. ; Shoeb, A. ; McSharry, P. E. ; Janz, B. A.: Model-based filtering,compression and classification of the ECG. In: Proceedings of Bioelectromagnetism and 5thInternational Symposium on Noninvasive Functional Source Imaging within the HumanBrain and Heart (BEM & NFSI). Minnesota, USA, May 2005

76

Page 91: TECHNISCHE UNIVERSITAT DRESDEN

Bibliography

[14] Dhaouadi, R. ; Mohan, N. ; Norum, L.: Design and implementation of an extendedKalman filter for the state estimation of a permanent magnet synchronous motor. 6 (1991),Nr. 3, S. 491–497. http://dx.doi.org/10.1109/63.85891. – DOI 10.1109/63.85891

[15] Donoho, D. L.: De-noising by soft-thresholding. 41 (1995), Nr. 3, S. 613–627. http:

//dx.doi.org/10.1109/18.382009. – DOI 10.1109/18.382009

[16] Fenton, N.E. ; Neil, M.: Probability Theory and Bayesian Belief Bayesian Networks.Version: 2012. http://www.eecs.qmul.ac.uk/~norman/BBNs/BBNs.htm

[17] Goldberger, A. L. ; Amaral, L. A. ; Glass, L. ; Hausdorff, J. M. ; Ivanov, P. C.; Mark, R. G. ; Mietus, J. E. ; Moody, G. B. ; Peng, C. K. ; Stanley, H. E.:PhysioBank, PhysioToolkit, and PhysioNet: components of a new research resource forcomplex physiologic signals. In: Circulation 101 (2000), Jun, Nr. 23, E215–E220. http:

//www.physionet.org/physiobank/database/mitdb/

[18] Grewal, Angus P. A. Mohinder S. l l. Mohinder S. l ; Upper Saddle River, Pren-tice H. NJ USA U. NJ USA (Hrsg.): Kalman filtering: theory and practice. John Wiley& Sons, Inc., 1993 http://books.google.com/books?id=zDHncuewKsQC&pg=PA213&hl=

de&source=gbs_selected_pages&cad=3#v=onepage&q&f=false

[19] Haykin, Simon: Kalman Filtering and Neural Networks. Wiley-Interscience, 2001http://www.amazon.com/exec/obidos/redirect?tag=citeulike07-20&path=ASIN/

0471369985. – ISBN 0471369985

[20] Houtekamer, Herschel L. M. P. L. L. P. L.: Data Assimilation Using an Ensemble KalmanFilter Technique. In: AMS Journals 126 (1998)

[21] Julier, S. J. ; Uhlmann, J. K.: Unscented filtering and nonlinear estimation. 92(2004), Nr. 3, S. 401–422. http://dx.doi.org/10.1109/JPROC.2003.823141. – DOI10.1109/JPROC.2003.823141

[22] Julier, Simon ; Uhlmann, Jeffrey K.: A General Method for Approximating NonlinearTransformations of Probability Distributions. 1996. – Forschungsbericht

[23] Kabir, M. A. ; Shahnaz, C.: An ECG signal denoising method based on enhancementalgorithms in EMD and Wavelet domains. In: Proc. TENCON 2011 - 2011 IEEE Region10 Conf, 2011, S. 284–287

[24] Kalman, R.E.: A New Approach to Linear Filtering and Prediction Problems. In: Journalof Basic Engineering 82 (Series D) (1960), S. 35–45

[25] Kay, S. M. ; Cliffs, Englewood (Hrsg.): Fundamentals of Statistical Signal Processing:Estimation Theory. Bd. 1. Prentice Hall; 1 edition (April 5, 1993), 1993. – 625 S.

[26] Kleeman, Lindsay: Understanding and Applying Kalman Filtering, Depart-ment of Electrical and Computer Systems Engineering. Monash University, Clayton,Diss., 1995. http://www.cs.cmu.edu/~biorobotics/papers/sbp_papers/integrated3/kleeman_kalman_basics.pdf

[27] Lander, P. ; Berbari, E. J.: Time-frequency plane Wiener filtering of the high-resolutionECG: background and time-frequency representations. 44 (1997), Nr. 4, S. 247–255. http://dx.doi.org/10.1109/10.563294. – DOI 10.1109/10.563294

Final Project - Marcos Cruz Santiago 77

Page 92: TECHNISCHE UNIVERSITAT DRESDEN

Bibliography

[28] Lander, P. ; Berbari, E. J.: Time-frequency plane Wiener filtering of the high-resolutionECG: development and application. 44 (1997), Nr. 4, S. 256–265. http://dx.doi.org/

10.1109/10.563295. – DOI 10.1109/10.563295

[29] Lange, Antti: Optimal Kalman Filtering for ultra-reliable Tracking. In: Optimal KalmanFiltering for ultra-reliable Tracking (2003,), 13-15 October 2003. http://www.fkf.net/

LangeA2003.PDF

[30] Larks, Saul D.: Present Status of Fetal Electrocardiography. In: IRE Transactions onBio-Medical Electronics 9 (1962), Nr. 3, S. 176–180. http://dx.doi.org/10.1109/TBMEL.1962.4322994. – DOI 10.1109/TBMEL.1962.4322994

[31] Li, Qiao ; Mark, Roger G. ; Clifford, Gari D.: Artificial arterial blood pressure ar-tifact models and an evaluation of a robust blood pressure and heart rate estimator. In:Biomed Eng Online 8 (2009), 13. http://dx.doi.org/10.1186/1475-925X-8-13. – DOI10.1186/1475–925X–8–13

[32] Markovsky, Ivan ; Amann, Anton ; Van Huffel, Sabine: Application of filteringmethods for removal of resuscitation artifacts from human ECG signals. In: Conf ProcIEEE Eng Med Biol Soc 2008 (2008), 13–16. http://dx.doi.org/10.1109/IEMBS.2008.

4649079. – DOI 10.1109/IEMBS.2008.4649079

[33] Masreliez, C. ; Martin, R.: Robust bayesian estimation for the linear model and ro-bustifying the Kalman filter. 22 (1977), Nr. 3, S. 361–371. http://dx.doi.org/10.1109/TAC.1977.1101538. – DOI 10.1109/TAC.1977.1101538

[34] Maybeck, Peter S.: Stochastic Models, Estimation, and Control, Volume 1. AcademicPress, Inc. (London) LTD., 1979 http://www.cs.unc.edu/~welch/media/pdf/maybeck_

ch1.pdf

[35] McSharry, P. E. ; Clifford, G. D. ; Tarassenko, L. ; Smith, L. A.: A dynamicalmodel for generating synthetic electrocardiogram signals. 50 (2003), Nr. 3, S. 289–294.http://dx.doi.org/10.1109/TBME.2003.808805. – DOI 10.1109/TBME.2003.808805

[36] Meau, Yeong P. ; Ibrahim, Fatimah ; Narainasamy, Selvanathan A L. ; Omar,Razali: Intelligent classification of electrocardiogram (ECG) signal using extended KalmanFilter (EKF) based neuro fuzzy system. In: Comput Methods Programs Biomed 82(2006), May, Nr. 2, 157–168. http://dx.doi.org/10.1016/j.cmpb.2006.03.003. – DOI10.1016/j.cmpb.2006.03.003

[37] Mneimneh, M. A. ; Yaz, E. E. ; Johnson, M. T. ; Povinelli, R. J.: An adaptive kalmanfilter for removing baseline wandering in ECG signals. In: Proc. Computers in Cardiology,2006, 253–256

[38] Moody, G. B. ; Mark, R. G.: QRS morphology representation and noise estimation usingthe Karhunen-Loeve transform. In: Proc. Computers in Cardiology 1989, 1989, S. 269–272

[39] Narasimhan, Balasubramanian: The Normal Distribution. Version: Jul 1996. http:

//www-stat.stanford.edu/~naras/jsm/NormalDensity/NormalDensity.html

[40] Nemati, Shamim ; Malhotra, Atul ; Clifford, Gari D.: Data Fusion for ImprovedRespiration Rate Estimation. In: EURASIP J Adv Signal Process 2010 (2010), 926305.http://dx.doi.org/10.1155/2010/926305. – DOI 10.1155/2010/926305

Final Project - Marcos Cruz Santiago 78

Page 93: TECHNISCHE UNIVERSITAT DRESDEN

Bibliography

[41] Olfati-Saber, R.: Kalman-Consensus Filter : Optimality, stability, and performance. In:Proc. 48th IEEE Conf. held jointly with the 2009 28th Chinese Control Conf Decision andControl CDC/CCC 2009, 2009, S. 7036–7042

[42] Physiobank: The MIT-BIH Normal Sinus Rhythm Database. Online available at:http://www.physionet.org/physiobank/database/nsrdb/,

[43] Rheinberger, Klaus ; Steinberger, Thomas ; Unterkofler, Karl ; Baubin, Michael; Klotz, Andreas ; Amann, Anton: Removal of CPR artifacts from the ventricularfibrillation ECG by adaptive regression on lagged reference signals. In: IEEE Trans BiomedEng 55 (2008), Jan, Nr. 1, 130–137. http://dx.doi.org/10.1109/TBME.2007.902235. –DOI 10.1109/TBME.2007.902235

[44] Ribeiro, Maria I.: Introduction to Kalman Filtering. https://dspace.ist.

utl.pt/bitstream/2295/203912/1/Cap4-Kalman-Filter%20%28export%29.pdf.Version: October 2008

[45] Ruiz de Gauna, Sofia ; Ruiz, Jesus ; Irusta, Unai ; Aramendi, Elisabete ;Eftestøl, Trygve ; Kramer-Johansen, Jo: A method to remove CPR artefactsfrom human ECG using only the recorded ECG. In: Resuscitation 76 (2008), Feb,Nr. 2, 271–278. http://dx.doi.org/10.1016/j.resuscitation.2007.08.002. – DOI10.1016/j.resuscitation.2007.08.002

[46] Sameni, R. ; Shamsollahi, M. B. ; Jutten, C.: Filtering Electrocardiogram SignalsUsing the Extended Kalman Filter. In: Proc. 27th Annual Int. Conf. of the Engineering inMedicine and Biology Society IEEE-EMBS 2005, 2005, S. 5639–5642

[47] Sameni, R. ; Shamsollahi, M. B. ; Jutten, C. ; Babaie-Zadeh, M.: Filtering noisyECG signals using the extended kalman filter based on a modified dynamic ECG model.In: Proc. Computers in Cardiology, 2005, S. 1017–1020

[48] Sameni, R. ; Shamsollahi, M. B. ; Jutten, C. ; Clifford, G. D.: A Nonlinear BayesianFiltering Framework for ECG Denoising. 54 (2007), Nr. 12, S. 2172–2185. http://dx.doi.org/10.1109/TBME.2007.897817. – DOI 10.1109/TBME.2007.897817

[49] Sameni, Reza: The Open-Source Electrophysiological Toolbox (OSET), version 2.1, 2010.http://www.oset.ir

[50] Sameni Reza: Extraction of Fetal Cardiac Signals from an Array of Maternal AbdominalRecordings, Institut Polytechnique de Grenoble, Diss., 2008

[51] Sayadi, O. ; Sameni, R. ; Shamsollahi, M. B.: ECG Denoising Using Parameters ofECG Dynamical Model as the States of an Extended Kalman Filter. In: Proc. 29th AnnualInt. Conf. of the IEEE Engineering in Medicine and Biology Society EMBS 2007, 2007, S.2548–2551

[52] Sayadi, O. ; Sameni, R. ; Shamsollahi, M. B.: ECG Denoising Using Parameters ofECG Dynamical Model as the States of an Extended Kalman Filter. In: Proc. 29th AnnualInt. Conf. of the IEEE Engineering in Medicine and Biology Society EMBS 2007, 2007, S.2548–2551

[53] Sayadi, Omid ; Shamsollahi, Mohammad B. ; Clifford, Gari D.: Synthetic ECGgeneration and Bayesian filtering using a Gaussian wave-based dynamical model. In: PhysiolMeas 31 (2010), Oct, Nr. 10, 1309–1329. http://dx.doi.org/10.1088/0967-3334/31/10/002. – DOI 10.1088/0967–3334/31/10/002

Final Project - Marcos Cruz Santiago 79

Page 94: TECHNISCHE UNIVERSITAT DRESDEN

Bibliography

[54] Sayadi, Omid ; Shamsollahi, Mohammad B.: ECG denoising and compression us-ing a modified extended Kalman filter structure. In: IEEE Trans Biomed Eng 55(2008), Sep, Nr. 9, 2240–2248. http://dx.doi.org/10.1109/TBME.2008.921150. – DOI10.1109/TBME.2008.921150

[55] Schreiber, Thomas ; Kaplan, Daniel T.: Nonlinear noise reduction for electrocardio-grams. In: Chaos 6 (1996), Mar, Nr. 1, 87–92. http://dx.doi.org/10.1063/1.166148. –DOI 10.1063/1.166148

[56] Sittig, D. F. ; Cheung, K. H.: A parallel implementation of a multi-state Kalman filteringalgorithm to detect ECG arrhythmias. In: Int J Clin Monit Comput 9 (1992), Nr. 1, S.13–22

[57] Staff., Analytic Sciences Corporation. T. ; Gelb, Arthur (Hrsg.): Applied Optimal Esti-mation. Cambridge, Mass., M.I.T. Press, 1974 http://mitpress.mit.edu/catalog/item/

default.asp?ttype=2&tid=7602

[58] Suhrbier, Alexander ; Heringer, Rafael ; Walther, Thomas ; Malberg, Hagen ; Wes-sel, Niels: Comparison of three methods for beat-to-beat-interval extraction from contin-uous blood pressure and electrocardiogram with respect to heart rate variability analysis.In: Biomed Tech (Berl) 51 (2006), Jul, Nr. 2, 70–76. http://dx.doi.org/10.1515/BMT.

2006.013. – DOI 10.1515/BMT.2006.013

[59] Taralunga, D. ; Wolf, W. ; Strungaru, R. ; Ungureanu, G. M.: Abdominal Signals:Denoising by Application of the Event Synchronuous Canceller. In: Proc. 29th AnnualInt. Conf. of the IEEE Engineering in Medicine and Biology Society EMBS 2007, 2007, S.566–569

[60] Tarvainen, M. ; Georgiadis, S. ; Karjalainen, P.: Time-varying analysis of heartrate variability with kalman smoother algorithm. In: Conf Proc IEEE Eng Med BiolSoc 3 (2005), 2718–2721. http://dx.doi.org/10.1109/IEMBS.2005.1617032. – DOI10.1109/IEMBS.2005.1617032

[61] Tarvainen, M. P. ; Georgiadis, S. ; Lipponen, J. A. ; Hakkarainen, M. ;Karjalainen, P. A.: Time-varying spectrum estimation of heart rate variabil-ity signals with Kalman smoother algorithm. In: Conf Proc IEEE Eng Med BiolSoc 2009 (2009), 1–4. http://dx.doi.org/10.1109/IEMBS.2009.5332678. – DOI10.1109/IEMBS.2009.5332678

[62] Technologie, Elysium: IEEE Final Year Projects 2011-2012. Ely-sium Technologies Pvt Ltd. http://www.slideshare.net/sunda2011/

ieee-final-year-projects-20112012-elysium-technologies-pvt-ltdbiomedicalnew.Version: 2011-2012

[63] Ungureanu, G. Mihaela ; W M Bergmans Johannes ; Oei, S. Guid ; UngureanuAlexandru ; Wolf Werner: Comparison and evaluation of existing methods for theextraction of low amplitude electrocardiographic signals: a possible approach to trans-abdominal fetal ECG. In: Biomed Tech (Berl) 54 (2009), Apr, Nr. 2, 66–75. http:

//dx.doi.org/10.1515/BMT.2009.008. – DOI 10.1515/BMT.2009.008

[64] Ungureanu, M. ; Bergmans, J. W. M. ; Mischi, M. ; Guid Oei, S. ; Strungaru, R.:Improved Method for Fetal Heart Rate Monitoring. In: Proc. 27th Annual Int. Conf. ofthe Engineering in Medicine and Biology Society IEEE-EMBS 2005, 2005, 5916–5919

Final Project - Marcos Cruz Santiago 80

Page 95: TECHNISCHE UNIVERSITAT DRESDEN

Bibliography

[65] Vullings, R. ; Vries, B. de ; Bergmans, J. W. M.: An Adaptive Kalman Filter for ECGSignal Enhancement. 58 (2011), Nr. 4, S. 1094–1103. http://dx.doi.org/10.1109/TBME.2010.2099229. – DOI 10.1109/TBME.2010.2099229

[66] Welch ; Bishop: An Introduction to the Kalman Filter. In: University of North Carolinaat Chapel Hill, Department of Computer Science (2006), 16. http://www.cs.unc.edu/

~welch/media/pdf/kalman_intro.pdf

[67] Woolfson, M. S.: Study of cardiac arrhythmia using the Kalman filter. In: Med BiolEng Comput 29 (1991), Jul, Nr. 4, 398–405. http://www.springerlink.com/content/

lh524m151m2351k8/

Final Project - Marcos Cruz Santiago 81

Page 96: TECHNISCHE UNIVERSITAT DRESDEN

A. Publication

The promising results obtained during this work have lead to a contribution in a publicationbased on them. This publication, titled “Fetal QRS detection by means of Kalman filtering andusing the Event Synchronous Canceller” was submitted in the 7th International Workshop onBiosignal Interpretation in Como, Italy.

The whole publication is attached in the following pages.

a

Page 97: TECHNISCHE UNIVERSITAT DRESDEN

Fetal QRS detection by means of Kalman filtering and using the EventSynchronous Canceller

S. Zaunseder1, F. Andreotti1, M. Cruz1, H. Stepan2, C. Schmieder2, H. Malberg1, A. Jank2

1Institute of Biomedical Engineering, Dresden University of Technology, Germany;2Department of Obstetrics, University of Leipzig, Germany;

Abstract

The fetal ECG (fECG) provides a mean to monitornon-invasively the fetal heart activity. Until today, itslow signal to noise ratio hampered an extended useof the fECG in clinical practice. As proposed pro-cessing methods have shown a lack of accuracy incertain circumstances, the characterization and fur-ther development of methods to process the fECG isof high interest. This contribution aims at a compar-ative evaluation of two methods, namely a KalmanFilter based approach and a classical template sub-traction approach, regarding their ability to be usedin the context of fetal QRS detection. Although bothmethods prove to be applicable to detect fetal QRScomplexes, the Kalman based approach has shownto perform more accurately using simulated and realdatasets.

Keywords Abdominal recording, biosignal process-ing, Event Synchronous Canceller, fetal ECG, Kalman Fil-ter, template subtraction

1 Introduction

Today, cardiotocography (CTG) constitutes a standardprocedure to assess the fetal health. By using ultra-sounds, CTG provides a mean to analyze the fetal heartrate (fHR). At the same time, uterine activity is recordedby a pressure transducer. CTG has proven its diagnosticvalue in many cases, rendering the technology an indis-pensable tool in the obstetric field.

In spite of its clinical importance, CTG only providesinformation on the mechanics of the fetal heart. Fur-ther on, CTG allows only intermittent short-term record-ings which have to be performed under expert guidance.The fetal ECG (fECG) constitutes an alternative to de-rive statements about the fetal heart. The fECG can berecorded invasively (typically by using a scalp electrode)but also non-invasive recordings are feasible by placingelectrodes on the maternal abdomen. The latter approach,so called abdominal recordings, is of high interest as thistechnique provides an exceptional facile mean to contin-uously record the fECG. Besides the analysis of the fHR,application scenarios comprise the analysis of fetal heartrate variability (fHRV) [1], the analysis of fetal-maternalsynchronization [2] and the morphological analysis of the

fECG [3] in stationary and even ambulatory settings. Dueto its explanatory power as well as its superior applicationconditions, the fECG acquired by abdominal electrodeshas the potential to significantly supplement, or in somecases even substitute, the CTG in obstetric diagnostics.

In today’s clinical practice, however, the fECG usage isalmost completely limited to the heart-beat analysis andinvasive ECG recordings (measured by a scalp electrodeduring labor). An expanded use of the fECG measured byelectrodes placed on the maternal abdomen is hinderedby the low SNR of the fECG. So far, the technology toreliably measure fECG is largely unavailable [4].

Lately, many approaches have been proposed to pro-cess the fECG. The most crucial issue in process-ing abdominal recordings remains the extraction of thefECG, i.e. the separation of the fetal signal compo-nents from noise sources, most important the maternalECG (mECG). Proposed approaches include direct de-tection, filtering techniques, template subtraction meth-ods and methods which rely on blind source separation(an overview can be found in [5]). Recently, also thepotential applicability of Kalman Filters (KF) was pro-posed [4].

This study aims at evaluating the applicability of KFas compared to a method denominated as Event Syn-chronous Canceller (ESC) [6] in the context of fetal QRSdetection. Both methods, KF and ESC, can be applied tosingle channel abdominal recordings and are thought tobe able to preserve the morphology of the fECG duringits extraction. These characteristics render those methodspromising choices and contribute to the interest in theirdevelopment and deeper characterization.

2 Materials and Methods

2.1 Simulated Data

Simulated data provides the advantage of knowingabout the occurrence of fetal QRS complexes. The useddata material was created by superimposing records ofthe Normal Sinus Rhythm Database (NSRDB) availablevia PhysioNet [7]. By using PhysioNet’s xform() therecords were upsampled to 500 Hz and 1000 Hz to repre-sent the fetal and the maternal component, respectively.Different fetal-maternal SNRs were obtained by scalingthe amplitude of the fetal signal. Thereto, similar to theproceeding in the field of noise stress testing, the fetal-

Page 98: TECHNISCHE UNIVERSITAT DRESDEN

Record ID Maternal ECG Fetal ECG1 17052 162652 17453 162723 18177 162734 18184 164205 19088 164836 19090 165397 19093 167738 19140 167869 19830 16795

Table 1: Overview on the simulated datasets and theNSRDB records from which the datasets were built up.

maternal SNR was derived on the basis of QRS ampli-tudes, i.e.

SNRfm = 10 · log(Pf

Pm

)→ 10 · log

(amp2famp2m

)(1)

where Pf and Pm are the powers of fetal and maternalECG, respectively. As surrogates of those powers theamplitudes ampf and ampm of the QRS complexes asmeasured by PhysioNet’s sigamp() function were used.The scaling factor s, to be applied in order to guarantee acertain fetal-maternal SNR, was than calculated by

s =ampdesiredf

ampf=|ampm| · 10

SNRfm20

ampf(2)

Table 1 contains the identifiers (ID) of the simulateddatasets and their original recordings. Each of the super-imposed records has a length of 30 minutes (we used thefirst 30 (for the maternal component) and 60 minutes (forthe fetal component) of the respective original records).Evaluated SNRs comprise -3 dB, -6 dB, -9 dB and -12 dB(see Fig. 1) resulting in 36 records overall.

2.2 Real Data

Real data was recorded at the Department of Obstetricsand Gynecology (University of Leipzig). This data setwas used to validate the results which were gained by us-ing simulated data regarding the real world significance.Recordings were carried out using the ADInstrumentsML138 Octal Bio Amp and the ADInstruments Power-Lab 16/30. Fig. 2 shows the lead configuration which wasused. All abdominal channels were analogously filteredby a mains filter and a high pass filter (cutoff frequency 1Hz). Sampling was done at 1000 Hz. The measurementrange of the abdominal recordings was 500µV.

Within this study, we included 10 real datasets from6 woman (woman 29.5 ± 4.4 years, week of gestation27.1 ± 4.4 weeks; all values given by mean ± standarddeviation). The datasets were selected manually from alarger patient collective to reflect a representative cross-section of occurring signal qualities. Each dataset has aduration of 20 minutes. The records were annotated man-ually by using the maternal channel and two abdominalchannels. The two abdominal channels were selected so

0

500

1000

Am

plitu

dein

AD

U

0

500

1000

Am

plitu

dein

AD

U

0

500

1000

Am

plitu

dein

AD

U

0 1 2 3 4

0

500

1000

Time in seconds

Am

plitu

dein

AD

U

Student Version of MATLAB

Figure 1: Signal excerpt of the simulated data (record1). Top-down fetal-maternal SNRs of -3 dB, -6 dB, -9 dBand -12 dB are shown. At each SNR the smaller QRScomplexes represent the fetal component.

Ref6

7 8

1

Ref

4

32

5

Figure 2: Lead configuration used to record real data.(note that two figures are used only for the clearness ofthe graphical illustration)

that the fetal QRS showed differing polarities. We an-notated each fetal QRS complex which was visible usingthe contextual information of all three channels. For auto-matic processing, a single channel was chosen manually.The chosen channel was the one which exhibits the bestquality of fECG as could be observed by visual inspection(twice channel 4, twice channel 5, four times channel 6,twice channel 7).

2.3 Data processing

The signal processing comprises the steps which areoutlined in Fig. 3. The pursued approaches only differ inthe way the extraction of the fECG is handled.

2.3.1 Preprocessing

Preprocessing included the application of a band-passfilter. As only QRS detection was to be accomplished(no morphological evaluation) a pass-band from 2 Hz to

Page 99: TECHNISCHE UNIVERSITAT DRESDEN

preprocessing

Kalman approach

fQRS detection

ESC approach

preprocessed signal

extracted fECG extracted fECG

abdominal recording

detection performance detection performance

Figure 3: Applied processing scheme.

100 Hz was chosen. Filtering was done in forward and re-vers direction by applying a 1000 tap FIR filter. To sup-press power-line interference an additional FIR filter atpower-line frequency was applied.

2.3.2 fECG Extraction

Kalman approach: Kalman Filtering is a recursivedata processing algorithm which is modeled by the fol-lowing equations

xk = Axk−1 +Buk−1 + wk−1 (3)zk = Hxk + vk (4)

Being xk the desired hidden state, uk a known input vec-tor and zk the output of the system. The random vari-ables, wk and vk, describe the stochastic process associ-ated to the measure and to the system. Remaining ma-trices model the system dynamics. KF execution relieson two factors: the observation equations and its innermodel. Depending on how reliable this factors are, thefilter will put more weight in one or the other.

In our case, we selected the Extended KalmanSmoother (EKS) which is an extension of KF. EKS basedfiltering is able to extract the maternal ECG componentwhich can be removed afterwards from the composed sig-nal. As dynamic model of the KF we used McSharry’ssynthetic ECG generator as modified by Sameni [4]. Toconstruct the model, a phase wrapping of the beats fromsegments of 200 s in a sliding window was carried out.

Event Synchronous Canceller approach: ESC isbased on coherent averaging of N beats to construct atime varying beat template. By subtracting scaled ver-sions of the current template the maternal componentis removed from the composed signal. Details on themethod can be found in [6]. In our study differentN weretested, the given results correspond to N = 15. Align-ment of beats was done by maximizing the correlation ofeach beat compared to one reference beat. To account fordiffering lengths of the beats Gaussian noise was concate-nated to signal excerpts when necessary. In order to buildup a signal to be subtracted from the abdominal recordingsmooth concatenation of scaled versions of the templatewas applied.

2.3.3 QRS Detection

As QRS detector we used the method which was pro-posed by Suhrbier et al [8]. The algorithm searches forrelevant slopes by applying a patient adaptive search cri-terion.

2.4 Performance assessment

The performance of the processing methods was eval-uated in terms of QRS detection accuracy by using stan-dardized beat-to-beat comparison as provided by Phys-ioNet’s bxb() function. According to the ANSI/AAMIEC57:1998 [9] we calculated sensitivity

Se =TP

TP + FN(5)

and positive predictive value

+P =TP

TP + FP(6)

where TP, FN and FP are the true positives, false nega-tive and false positive detections. Compared to the as-sessment of QRS detectors as depicted in EC57:1998,the temporal match in which a detection was regarded ascorrect was lowered to 50 ms in order to account for thehigher heart rates of the fetal ECG.

3 Results

Table 2 contains the averaged results for the simulateddata at different SNRs. By considering the slopes whichoccur in the fECGs after their extraction, the design of theQRS detector guarantees a high positive predictive value.Meanwhile, in case of the KF based approach the sen-sitivity is only slightly affected by lower fetal-maternalSNRs. Considering the ESC, the effect is much more pro-nounced. The detection rates for real datasets confirm theobserved tendency. The decrease in the overall detectionrates are due to the increased influence of additional noisesource which affect the abdominal signal apart from themECG. Similar effects have been obtained by superim-posing the simulated data with additional noise as donein noise stress testing.

Considering the simulated data, Table 3 outlines thedetailed results for a SNR of -6 dB. Although in averageboth methods behave similar, by analyzing the results perrecord it turns out that both methods behave rather differ-ently.

Test set Kalman ESC+P Se +P Se

Simulated, -3 dB 99.98 93.70 99,98 92.91Simulated, -6 dB 99.98 91.99 99,98 86.41Simulated, -9 dB 99.98 90.39 99,97 74.76Simulated, -12 dB 99.98 88.67 99,96 56.65Real data 83.59 76.98 81.87 73.19

Table 2: Average results for the test data (sensitivities Seand positive predictive values +P are given in %)

Page 100: TECHNISCHE UNIVERSITAT DRESDEN

Record ID Kalman ESC+P Se +P Se

1 99.97 89.80 99.97 82.652 99.98 92.59 99.97 77.793 99.98 94.26 99.98 95.584 99.98 93.44 99.98 89.975 99.98 91.06 99.97 72.546 99.98 91.14 99.97 74.387 99.97 92.12 99.97 95.838 100.00 92.64 99.98 96.779 99.98 90.87 99.98 92.18

Table 3: Fetal QRS detection results per record at fetal-maternal SNR of -6 dB (sensitivities Se and positive pre-dictive values +P are given in %)

0

500

1000

Am

plitu

dein

AD

U

0

0.65

Arb

itrar

yun

its

0 1 2 3 4

0

1.25

Time in seconds

Arb

itrar

yun

its

Student Version of MATLAB

Figure 4: Simulated abdominal recording (SNR = -9 dB)(topmost signal) with its fetal component as extracted bymeans of KF (middle signal) and ESC (lowermost signal)

Fig. 4 contains an example of a signal excerpt whichdistinctly clarifies the differing behavior of both meth-ods: whereas the KF based approach suppresses well thematernal component, it tends to suppress the fetal part incases of complete overlaps. ESC behaves completely dif-ferent: the fetal component usually won’t be suppressed,but residuals of the mECG may hinder a proper QRS de-tection considerably.

4 Discussion

Although relying on a single abdominal channel, bothmethods, ESC and the KF based approach, have proventheir principle applicability in the context of fetal QRSdetection. Thereby, both methods fail to detect fetal QRScomplexes correctly in certain circumstances. Interest-ingly, as shown in the previous section, the behavior ofthe methods, and therewith their liability to influence fac-tors, differs considerably. In view of this observation, ourwork may contribute to the development of improved ex-traction/detection methods by combining the basic ideasof the methods under consideration. Moreover, the realdata which was selected for this study suggests that theimpact of additional noise sources might be a much morecritical factor than the fetal-maternal SNR. Therefore, the

incorporation of additional processing steps after remov-ing the maternal ECG constitutes another focus of ourfuture works.

References

[1] Peter Van Leeuwen, Silke Lange, Daniel Geue, andDietrich Groenemeyer. Heart rate variability in thefetus: a comparison of measures. Biomed Tech(Berl), 52(1):61–65, Feb 2007.

[2] Maik Riedl, Peter van Leeuwen, Alexander Suhrbier,Hagen Malberg, Dietrich Groenemeyer, JuergenKurths, and Niels Wessel. Testing foetal-maternalheart rate synchronization via model-based anal-yses. Philos Transact A Math Phys Eng Sci,367(1892):1407–1421, Apr 2009.

[3] Gari Clifford, Reza Sameni, Jay Ward, Julian Robin-son, and Adam J Wolfberg. Clinically accurate fetalECG parameters acquired from maternal abdominalsensors. Am J Obstet Gynecol, Mar 2011.

[4] Reza Sameni. Extraction of Fetal Cardiac Sig-nals from an Array of Maternal Abdominal Record-ings. PhD thesis, Institut Polytechnique de Grenoble,Grenoble, France, 2008.

[5] Reza Sameni and Gari D. Clifford. A Review of FetalECG Signal Processing; Issues and Promising Direc-tions. The Open Pacing, Electrophysiology & Ther-apy Journal (TOPETJ), 3:4–20, November 2010.

[6] Mihaela Ungureanu and Werner M. Wolf. Basic as-pects concerning the event-synchronous interferencecanceller. IEEE Trans Biomed Eng, 53(11):2240–2247, Nov 2006.

[7] Ary L. Goldberger, Luis A. Amaral, Leon Glass,Jeffrey M. Hausdorff, Plamen C. Ivanov, RogerG. Mark, Joseph E. Mietus, George B. Moody,Chung K. Peng, and H. Eugene Stanley. PhysioBank,PhysioToolkit, and PhysioNet: components of a newresearch resource for complex physiologic signals.Circulation, 101(23):E215–E220, Jun 2000.

[8] Alexander Suhrbier, Rafael Heringer, ThomasWalther, Hagen Malberg, and Niels Wessel. Com-parison of three methods for beat-to-beat-interval ex-traction from continuous blood pressure and electro-cardiogram with respect to heart rate variability anal-ysis. Biomed Tech (Berl), 51(2):70–76, Jul 2006.

[9] ANSI/AAMI EC57:1998 - Testing and reporting per-formance results of cardiac rhythm and ST-segmentmeasurement algorithms.

Address for correspondence:

Sebastian ZaunsederInstitute of Biomedical Engineering (TU Dresden)[email protected]

Page 101: TECHNISCHE UNIVERSITAT DRESDEN

B. Data CD

Content:

• Final Project (as .pdf document).

• LaTeX Source Code (text, figures, bibliographic sources).

• Algorithm for fetal extraction in MATLAB R© with respective functions.

• Used real Datasets with their respective manual annotations.

• Literature.

• Publication submitted in the 7th International Workshop on Biosignal Interpretation inComo, Italy.

f