Detection and electrical characterization of hidden layers using time-domain analysis of terahertz reflections