Atrial Fibrillation (AF) is a type of cardiac arrhythmia that significantly increases the risk of stroke and heart failure. In general, in the case of patients affected by AF, their electrocardiogram (ECG) shows a typical pattern of irregular RR intervals and abnormal P waves. However, discriminating AF from a normal sinus rhythm or from other types of rhythms remains a challenging problem today. Methods: We analyze the database of PhysioNet/Computing in Cardiology Challenge 2017 to validate our heart rhythm classification technique. The database contains short-term ECG recordings, labelled as normal sinus rhythm, AF, other types of rhythm, and noise. We extract different morphology-based features of ECG signals, and we design a multiclass classifier based on error-correcting output codes, along with a random forest classifier for binary decision making. Results: We test the performance of our classifiers based on the F 1 score of each class and the average F 1 score of all the classes. The final F 1 score obtained on the hidden test set of challenge is 80%. Conclusions: Our results show that our classifier is robust and that it is able to discriminate AF from normal sinus, other rhythms, and noise, based on the morphology of the ECG signal.