ECG is a graphical representation of the electrical activity of the heart during a cardiac cycle.
To obtain a standard ECG, a patient is connected to the machine with three electrical leads, one to each wrist and to the left ankle, that continuously monitor the heart activity.
Each peak in the ECG is identified with a letter from P to T that corresponds to a specific electrical activity of the heart.
The P-wave represents the electrical excitation (or depolarisation) of the atria, which leads to the contraction of both the atria.
The QRS complex represents the depolarisation of the ventricles, which initiates the ventricular contraction.
The T-wave represents the return of the ventricles from excited to normal state (repolarisation) and the end of the T-wave marks the end of systole.
By counting the number of QRS complexes that occur in a given time period, one can determine the heart beat rate of an individual.