of atrial fibrillation f l by n a 34 template 34 beat x l by n 2 u03b4 which is influenced by a number of geometrical transformations and additive white noise w the transformations that are considered are rotation represented by the orthonormal matrix q and scaling by a diagonal matrix d the time synchronization matrix j t selects those n samples from the template beat which provide the best fit to each observed beat strictly speaking the atrial fibrillation is likely to be influenced by the same transformations as is x the observation model in 1 however is still considered since the overall effect on the fibrillation activity is considered negligible the noise is here assumed to be uncorrelated between different leads and white within each lead the generalization to spatially limited noise will be considered as being straightforward to those skilled in the art the object of the method is to produce a residual ecg which contains only atrial fibrillation based on the model in 1 the fibrillation signal is estimated by the alignment parameters q d and j t are chosen such that qdxj t matches each beat as good as possible these parameters are estimated during the qrs interval a major problem however is the difficulty to perform the alignment in the presence of atrial fibrillation which influences the signal amplitude during this interval the signal f therefore should be removed before accurate alignment can be performed this procedure would obviously be a contradiction to.