The SA node acts as the pacemaker of the heart by spontaneously generating action potentials that spread through the atria. The atrioventricular node then slows conduction to allow time for blood to fill the ventricles before they contract. The excitation wave travels through specialized conduction pathways in the ventricles before activating the purkinje fibers and ventricular muscle. The autonomic nervous system controls heart rate and conduction through the atrioventricular node. An ECG records the electrical activity of the heart by detecting the P, QRS, and T waves which represent atrial depolarization, ventricular depolarization, and ventricular repolarization, respectively.