Amplitude-modulated continuous-wave radar in the terahertz range using lock-in phase measurement

We present the principle and the experimental verification of a distance measurement method based on the propagation of terahertz waves. The method relies on modulating the amplitude of a resonant-tunneling-diode (RTD) oscillator used as terahertz-wave source and on measuring the phase of the detected wave by applying a quadrature mixing technique. The distance measurement is found to have a residual error as small as 0.063 mm (standard deviation), which is a record for an RTD-based terahertz-wave radar system. This is almost five times better than our previous record of 0.29 mm, when an oscilloscope was used for phase measurements; additionally, the quadrature mixing brings about numerous practical benefits, such as greatly reduced cost, size, weight, complexity, and power consumption.


Introduction
In the past two decades or so, terahertz radiationelectromagnetic waves with frequencies in the order of 1 THz (10 12 Hz)-has been used in a growing range of measurement applications, which are slowly but steadily solving an increasing number of real-world problems in security, safety, law enforcement, quality assessment, etc [1,2]. Like other regions of the electromagnetic spectrum, terahertz radiation has been used for its ability to sense the optical properties (reflection, absorption, refraction, etc) or the geometrical properties (position, size, shape, etc) of the bodies it is sent toward or propagates through. There are, however, particular advantages that place terahertz radiation in a privileged position: many optically opaque or diffusive media, such as textiles and Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI. plastics, are transparent in the terahertz range; other materials have specific spectral properties useful in identification; and the wavelength (about 0.3 mm at 1 THz) is short enough to perform imaging with a spatial resolution sufficient in many cases or to send relatively narrow beams over long distances without much loss through diffraction.
Among these applications, distance measurement (also called ranging) has received a growing interest. A radar based on terahertz waves could be used in so-called degraded visual environments, that is, through fog, dust, smoke, etc, where visible or infrared light may not be as helpful; in comparison to microwave and millimeter-wave radars, its smaller wavelength would allow a terahertz-wave radar to detect smaller targets, while the wider available frequency bands could lead to a better depth resolution.
There are several techniques allowing the axial distance measurement using terahertz waves; some are based on measuring the flight time of pulses (time-domain spectroscopy) [3], others on the principle of the frequency-modulated continuous-wave radar [4][5][6], or on interferometry [7].
In a recent report [8], we described a new terahertz-wave radar technique, based on the principle of the amplitudemodulated continuous-wave (AMCW) radar [9,10]. We verified it experimentally using a resonant-tunneling-diode (RTD) oscillator [11] as the terahertz-wave source, which matches this application well, as the RTD oscillation amplitude can be modulated by simply adding a signal to its bias voltage. In order to achieve absolute distance measurements over long distances, we used a two-frequency technique. Our AMCW radar turned out to be precise, allowing a distance measurement with a 0.29 mm standard deviation, which we believe to be a record for an RTD-based terahertz-wave radar.
In demonstrating the radar principle, at that time we used an oscilloscope to determine time delays caused by propagation. However, in an actual application, the use of a highperformance oscilloscope would be impractical for many reasons: size, weight, cost, power consumption, complexity. Additionally, we believed we could improve the distance measurement precision by replacing the oscilloscope with a phase measuring circuit. This report explains our approach and results.
Compared to our conference abstract [12] on this subject, the present report has been substantially expanded to include the underlying theory, a method of calibrating and correcting the measured signals, a more diverse collection of measurement results, and a more thorough discussion; additionally, it has been improved by illustrating that not just a relative distance to the target can be measured, but also its absolute value.

