|In order to lay the framework for a possible multivariate heart model, a set of methods for preprocessing an electrocardiogram signal has been created. A normalized least mean square adaptive filter was created for filtering out high-frequency noise and power line interference, and the baseline wandering was estimated using respectively a Savitzky-Golay smoothing filter, a Discrete Wavelet Transform, and an Empirical Mode Decomposition, with the Discrete Wavelet Transform showing most promise out of the three. The separate heart cycles in the signal were accurately identified using another Discrete Wavelet Transform, and an algorithm was implemented for splitting the signal and arranging the cycles on top of each other. A method for classifying cycles that showed abnormal behaviour was created, which captured all artifacts, but will be in need of further tuning. An estimation of the respiratory rate was also done, and the frequency content could be observed in the power spectrum of the heart rate variability.