The invention relates to microwave, millimeter wave and submillimeter wave spectroscopy systems and components and in particular to a method and apparatus for controlling the phase shift of the optical signal in a homodyne or heterodyne transceiver useful for terahertz spectroscopy.