Harmonic analysis based on Fast Fourier Transform (FFT) is usually used for estimating harmonic distortion degree. However, the estimation precision is seriously affected by spectral leakage caused by non-synchronous sampling. To low the spectrum leakage effect and improve the estimation precision, a novel kind of the software frequency measurement and secondary sampling algorithm for approximately synchronous sampling is proposed. And the principle of the proposed algorithm is profoundly investigated. Furthermore, the algorithm error is comprehensively analyzed. The results of the simulation and the application show that the error of the distortion degree can be less than 1% by increasing signal sampling frequency, and the algorithm is feasible, efficient and effective to inhibit the spectrum leakage in harmonic analysis and ensure high accuracy in harmonic analysis and harmonic distortion degree measurement.