We study dynamics of antiferromagnets induced by simultaneous application of dc spin current and ac charge current, motivated by the requirement of all-electrically controlled devices in THz gap (0.1-30 THz). We show that ac electric current, via N\'eel spin orbit torques, can lock the phase of a steady rotating N\'eel vector whose precession is controlled by a dc spin current. In the phase-locking regime the frequency of the incoming ac signal coincides with the frequency of autooscillations which for typical antiferromagnets fall into the THz range. The frequency of autooscillations is proportional to the precession-induced tilting of the magnetic sublattices related to the so-called dynamical magnetization. We show how the incoming ac signal can be detected from the measurement of the dc-current dependencies of the constant dynamical magnetization. We formulate the conditions of phase-locking based on relations between parameters of an antiferromagnet and the characteristics of the incoming signal (frequency, amplitude, bandwidth, duration). We also show that the rotating N\'eel vector can generate ac electrical current via inverse N\'eel spin-orbit torque. Hence, antiferromagnets driven by dc spin current can be used as tunable detectors and emitters of narrow-band signals operating in the THz range.