Atrial fibrillation is the most common cardiac arrhythmia, presenting significant consequences on patient health. Automatic detection of atrial fibrillation needs, ideally, the isolated study of the atrial activity registered in the electrocardiogram. Sparse decomposition techniques make possible the decomposition of a signal into their components, thus the separation between atrial and ventricular activities. However, this technique requires the a priori construction of distinct dictionaries, usually built based on atrial and ventricular activity simulation models. This work addresses the construction of the dictionaries based on real electrocardiogram signals, where P-waves, QRS-complexes and T-waves are first identified to support the creation of the dictionaries. The effectiveness of the proposed methodology is validated with real signals, obtained from MIT-BIH Arrhythmia Database.