Background: The development of smart grids requires energy meters that enable accurate measurements. Objective: In response to the current issue where Direct Current (DC) energy meters only measure DC components and not ripple components, we propose to design a novel algorithm to achieve accurate separation of DC components and ripple components in DC signals. Methodology: This patent proposes a precise detection algorithm for ripple components. The algorithm is based on the Wavelet Decomposition combined with Flamingo Search Algorithm-Variational Mode Decomposition (WD-FSA-VMD). Firstly, we analyze the ripple characteristics in the DC signal and use the Wavelet Decomposition (WD) algorithm to separate the ripple components in the DC signal accurately. Secondly, we utilize the Flamingo Search Algorithm (FSA) to optimize the number of modal decompositions and the penalty factor in the Variational Mode Decomposition (VMD). This allows us to accurately extract the ripple components. Finally, we conducted simulation experiments comparing the improved algorithm with the original algorithm. Results: The experimental results indicate that the signal correlation coefficient obtained by the WDFSA- VMD algorithm increases by 82.64% compared to traditional VMD, and it increases by 16.72% compared to the combined Wavelet Decomposition with Whale Optimization Algorithm-Variational Mode De-composition (WD-WOA-VMD). Conclusion: The improved algorithm we proposed has good adaptability and separation performance. It is prospective for the new algorithm to provide a valuable reference to ripple detection technology.