The performance of active power filter (APF) mainly depends on its harmonic detection method. Empirical mode decomposition (EMD) is applied to APF because of its effectiveness for any complicated signal analysis. Ensemble empirical mode decomposition (EEMD) can suppress mode mixing caused by EMD to a certain extent, but the amplitude and energy of fundamental is severely attenuated. To solve this problem, in this article, the causes of attenuation are discussed from the perspective of intrinsic mode functions (IMFs) energy, and an approach based on two-step improved EEMD is proposed. The first improved step (FI-EEMD) is to suppress the mode mixing and fundamental attenuation by injecting white noise and analytical signal with determined parameters into the target signal. The parameters of the analytical signal are selected according to the power grid conditions and signal characteristics. The second improved step (SI-EEMD) puts forward a signal reconstruction method based on the distribution of IMF energy extreme points and the distinguishing law of signal and noise to reduce the influence of noise-dominated components. The results show that the two-step improved EEMD not only has high-quality extracted fundamental with low total harmonic distortion (THD) and energy attenuation, but also has good applicability to aperiodic and nonstationary signals, which greatly improve the harmonic detection accuracy of APF.