As a kind of clean and renewable energy, wind energy is attracting more and more attention from all over the world. But the development of wind power is always hindered by the failure of downtime. The gearbox of wind power unit is one of the components with the highest failure rate in the whole wind turbine. Therefore, it is of great significance to study the fault diagnosis of gearbox in wind turbine. This paper first introduces the mathematical principle of wavelet analysis, and takes Matlab as an experimental platform to analyze and deal with the pitting fault data of a fan gearbox, and identifies the fault frequency by wavelet packet energy method, and diagnoses the type of failure. Finally, the experimental results are compared with other methods to deal with the data. Through the research in this paper, we can see that the data processing method based on wavelet analysis is simple and practical, especially in the engineering field represented by gearbox fault diagnosis.