GaAs/AlGaAs field-effect transistor for tunable terahertz detection and spectroscopy with built-in signal modulation