An electrocardiogram monitors the heart. Each beat of the heart is triggered by an electrical impulse, normally generated from special cells in the upper right chamber of the heart. An electrocardiogram records these electrical signals as they travel through the heart. Doctors can use an electrocardiogram to look for patterns among these heartbeats and rhythms to diagnose various heart conditions.