An ECG machine records the electrical signals generated by the heart as it beats.