In this paper, we derive an approximate equation combining the quality factor Q, the travel time of a wave, and the variation of the instantaneous frequency (IF) at the envelope peaks of two successive seismic wavelets, along the wave-propagating direction, based on the theory of one-way wave propagation in a 1D viscoelastic medium. We then propose a method (called the WEPIF method) to estimate Q by measuring the variations of the wavelet envelope peak IF (WEPIF) with the travel time of seismic wavelet. For zero-offset VSP data and poststack seismic data, we describe how to implement the WEPIF method in detail. A test on synthetic VSP data shows that the WEPIF method is less sensitive to interference from the reflector than the logarithm spectral ratio and the centroid frequency shift methods. Applied to field VSP data, the WEPIF method gives a Q-curve with nearly the same distribution as the results from a known well. Applied to poststack seismic data, it produces a Q-profile that indicates an intense absorption zone corresponding to the excellent gas-bearing reservoir. This allows us to predict a potential high-productivity gas well. Drilling confirmed this prediction. The WEPIF method can be applied to poststack seismic data and zero-offset VSP data.