By the rapid growth of new energy applications and power electronic equipments, more and more attention are paid to power system harmonic, so accurate and efficient mathod study of harmonic analysis has practical significance. Based on the good locality of the wavelet packet transform(WPT), WPT is widely applied in harmonic analysis. In this paper, we focus on the selection of wavelet function and confirmation of decomposition level. The simulation show the best wavelet function and decomposition level, and we can come to a conclusion that the harmonic analysis is best when using wavelet function db40 and decomposed in five level.