Experimental setup
The experimental setup is shown schematically in figure 1. For the sake of clarity, non-essential parts have been omitted.
The terahertz-wave source is an RTD oscillator fabricated in our lab, the same that we used for the experiments described in our previous report [8]. Terahertz radiation with a peak power of about 10 µW and a frequency of 522 GHz is emitted when the RTD is biased at around 0.60 V. In order to modulate the amplitude of the terahertz-wave output, the bias point is lowered to 0.56 V (the current is about 50 mA), where the power decreases to about half of the maximum, but varies relatively strongly with the bias voltage. At this point, an amplitude-modulated terahertz wave is easily obtained by just superimposing a sine wave over the bias voltage. As a side effect, at the same time, the carrier frequency becomes slightly modulated too, but this is not important in our particular measurement, as the carrier frequency is removed at detection.
Depending on the intended application, RTD oscillators with higher carrier frequencies (smaller wavelength, hence better lateral resolution) are also available, up to the current record of 1.98 THz [13]. Additionally, the ongoing research in our lab and elsewhere is expected to lead to RTD oscillators with increased output powers [14], which will undoubtedly be greatly beneficial for cases where the radar is used on targets that are far away, have reduced reflectivity, or are small in size.
The RTD oscillator is fitted to a hyperhemispherical silicon lens, which couples the terahertz beam to free space. The beam is then collimated using a plastic lens and sent toward the target.
Given the small power available from the RTD oscillator, we chose a gold-coated mirror to act as target for our distance measurements, so as to waste as little power as possible. The use of collimated beams with diameters of about 30 mm, much wider than the wavelength (0.57 mm), serves the same purpose.
The target mirror is placed on a motor-driven mechanical stage such that the distance to be measured by the radar can be adjusted precisely within a range of 200 mm, with a positioning error specified to less than 15 µm. The beam direction is parallel to the stage movement and perpendicular on the mirror, which provides a straightforward one-to-one relationship between the stage position and the distance to be measured.
The beam returning from the target is partially reflected by a beamsplitter made of a thin undoped silicon plate and is focused by a second plastic lens onto the detector. This optical arrangement has the drawback of a considerable loss of power at the beamsplitter-even in the ideal case only 25% of the emitted power reaches the detector-, but the advantage of a normal incidence on the target. The use of a circular polarization technique could greatly improve the efficiency, but would make for a more complex optical setup and we decided not to try it for now.
The detector is a Schottky-barrier diode (SBD, model WR1.9ZBD from Virginia Diodes, Inc.) with a frequency range matching our source. The sensitivity of the SBD was increased by applying an appropriate bias. Through detection, the carrier is removed and only the modulation signal remains. A low-noise amplifier is used to boost the weak output of the detector.
To achieve a good precision, our modulation frequencies need to be as high as possible, and we chose the range 1-10 GHz, with an upper limit imposed by this particular RTD oscillator, although our group reported RTD devices that can be modulated up to as much as 30 GHz [15].
Since commercial lock-in amplifiers are not, to our knowledge, available in this high-frequency range, we decided to build our own circuit from the following discrete parts: • A power amplifier brings the generated signal to the power level required by the mixers described below. • A hybrid coupler produces an in-phase copy and a quadrature (90 • out-of-phase) copy of the reference signal. • A power divider splits the detected signal into two identical copies. • Two double balanced mixers multiply the detected signal with each of the two components of the reference signal. To avoid additional frequency-dependent phase shifts caused by unbalanced propagation times, the two cables arriving at the LO inputs of the mixers are chosen to have the same length. The same precaution is taken for the two cables arriving at the RF inputs. • The mixers' output signals go each through a low-pass filter with a cutoff frequency in the order of 1.5-20 000 Hz to remove the modulation frequency and its harmonics along with most of the noise. • A data logger records the two signals. These are then transferred to a computer for processing. The low-pass filters mentioned above are implemented in the firmware of the data logger; this facilitates changing the cutoff frequency.

