The frequency characteristics of wavelets and the vanishing moments of wavelet filters are both important parameters of wavelets. Clarifying the relationship between the wavelet frequency characteristics and the vanishing moments of the wavelet filter can provide a theoretical basis for selecting the best wavelet. In this paper, the frequency characteristics of wavelets were analyzed by mathematical modeling, the mathematical relationship between wavelet frequency characteristics and vanishing moments was clarified, the optimal wavelet base function was selected hierarchically according to the amplitude frequency characteristics of ECG signal, and an accurate notch filter was realized according to the frequency characteristics of the noise. The experimental results showed that the optimal orthogonal wavelet analysis for the ECG signals with different frequency characteristics could make the high frequency energy distribution sparser, and the method proposed in this paper could effectively preserve the singularity of the signal and reduce the signal distortion.