Every third death in developed countries is caused by cardiac diseases, which are the number one cause of death. Duration and dynamic changes of certain intervals of the ECG are well established indicators in the diagnosis of cardiac diseases. Furthermore, several agencies require the assessment of the effect of newly developed drugs on the QT interval. Automated measurement and annotation of the ECG shows numerous advantages over manual methods, therefore the long term aim is to develop an all-in-one device for data acquisition and ECG analysis. The development process is conducted in different stages, whereas the first step and short term aim described in this paper consists of creating algorithms in MATLAB® and validating them against ECG signals manually annotated by medical experts. This early stage is followed by porting all algorithms to the aimed platform and finally by hardware-in-the-loop simulations coupling the measurement hardware with the MATLAB model. The presented algorithm detects R peaks based on the signals amplitude and first derivative as well as RR intervals. False positive detections due to artifacts are prevented by analyzing the signal’s local statistic characteristics. These intermediate results are automatically classified to distinguish normal heartbeats from potential premature ventricular contractions. QRS complexes, P and T waves are detected by their first derivative for each class of heartbeats and are separately refined for each detected heartbeat. The algorithm has been verified against four PhysioNet databases and achieved a sensitivity of 98.5% and a positive predictive value of 98.3%, respectively. These results are promising, but further work is still required to implement the algorithm on an embedded sys-tem to build an easy to use all-in-one device.