The wavelet packet transform gives information in both the time and frequency domains, and it is very useful for describing nonstationary signals like seismograms. Moreover, this structure is dependent on the signal under study; hence we can choose the time-frequency decomposition more appropriate for every signal. In this article, we propose a new method for filtering based on the wavelet packet transform. This approach uses different parameters for filtering, depending on the band of frequencies that we are analyzing. This filtering is employed in order to achieve a high signal-to-noise ratio (SNR) and low distortion. We first apply the method to synthetic signals that we have contaminated with noise. In this way, the shape of the whole output signal and the onset time of the first pulse can be compared to the ideal signal. Finally, we apply it to short-period seismograms recorded at the local seismic network of the University of Alicante in southeastern Spain. The method proposed is compared with conventional passband filters and other methods based on wavelets. The comparison demonstrates that our method achieves a higher SNR without introducing noticeable distortion.