Terahertz metamaterials: towards sensing and communications