In the practical, harmonic analysis method is affected by the spectrum leakage problem and the occurrence of the picket fence and cause great errors. In order to reduce the calculation error of harmonic analysis method, to improve the precision of measurement, at the same time consider processor computing ability. This paper analyzes the reason of the error of harmonic analysis method and various factors affecting the calculation results. Put forward a suitable algorithm for high accuracy estimation to calculate the dielectric loss angle of harmonic analysis method. First the algorithm of FFT transform with Hanning window to signal, and then use the energy centrobaric method for correction. At the same time, use the dynamic window algorithm to modify dielectric loss angle further. The algorithm is dynamic adjustment the window length following the frequency fluctuation of power grid, so that the sampling is more close to the full period sampling. Through theoretical derivation and simulation calculation, comparing with other improved harmonic analysis method, proved that the accuracy of this method is further improved than before, and the amount of calculation is small, easy to engineering application.