This paper presents an algorithm for Electrocardiogram (ECG) analysis to detect and classify ECG waveform anomalies and abnormalities. This is achieved by extracting various features and durations of the ECG waveform such as RR interval, QRS complex, P wave and PR durations. These durations are then compared with normal values to determine the degree and types of abnormalities. Most of the data used for this study were extracted from the MIT-BIH arrhythmia database while some data was extracted from ECG recordings acquired specifically for the purposes of this study. The paper is concluded with detailed results obtained from testing the algorithm using the ECG data. © 2011 IEEE.