The current signal harmonic detection method(s) cannot reduce the errors in the analysis and extraction of mixed harmonics in the power grid. This paper designs a harmonic detection method based on discrete Fourier transform (DFT) and discrete wavelet transform (DWT) using Bartlett–Hann window function. It improves the detection accuracy of the existing methods in the low frequency steady-state part. In addition, it also separates the steady harmonics from the attenuation harmonics of the high frequency part. Simulation results show that the proposed harmonic detection method improves the detection accuracy of the steady-state part by 1.5175% compared to the existing method. The average value of low frequency steady-state amplitude detection of the proposed method is about 95.3375%. At the same time, the individual harmonic components of the signal are accurately detected and recovered in the high frequency part, and separation of the steady-state harmonics and the attenuated harmonics is achieved. This method is beneficial to improve the ability of harmonic analysis in the power grid.