Pharmaceutic studies require to analyze thousands of ECGs in order to evaluate the side effects of a new drug. In this paper we present a new approach to automatic ECG segmentation based on hierarchic continuous density hidden Markov models. We applied a wavelet transform to the signals in order to highlight the discontinuities in the modeled ECGs. A training base of standard 12-lead ECGs segmented by cardiologists was used to evaluate the performance of our method. We used a Bayesian HMM clustering algorithm to partition the training base, and we improved the method by using a multi-model approach. We present a statistical analysis of the results where we compare different automatic methods to the segmentation of the cardiologist.