Measurement principle
In the previous stage of our research, time delays caused by propagation were measured on an oscilloscope: a reference signal coming directly from the signal generator was used as trigger, and the delay of the detected signal was measured by timing its zero-crossing points in relation to the reference. As a consequence, the ranging precision was limited by the oscilloscope's ability to measure time; for our particular model, when 1024 waveforms were averaged, the time measurement error was in the order of 1 ps. In these circumstances, the error of measuring the distance to the target was found to be 0.29 mm (standard deviation). However, the phase measurement using an oscilloscope is very inefficient, as most of the signal remains unused: from the whole signal, only the small part around the zero crossing is used, and in fact some of the zero crossings are lost too when more of them are present in the displayed waveform.
The central idea of this paper is that more precise measurements can be performed by using a lock-in phase measurement circuit such as that highlighted by the dashed rectangle in figure 1.
The lock-in phase measurement technique consists in generating two quadrature copies of the reference signal and multiplying each of them with the detected signal. The two outputs are then low-pass filtered to remove the modulation frequency and its harmonics along with any high-frequency noise. Since one of the outputs represents the cosine component of the detected signal and the other its sine component, the two can be processed to calculate the phase and the amplitude of the detected signal. The phase accounts for the distance to the target, while the amplitude contains information about the target reflectivity.
The relevant signals in the circuit are as follows. First, at the output of the signal generator, the signal can be described as a voltage varying sinusoidally with time: where f is the frequency (it will become the modulation frequency for the terahertz wave) and A SG is the signal amplitude. This signal is then divided into two arms: reference and measurement. In the reference arm, the signal is split again by the hybrid coupler, which introduces a 90 • phase shift in one of its outputs relative to the other. The two signals arriving at the LO inputs of the mixers are as follows: where the subscripts c and s represent the in-phase (cosine) and quadrature (sine) variables, respectively, t ref is the propagation time from the signal generator to the each of the LO inputs, and A LO is the amplitude at the LO inputs. The detected signals arriving at the RF inputs of the mixers are identical to each other: where t meas is the propagation time from the signal generator, on the measurement arm, to the each of the RF inputs. The amplitude A RF contains all the gains and losses the signal undergoes along the measurement arm: modulation efficiency in the RTD oscillator, optical losses in the propagation of the terahertz wave (lenses, target, beamsplitter, air, diffraction, etc), sensitivity of the detector, gain in the low-noise amplifier, loss in the dividers, etc. Each mixer produces an IF output signal that is, in principle, the product of the incoming LO and RF signals. Other components are also generated, but in the simple case of a homodyne mixing we can safely ignore them. The two IF signals are, therefore where k is measured in units of V -1 and accounts for the mixers' conversion gain. The products of trigonometric functions above can be transformed into sums: In each of the two formulas above, the first term of the sum is the DC term, and the second has a 2f frequency. The mixers' outputs will likely also contain components at the modulation frequency f and its harmonics, caused by nonlinearities in the RTD source and the SBD detector as well as imbalances in the mixers, but all of these are removed by the low-pass filter, which has a cutoff frequency much below f. Only the DC terms remain after the low-pass filter: The result is that the two signals are proportional to the cosine and sine of the propagation time difference between the measurement arm and the reference arm. This is what allows us to determine the distance to the target. Additionally, the A RF factor in the coefficients includes information about the target reflectivity.
From equations (9) and (10), the propagation time difference can be calculated using the two-argument arctangent function: where n is an initially unknown integer number representing how many oscillation periods are comprised in the propagation time difference. Also note that the convention is to order the arguments of the atan2 function with the sine before the cosine. The atan2 output takes values from −π to π. Determining the absolute distance to the target requires determining the integer number n, which is impossible if only one modulation frequency is used. The radar would only be able to measure the absolute distance to the target within a half of the wavelength corresponding to the modulation frequency; for instance, at a modulation frequency of 5 GHz the measurement range would be as short as 30 mm. To remove this limitation, we reported in [8] a method by which using two modulation frequencies we can, with certain precautions, determine the number n and thus measure the absolute distance over arbitrarily long ranges, while at the same time maintaining the precision of a one-frequency measurement.

