This work presents the development of an algorithm for analyzing ECG waveforms. The identification of the various waveforms on an ECG is the first and most crucial step in any automated analysis. The algorithm developed is capable of detecting all important waveforms. These include the Q,R,S,R' and S' waves, J and ST points and onset and offset of P and T waves. The various techniques utilized in their detection include adaptive thresholding, parabolic curve fitting, modified derivatives and temporal coherence. After detecting the waveforms, various measurements are obtained from the points detected. These include the polarity of the waveforms, the ST elevation, morphology of ST segment, QRS width and T wave morphologies. These measurements can easily be utilized for diagnosing the ECG for various abnormalities. The developed detection and measurement algorithm stands out from previous works in a number of ways. It is comprehensive and capable of detecting all the important ECG waveforms. It works well even on atypical ECG beats with secondary R' and S' waves. The adaptive thresholding approach minimizes the dependence on fixed hard thresholds. The synchronous behavior of ECG recordings across leads is exploited to improve accuracy. The performance of the algorithm was validated on 40 sample 12-lead ECG data of two minutes each. To validate performance on abnormal ECG waveforms, 20 datasets from patients diagnosed for myocardial infarction (MI) were included. An overall detection accuracy of 98.5% was obtained.