The measured signals of internal leakage detection of the large-diameter pipeline ball valve in natural gas pipeline systems usually contain background noise, which will affect the accuracy of internal leakage detection and sound localization of internal leakage points due to the interference of noise. Aiming at this problem, this paper proposes an NWTD-WP feature extraction algorithm by combining the wavelet packet (WP) algorithm and the improved two-parameter threshold quantization function. The results show that the WP algorithm has a good feature extraction effect on the valve leakage signal, and the improved threshold quantization function can avoid the defects of the traditional soft threshold function and hard threshold function, such as discontinuity and the pseudo-Gibbs phenomenon, when reconstructing the signal. The NWTD-WP algorithm is effective in extracting the features of the measured signals with low signal/noise ratio. The denoise effect is much better than that of the traditional soft and hard threshold quantization functions. It proved that the NWTD-WP algorithm can be used for studying the existing safety valve leakage vibration signals in the laboratory and the internal leakage signals of the scaled-down model of the large-diameter pipeline’s ball valve.