A terahertz spectrometer for the study of multilayered optics & complex materials