Micromachined periodic surfaces for planar terahertz antennas