Electrocardiogram signal (ECG) can directly reflect the health status of the heart, and is an important basis for prevention and treatment of heart disease. In order to realize ECG signal classification effectively, an ECG signal classification method based on discrete wavelet transform and Xgboost is proposed in this paper, which improves the accuracy of ECG signal classification. Specifically, we first divide, select and downsample the heart beat of the data, and then use the discrete wavelet transform to reduce the noise of the data set to improve the signal to noise ratio. Finally, we use Xgboost algorithm as the classifier to classify the data, and get 98.7% accuracy rate on the test set. In each module, we carried out comparative experiments to verify the correctness and rigor of our method. In addition, in order to make up for the lack of interpretability of traditional machine learning methods, we defined the importance of each feature according to the information gain generated by different features to the model during the training of XGBoost, and then got the key bands that should be paid attention to when distinguishing heart beats, which improved the interpretability of the model. It also provides a scientific basis for the classification of ECG signals and practical medical work.