Atrial fibrillation (AF) is a type of cardiac arrhythmia that can be detected using an electrocardiogram (ECG). During AF, the electrical signals in the heart become chaotic, causing the upper chambers of the heart (atria) to beat irregularly and rapidly.