Measurement of coherent terahertz radiation for time-domain spectroscopy and imaging