I. Introduction
Due to the emergence of a large number of power electronic devices and the use of nonlinear loads, the harmonic pollution in the power system is becoming more and more serious. In order to solve various challenges and to ensure that renewable energy can be used stably in the grid through microgrids and smart grids [1]–[2], the adverse effects of harmonic pollution must be avoided. So far, a variety of harmonic detection methods have been proposed and applied to Active Power Filter (APF) to achieve the purpose of suppressing and compensating harmonics. To date, the commonly used harmonic detection methods include detection methods based on Fourier transform [3], detection methods based on instantaneous reactive power theory [4]–[5], detection methods based on neural networks, etc. For example, literature [6] uses the Prony algorithm combined with the improved Adaline model for harmonic detection and analysis, but this algorithm is more complicated to implement.