An electrocardiogram (ECG) is the result of measuring the electrical activity of the heart. Analysis of ECG signal is very useful for detecting abnormalities in the heart by a cardiologist. However, the results of the analysis are affected by the conditions of the Electrocardiogram signal. Electrocardiogram signal has the characteristics of nonstationary, nonlinear and susceptible to noise. This noise can damage the ECG signal, causing damage to the ECG signal which makes it difficult for the cardiologist to analyze the electrocardiogram signal. That noise can be sourced from respiration, mode movement, lack of electrode contact, and another electronic device. To overcome this problem, in this paper filtering is done to eliminate noise on ECG signals. The filter method developed in this study is based on Adaptive Fourier Decomposition (AFD). The ECG signal will be decomposed by that method into several components based on their energy distribution. Therefore, AFD has good performance in separate original ECG signal from noise that has different energy distribution. This AFD method is robust with computation time that is not much different from the Discrete Fourier transform method. To measure the performance of AFD based method, several tests have done by using the MIT-BIH Arrhythmia database. Based on tests result the AFD method has a better performance on almost all recordings than the EMD and Wavelet Transform methods.