With the increase of the wind turbine capacity, failures occur on the drivetrain of wind turbines frequently. Since faults of bearings in the wind turbine can lead to long downtime and even casualties, fault diagnosis of the drivetrain is very important to reduce the maintenance cost of the wind turbine and improve economic efficiency. However, the traditional diagnosis methods have difficulty in extracting the impulsive components from the vibration signal of the wind turbine because of heavy background noise and harmonic interference. In this paper, we propose a novel method based on data‐driven multiscale dictionary construction. Firstly, we achieve the useful atom through training the K‐means singular value decomposition (K‐SVD) model with a standard signal. Secondly, we deform the chosen atom into different shapes and construct the final dictionary. Thirdly, the constructed dictionary is used to sparsely represent the vibration signal, and orthogonal matching pursuit (OMP) is performed to extract the impulsive component. The proposed method is robust to harmonic interference and heavy background noise. Moreover, the effectiveness of the proposed method is validated by numerical simulation and two experimental cases including the bearing fault of the wind turbine generator in the field test. The overall results indicate that compared with traditional methods, the proposed method is able to extract the fault characteristics from the measured signals more efficiently.