Calibration and correction
The calculation given in the previous section is only valid for ideal hybrid coupler, mixers, and divider, and for perfectly balanced cable lengths. In practice, the two signals obtained at the filters' outputs do not have the same amplitude, their voltages include offsets, and their relative phase is not exactly 90 degrees. The two voltages given by equations (9) and (10), if represented in Cartesian coordinates, should describe a circle centered in the origin (0,0) when the propagation time t meas is varied; instead, the measured voltages describe a tilted ellipse whose center is offset, as illustrated by the simulation in figure 2.
As a consequence, if no correction is performed, we found out that in our case (where significant voltage offsets were present) the phase is affected by very large errors, in the order of π, which is totally unacceptable, as it would mean a distance measurement error as large as a quarter of the wavelength of the modulation frequency (15 mm for 5 GHz).
This section discusses two procedures: one for measuring the systematic errors that occur (called calibration), and one for removing those errors from the measured signals (called correction).

Calibration
In the calibration procedure, the signal arriving from the SBD is replaced with a test signal having the same frequency and power level, obtained from a second signal generator that is synchronized with the first. The phase of the test signal is scanned over a full 360 • cycle in equal steps (we used 10 • steps, 36 in all) and for each phase the output voltages V I and V Q are recorded. The calibration parameters are extracted from the measured voltage sets.
In theory, the two data sets have values as given by the following equations: where φ i = 2πi/m are the m phase values equidistantly distributed over a 2π interval, with index i going from 0 to m − 1.
For the calculation below, the number of steps m must to be at least 3, but we took a larger number of measurements to check for possible nonlinearities. The parameters that need to be determined are the voltage offsets V I, DC and V Q, DC , the signal amplitudes A I and A Q , and the phase shifts Φ I and Φ Q . The absolute values of Φ I and Φ Q are less important, since they also depend on the length of the cable used to connect the second signal generator, but their difference (which should not be far from 90 • ) will be needed to correct the radar measurements. First, the voltage offset of each signal is calculated as an average of the recorded voltages in the respective data set, because the sum of cosines or sines of the equidistantly spaced angles is zero if m ⩾ 2: Then the amplitude and phase of each voltage set is calculated by multiplying each set with cosine and sine value sets having the same period, and by summing the results. In effect this means calculating a discrete Fourier transform of the data at the particular frequency 1, corresponding to one period per one phase cycle; this is itself a sort of lock-in signal processing. For the in-phase set, the following quantities are calculated: Plugging equation (12) into equation (16) gives The DC term is multiplied with a cosine with equally distributed positive and negative values, so it disappears after summation. The remaining product of cosines can be transformed into a sum, leading to The second term also has symmetric positive and negative values and becomes zero after summation if m ⩾ 3, leaving only the first term; similarly for S I : From C I and S I , we can calculate the amplitude A I and the phase shift Φ I using again the two-argument arctangent: The same calculation can be performed for the data set of the quadrature signal, with analogous results: Finally, the phase shift that will be used for correcting the radar measurements is After finding the calibration parameters-voltage offsets V I, DC and V Q, DC , signal amplitudes A I and A Q , and phase shift difference Φ-, the second signal generator is removed and the SBD signal is connected back to the mixers. The radar is now ready for corrected distance measurements.

Correction
The measured voltages are corrected by removing the voltage offsets and adjusting the amplitudes; to compensate for the phase shift error, the voltage of the quadrature signal is combined with that of the in-phase signal. The equations for this correction are detailed below.
The measured voltages can be written as follows: where φ is the phase that needs to be measured as it carries the information on the distance to the target, and R is a coefficient proportional to the target reflectivity. From equation (27) we can calculate this quantity: Similarly, the following quantity can be calculated from equation (28): If Φ had the ideal value of π/2, this would be R sin (φ) and then extracting the phase φ would be straightforward, but in the general case sin (φ) needs to be calculated as a weighted sum of cos (φ) and cos (φ − Φ). To determine the weights, we can rewrite cos (φ − Φ) as a sum of products: From here, sin (φ) can be extracted: In this weighted sum, since Φ is normally close to π/2, the weight of cos (φ − Φ) is close to 1, and the weight of cos (φ) is close to 0, which means that cos (φ − Φ) is the main contributing value, whereas cos (φ) is only a correction.
The final formula for R sin (φ) becomes Both R cos (φ) and R sin (φ) are thus determined from the measured voltages V I and V Q and from the five calibration parameters V I, DC , A I , V Q, DC , A Q , and Φ. The value of R is then the square root of the sum of two squares and the value of the phase φ is calculated using again the two-argument arctangent: where n is the same integer number as in equation (11).

