Investigation of Terahertz and Mid-Infrared Metamaterials