Abstract-Ectopic beats are early heart beats with remarkable large amplitude that provoke serious disturbances in the analysis of electrocardiograms (ECG). These beats are very common in atrial fibrillation (AF) and are the source of important residua when the QRST is intended to be removed. Given that QRST cancellation is a binding step in the appropriate analysis of atrial activity (AA) in AF, a method for ventricular ectopic beats cancellation is proposed as a previous step to the application of any QRST removal technique. First, the method discriminates between normal and ectopic beats with an accuracy higher than 99% through QRS morphological characterization. Next, the most similar ectopic beats to the one under cancellation are clustered and serve to get their eigenvector matrix by principal component analysis. Finally, the highest variance eigenvector is used as cancellation template. The reduction ectopic rate (RER) has been defined to evaluate the method's performance by using templates generated with 5, 10, 20, 40 or 80 ectopics. Optimal results were reached with the 5 most similar complexes, yielding a RER higher than 5.5. In addition, a decreasing RER trend was noticed as the number of considered ectopics for cancellation increased. As conclusion, given that ectopics presented a remarkable variability in their morphology, the proposed cancellation approach is a robust ectopic remover and can notably facilitate the later application of any QRST cancellation technique to extract the AA in the best conditions.