Experimental verification
To verify experimentally the measurement principle of our radar, we built the optical and electronic setup, calibrated the system as explained above, and then measured the signals. Finally, we corrected them using the calibration parameters. Figure 3 shows such a distance measurement result. For this measurement, the target was moved along the optical axis in 10 mm steps using the motor stage controlled by the computer and the distance at each position was measured from the two output voltages. In this particular case the low-pass filter had a cutoff frequency of 500 Hz and the modulation frequency was 5 GHz. We chose the rather large 10 mm increments because at the time the measurements were not fully automated and some operations were done manually. Table 1 summarizes the measurement parameters.
In the top part of figure 3, the calculated absolute distance is plotted against the relative position of the motor stage. The calculated distance was fitted to a linear function of the stage position, with a slope fixed to 1. As the difference between the measured points and the fitted line is too small to see on this graph, we show at the bottom of the figure a graph of the fitting errors. The results obtained by using the oscilloscope and reported in [8] were added for reference, to show the significant advantage of switching to a lock-in phase measurement technique.
The standard deviation of the fitting error turns out to be 0.063 mm, which is the precision (error of the repeatability) that we claim for this radar in its current form. The intercept is found to be 1803.369 mm, which illustrates the ability of this radar to measure absolute distances; the intercept represents the propagation time difference (converted into distance to the target in air) between the measurement and the reference arms, when the motor stage is placed at position 0. In our conference abstract [12] the vertical axis only showed relative distance measurements, here we used the phases measured at a second modulation frequency, of 5.5 GHz, and the method described in [8] to determine the absolute distance.
As seen in the lower graph of figure 3, the error has a noticeable upward slope, meaning that the radar measures slightly larger distance steps than expected. The refractive index of the air (1.0003) was taken into account when converting propagation times to distances, so this is not the reason for the slope.  The frequency of the signal generator and the speed of light can also be ruled out as causes. As such, this slope may be caused by the motorized stage, whose leadscrew might have a pitch that is slightly larger than its nominal value so the actual displacement from end to end is a little larger than 200 mm (by about 0.1 mm); also, the slide guide might have an upward curvature, which would make the mirror move over a longer distance than the sliding base; a combination of these factors may also be at work. If the slope of the fitting linear function is allowed to vary together with the intercept, its value settles at 1.0007, and the standard deviation of the error drops from 0.063 to 0.045 mm, which might have been the actual performance of this radar if a more precise stage had been used. The measurement error of 0.063 mm cannot be claimed as the accuracy (error of the absolute value), since we cannot physically measure the actual propagation distance to verify; much of the propagation takes place in cables and electronic components, where the lengths and propagation speeds cannot be easily measured. Additionally, we know that in our calibration we lost information about the absolute phase in the order of π, caused by only using the difference between the two phase shifts.
However, in an actual application, since the lengths of cables inside the radar are not normally of interest to the user, the radar can be made to measure distances from an arbitrary reference plane of the user's choosing. For that purpose, one distance measurement to a mirror placed at the reference plane will provide a calibration value that can then be subtracted from all future measurements.
The data shown in figure 3 was selected from a series of experiments, presented in figure 4, in which we changed two parameters: the low-pass filter cutoff frequency, with the values 1.5, 5, 50, 500, 1000, and 20 000 Hz, and the modulation frequency, given the values 4, 4.5, 5, 5.5, and 6 GHz. For each pair of parameters, the stage was moved in the same 10 mm increments and the distance was measured with the radar; the measured distances were fit with a line of slope 1 and the standard deviation of the fitting errors was taken as the ranging error for that particular set of parameters.
The general trend seen in figure 4 is that the ranging precision improves as the modulation frequency increases from 4 to 5 GHz, and then deteriorates again from 5 to 6 GHz. This can be explained by two opposite effects. First, when the modulation frequency is low, the corresponding wavelength is long, and small fluctuations in the measured phase, caused by noise in measuring the two voltages, translate in larger errors in distance. Second, when the modulation frequency is high, the RTD behaves somewhat like an RLC low-pass circuit and the modulation amplitude of the emitted terahertz wave decreases, which degrades the signal-to-noise ratio at the detector and leads to an increase of the phase error, hence a larger ranging error. It appears that for our setup the optimum balance of these two effects occurs around 5 GHz, where we obtained the smallest ranging error. On the other hand, the dependence on the cutoff frequency of the low pass-filter is harder to explain theoretically. At present we still do not know why at 4 GHz modulation the ranging error is large when the low-pass cutoff is set at 1.5 Hz, or why the errors for 5.5 and 6 GHz are flat, in particular at the 20 000 Hz cutoff frequency. A more systematic investigation will be necessary.

