We propose a simple signal reconstruction algorithm for terahertz time-domain spectroscopy in ambient atmosphere for application to time-of-flight thickness measurement. Time-of-flight measurement method is a very basic method of measuring thickness, but it has the advantage of being very fast. Therefore, it is often used for rapid measurement in industrial environment. The echo signal is buried in the spurious oscillations of the ambient atmosphere because of water vapor. We successfully found the echo signal and measured the thickness of the sample, silicon wafers and various type of explosive materials, without any prior information in humid air. (C) 2019 Elsevier Ltd. All rights reserved.