Background: Several authors use the R-R interval, which is the temporal difference between the largest waves (R waves) of the electrocardiogram (ECG), to propose a support system for the diagnosis of arrhythmias. However, R-R interval analysis does not measure ECG waveform deformations such as P wave deformations for atrial fibrillation. Objective: In this study, we propose an arbitrary analysis the any segment of the heartbeat. This analysis is a generalization of a previous work that measures the wave deformations of the ECG signal. Methods: We proposed to investigate the voltage (mV) variation occurring at each heartbeat interval using statistical moments. Unlike the R-R interval in which each heartbeat is associated with a single real number, the proposed method associates each heartbeat to a set of points, that is, a vector. The heartbeats were obtained in the following databases: MIT-BIH Normal Sinus Rhythm, MIT-BIH Atrial Fibrillation (AF), and MIT-BIH Arrhythmia; and the classifiers used to evaluate the proposed method were linear discriminant analysis, k-nearest neighbors, and support vector machine. The experiments were conducted using 80% of the patients for training (16 healthy patients, 41 patients with arrhythmia, and 20 patients with AF) and 20% of the patients for testing (2 healthy patients, 6 patients with arrhythmia, and 3 patients with AF). Results: The proposed method proved to be efficient in solving global (accuracy is up to 99.78% in the arrhythmia classification) and local (accuracy of 100% in the AF classification) heartbeat problems. Conclusion: The results obtained by the proposed method can be used to support decision-making in clinical practices.