Conclusions
The 0.063 mm measurement error should be compared with the error found when we were using an oscilloscope to measure time delays, which was 0.29 mm. This almost five-fold improvement in precision must be attributed to using the detected signal in its entirety by integrating the mixers' outputs through low-pass filtering, instead of just picking a few zerocrossing points in the waveforms. This change in the signal processing leads to a significantly better signal-to-noise ratio.
We believe we can reduce errors even further by improving the calibration procedure, increasing the available power or reducing the noise, and adjusting the measurement parameters. To that end, experimental trials as well as theoretical analysis will be necessary.
In addition to reducing the measurement error, the lockin method also has a series of practical advantages, such as that of a significantly smaller cost, since the circuit components-hybrid coupler, mixers, power divider, low-pass filters, low-frequency analog-to-digital converters-are much less expensive than a high-frequency oscilloscope. Moreover, they are much more compact and robust, and have much smaller power requirements, which is crucial in real-world applications, such as in vehicle anti-collision radars, security checkpoints, or product inspection. The oscilloscope we used weighs 20 kg, is about 0.5 × 0.4 × 0.3 m in size for a volume of about 60 l, and consumes about 800 W of power, whereas the corresponding figures for the lock-in phase measurement circuit are two to three orders of magnitude smaller. The costs are in a similar ratio, about 100 to 1. This comparison may not be completely fair, but it certainly is suggestive.
Except for the RTD source and the SBD detector, our ranging method only requires readily available parts; SBD detectors have been commercially available for over a decade now, whereas RTD sources are expected to enter the terahertz marketplace very soon. Given this trend, we believe our radar technique has the potential of finding practical applications.
In addition to providing information about the phase, the measured voltages also contain information about the target reflectivity. We expect this to be useful in 3D imaging and we have already started investigating the possibility of 3D terahertz imaging based on a scanning 2D imaging setup combined with the AMCW radar for the depth dimension.
Unfortunately, this radar can only measure the distance up to a single reflecting surface. For applications such as body scanners, the ability to measure distances to several reflection layers is important. In another research direction, we succeeded in building a frequency-modulated continuous-wave (FMCW) radar based also on an RTD oscillator terahertz-wave source, which can measure multiple distances simultaneously; however, its error is in the millimeter order and its resolution is in the centimeter order [16]. In yet another research theme, we are now seeing the first results in applying the source-swept optical coherence tomography (SS-OCT) principle to an RTDbased terahertz-wave radar, where the modulation frequency is changed step-wise and the multilayer depth information is extracted by Fourier transforming an array of signals obtained by homodyne mixing.