ECG Denoising Using a Dynamical Model and a Marginalized Particle Filter Chao Lin 1,3 , M´ onica Bugallo 2 , Corinne Mailhes 1,3 , Jean-Yves Tourneret 3 1 T´ eSA Laboratory, 14-16, Port Saint-Etienne, 31000 Toulouse, France 2 Department of Electrical Engineering, Stony Brook University, Stony Brook, 11794-2350 NY, USA 3 IRIT/ENSEEIHT, University of Toulouse, 2 rue Charles Camichel, 31071 Toulouse, France chao.lin@tesa.prd.fr, monica@ece.sunysb.edu, {jean-yves.tourneret,corinne.mailhes}@enseeiht.fr Abstract—The development of robust ECG denoising tech- niques is important for automatic diagnoses of cardiac diseases. Based on a previously suggested nonlinear dynamic model for the generation of realistic synthetic ECG, we introduce a modified ECG dynamical model with 18 state variables to further include morphology variations. A marginalized particle filter is proposed for tracking this modified nonlinear state-space model which has linear substructures. Quantitative evaluations on the MIT-BIH database show that the proposed algorithm outperforms the extended Kalman filter-based algorithms and can better handle non-Gaussian distributions. Index Terms—Marginalized particle filter, ECG dynamical model, denoising, extended Kalman filter. I. INTRODUCTION The monitoring and analysis of electrocardiograms (ECGs) has received increasing attention because of its vital role in many cardiac disease diagnoses. The development of new sensor technologies has provided new ways of recording ECGs that are more comfortable for patients. However, in most cases, increasing comfort can result in signals with reduced quality. For instance, electrodes that are incorporated in garments generally provide signals with a lower signal-to- noise ratio (SNR) and more artifacts than contact electrodes directly glued to the body [1]. Therefore, extraction of pure ECG components (P, QRS and T waves) from noisy measurements is still a subject of major importance. A nonlinear dynamical model has been recently developed for the generation of synthetic ECG complexes with their relationship to the beat-to-beat RR-interval timing [2]. Ever since, a particular attention has been devoted to this model whose parameters can be estimated with nonlinear Bayesian filtering. In the literature, one can find several extended Kalman filter (EKF) based ECG denoising techniques [3]– [5]. Earlier work [3] consider the polar form of the dynamical model proposed in [2] and take into account two state variables. In [4], [5], the EKF structure has been modified by considering 15 additional equations to better describe the dynamics of model parameters and improve SNR. However, as pointed out in [6], the EKF always approximates the posterior density at every time instant by a Gaussian density. If the assumption does not hold (e.g., if the true density is bimodal or heavily skewed), sequential Monte Carlo (SMC) methods (often referred to as particle filters (PFs)) can be applied to estimate the joint posterior state distribution. This is precisely the solution investigated in this paper for ECG denoising. One can find detailed introductions to PFs in [7]. The key idea is to represent the required posterior density by a set of random samples with associated weights and to compute parameter estimates from these samples and weights. As the number of generated samples increases, the resulting Monte Carlo approximation becomes closer to the actual posterior distribution of interest. Despite the simplicity of the PF principle, its main drawback is its computational complexity especially for large state dimension. This computational complexity can be reduced for nonlinear dynamic models containing a subset of parameters which are linear and Gaussian, conditional upon the other parameters. In this case, the linear parameters can be optimally estimated through standard linear Gaussian filtering. This technique is often referred to as Rao-Blackwellization [8] or marginalization[9]. In this paper, we introduce a dynamic model with 18 state variables that allows the artificial ECG to adapt to normal and abnormal morphologies. Since these state equations are linear with respect to a subset of the unknown parameters, we propose to use a marginalized particle filter (MPF) that gets rid off the states appearing linearly in the dynamics, generate particles in the state of the remaining states and run one Kalman filter for each of these particles to estimate the “linear” parameters. The proposed MPF is evaluated on both synthetic signals generated by [2] and real ECG signals from easily available standard databases. A quantitative compari- son shows that the proposed MPF outperforms the classical EKF-based denoising techniques in terms of SNR. The paper is organized as follows. A brief introduction to the modified ECG dynamical model is provided in section II. Section III is dedicated to the description of the proposed MPF algorithm for ECG denoising. Simulation results are provided in Section IV. Discussion and conclusions are finally reported in Section V. II. ECG MORPHOLOGY AND ECG MODEL As displayed in Fig. 1, each beat of the heart can be observed as a sequence of deflections away from the baseline of the ECG. A normal ECG cycle consists of five major components contained in the complex PQRST. The first deflection (P-wave) is due to the depolarization of the atria. The large QRS complex is due to the depolarization of the