Investigation of terahertz technology and applications