Ex) Article Title, Author, Keywords
Current Optics
and Photonics
Ex) Article Title, Author, Keywords
Curr. Opt. Photon. 2023; 7(6): 683-691
Published online December 25, 2023 https://doi.org/10.3807/COPP.2023.7.6.683
Copyright © Optical Society of Korea.
Corresponding author: *kyoungjs@dankook.ac.kr, ORCID 0000-0001-6736-9118
This is an Open Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License (http://creativecommons.org/licenses/by-nc/4.0/) which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.
A typical terahertz time-domain spectroscopy system requires large, expensive, and heavy hardware such as a lock-in amplifier and a function generator. In this study, we replaced the lock-in amplifier and the function generator with a single sound card built into a typical desktop computer to significantly reduce the system size, weight, and cost. The sound card serves two purposes: 1 kHz chopping signal generation and raw data acquisition. A unique software lock-in (Python coding program to eliminate noise from raw data) method was developed and successfully extracted THz time-domain signals with a signal-to-noise ratio of ~40,000 (the intensity ratio between the peak and average noise levels). The built-in sound card with the software lock-in method exhibited sufficiently good performance compared with the hardware-based method.
Keywords: Data acquisition, Software lock-in amplifier, Soundcard, Terahertz time-domain spectroscopy
OCIS codes: (070.0070) Fourier optics and signal processing; (120.4820) Optical systems; (140.0140) Lasers and laser optics; (300.0300) Spectroscopy; (300.6495) Spectroscopy, terahertz
Over the past few decades, terahertz time-domain spectroscopy (THz-TDS) has become a valuable tool in various research fields such as material characterization [1–4], chemical detection [5–8], medical imaging [9–11], and nondestructive screening [12–14] owing to its unique characteristics. First, THz-TDS provides broadband spectral information (0.1–10 THz) in a single measurement. Another important advantage of THz-TDS compared with continuous wave THz measurements is that the measured THz spectrum has both amplitude and phase at each frequency. Therefore, a complex refractive index can be directly extracted without using the Kramers-Kronig relation [15, 16].
A typical THz-TDS system uses a pair of photoconductive antennas (PCAs) with a femtosecond laser [17]. The femtosecond laser beam is divided into two parts: Pump and probe. When an emitter PCA with a moderate bias voltage (1–20 V) is illuminated by the pump beam, photo-excited electrons are accelerated and a single cycle THz wave is generated. THz measurements by a detector PCA are similar to the reverse generation process, but do not require a bias voltage. The photo-excited electrons illuminated by the probe beam are accelerated by the incident THz wave, and small currents are produced across the electrodes on the detector PCA.
The electric field of the THz wave at the detector is typically approximately 10–100 V/cm. Currents are measured in picoamps to nanoamps [18]. Measuring such tiny currents is challenging in general under the thermal noise voltage. Therefore, a hardware lock-in amplifier (LIA) is extensively used to detect weak signals in noisy environments. In addition, a function generator or an optical chopper is required to modulate such signals for lock-in detection. In the past few decades, the field of femtosecond lasers has made significant progress, allowing tabletop fiber lasers to replace bulky Ti:sapphire lasers for THz-TDS. As a result, THz-TDS systems are smaller in size than in the past. However, the hardware LIA and the accompanying modulation system prevent further reduction in the size and cost of THz-TDS systems. In this study, by developing a simple software algorithm and using a built-in sound card as both a function generator and a data-acquisition device, respectively, we reduced the size, weight, and cost of THz-TDS systems significantly. In the following section, we first explain our software LIA and then show how to construct a THz-TDS system with our built-in sound card.
Lock-in detection also known as phase-sensitive detection uses a specific reference frequency to single out the component of a signal [19, 20]. Environmental noise signals at frequencies other than the reference frequency are rejected. Specifically, the configuration of a THz-TDS system with a function generator and a hardware LIA is schematically displayed in Fig. 1(a). When the bias voltage across the emitter PCA given by a function generator is a square pulse with an angular frequency ωr, the THz signal at the detector might be modulated with the same frequency. The modulated bias voltage is the reference signal of the system. Mathematically, the modulated THz signal at the detector can be written as follows:
where Vs denotes the THz signal amplitude, and θs denotes the additional phase difference between the emitter bias and the detector signal. The actual signal from the detector PCA contains background noise [Vn(t)] that changes randomly independent of the reference. Therefore, the total signal from the detector is defined as follows:
The hardware LIA receives reference information from the function generator and generates its own reference sine wave, as follows:
where VL and θL denote the lock-in reference amplitude and the phase constant, respectively. The hardware LIA amplifies the input noisy signal from the detector PCA [Eq. (2)] and multiplies it by the lock-in reference [Eq. (3)]. The result is
From the trigonometric identity, the second term of Eq. (4) can be expressed as a sum instead of a product.
As shown in the equation, the first two terms are AC signals that vary rapidly (typically 1–10 kHz), whereas the last term is a DC signal that does not change with time. Then, the hardware LIA passes the multiplied signal through a low pass filter, leaving only the DC signal. Finally, the locked and amplified signal becomes
which is directly proportional to the THz signal amplitude (Vs) that we want. The time constant of the hardware LIA determines how low frequencies are allowed to pass, whereas the sensitivity determines the amplification level of raw detector signals.
We measured the THz-TDS signal in the usual way using a function generator (AFG3000; Tektronix, OR, USA) and a hardware LIA (SR830; Stanford Research Systems Inc., CA, USA). The pairs of PCA (PCA-40-05-10-800, BATOP GmbH, Jena, Germany) were used for the emitter and detector. A 10 V, 1 kHz square pulse bias was applied to the emitter. The excitation laser (center wavelength: 780 nm) had 10 mW power with a 100 MHz repetition rate for both the emitter and detector. The LIA obtained the reference information from the function generator, and the detector PCA was directly connected to the signal input part of the LIA. The time constant and sensitivity were set to 10 ms and 1,000 uV, respectively. Time domain data were measured in a total of 20 ps time windows at 0.05 ps intervals. The measured THz-TDS signal is displayed in the top panel of the Fig. 2(a). As shown in the Fig. 2, a typical nice terahertz pulse had been measured using a conventional method.
In this study, we have developed two software lock-in detection methods: One is to simply emulate a hardware LIA in software (method 1), and the other is a novel unique method (method 2), which does not require a low-pass filter. To realize the lock-in detection by the software, raw data of the reference signal (bias voltage pulse) and detector signal (small THz signal with large noise) are necessary. To this end, the THz-TDS setup was changed as shown in Fig. 1(b). The hardware LIA was removed, and the conventional oscilloscope (Lecroy waverunner LT342) was employed as the data acquisition device. Our oscilloscope has two input channels: One channel is used to acquire the reference signal from the function generator, and the other channel is used to obtain raw detector signals. As the raw THz signal was extremely weak, a small and cheap voltage amplifier was used between the detector and oscilloscope [Fig. 1(b); The diameter of the coin is 21.60 mm). The voltage amplifier is made by YUFO Electronics Limited [21]. The gathered raw data were sent to a desktop computer through local area network cards.
The amplified raw detector signals [modulated THz signals with noise corresponding to Eq. (2)] collected for 10 ms at each delay line are drawn as a two-dimensional (2D) image in Fig. 3(a). The jet colormap was selected to depict the image so that the reddish and blueish areas represent positive and negative values, respectively. The signal is feeble in most areas except around 13 ps of the delay line where the positive and negative time domain peaks are located (Fig. 2). In our setup, the positive time domain peak was observed at 13.15 ps, whereas the negative peak was located at 13.55 ps. Therefore, the polarity changed from positive to negative as the delay line changed by 0.4 ps. Such an opposite polarity was directly observed in the 2D raw detector signals. As the delay line passed from 13 to 14 ps, the colormap changed its color from red to blue or vice versa, meaning that the polarity was reversed along the delay line. The reference bias voltage and the amplified raw detector signals as a function of time are displayed in Fig. 3(b). The chopping frequency was 1 kHz; Thus, the total five numbers of the square pulse appeared within 5 ms [upper panel in Fig. 3(b)]. Although the peak-to-peak voltage (Vpp) of the reference bias voltage recorded through the oscilloscope was approximately 3.2 V, the Vpp of the actual voltage across the emitter was 10 V. When performing Lock-in detection, only the frequency and shape of the signal are important, not its absolute amplitude. Therefore, we used a reference signal for data analysis. The raw detector signals at 13.15 and 13.55 ps within the same 5 ms are shown in the lower panel of Fig. 3(b). The opposite polarity discussed above was observed: The signal at the 13.15 ps delay line [red line in the lower panel of Fig. 3(b)] was in-phase with the reference bias voltage, whereas it was out-of-phase at the 13.55 ps delay line [blue line in the lower panel of Fig. 3(b)].
To mimic the hardware LIA, a lock-in reference signal [Eq. (3)] in the form of a sine function is necessary. The black line in Fig. 4(a) indicates the raw reference chopping signal from the function generator, which timely syncs with the emitter bias voltage (1 kHz square pulse). To create the lock-in reference from the chopping reference, the fast Fourier transform (FFT) was performed. The absolute amplitude of the FFT is shown in Fig. 4(b). Because the chopping reference had a square shape, infinitely many frequency components were required. However, as expected, the maximum amplitude was observed at a 1 kHz frequency. In addition, the phase information at the 1 kHz frequency was obtained by FFT. Based on the FFT results, we successfully constructed the lock-in reference [Eq. (3), a 1 kHz sine wave matched the chopping reference], as indicated by the red dotted line in Fig. 4(a). The next step is to multiply the lock-in reference [red dotted line in Fig. 4(a)] with the raw noisy time-dependent signals [Fig. 3(a)] to obtain Eq. (4) or (5). This process has been performed at each delay line to extract the full time-domain signal. The multiplication between the lock-in reference and the raw data at the delay line 13.15 ps [red line in the lower panel of Fig. 3(b)] is depicted as an example in Fig. 4(c).
The last step is to pass the multiplication data through the low-pass filter implemented by the software. The performance of the low-pass filter for a hardware LIA is typically modulated by setting the time constant. As the time constant increases, the cutoff frequency becomes lower, meaning that the noise signal can be mostly eliminated. However, the processing time can increase significantly. Therefore, an optimal time constant must be found through trial and error. Our software low pass filter was realized using the Butterworth filter in the Python SciPy module [22]. In addition to the time constant, the software Butterworth filter requires the optimal setting of the filter order. After many trial and error processes, we found the optimal values of 2 for the filter order and 200 ms for the time constant in our system. The multiplication data in Fig. 4(c) (at the 13.15 ps delay stage) was passed through our software low-pass filter, and the results are illustrated in Fig. 4(d). The terahertz wave signal extracted from the noise was the last value of the filtered data [Eq. (6)]. After gathering the filtered signal at each delay line, we finally obtained the full-scale time-domain signal, as shown in the middle panel of Fig. 2 (blue line). Compared with the hardware lock-in result (upper panel in Fig. 2), our software lock-in works very well.
Although the previous method of software lock-in detection is accomplished by mimicking the hardware LIA, there are several drawbacks. First, it requires the optimal values of filter order and time constant to construct a software-based low-pass filter. Finding the optimal value is a time-consuming task due to the raster scanning process. In addition, because the optimal values may vary depending on the experimental condition, they must be newly found each time the system is changed. Second, in the entire algorithm, the time spent performing the FFT (to generate the sine form of the lock-in reference) and running the low-pass filter consumes a significant portion, slowing down the running speed of the program. Therefore, we propose a novel software lock detection method that requires neither the FFT nor a low-pass filter.
Our method uses the chopping reference directly as a lock-in reference without FFT. Instead, the chopping reference was normalized and shifted so that the minimum and maximum voltages are −1 and 1 V, respectively, and the average value is zero. The lock-in reference for method 2 is depicted in Fig. 5(a), as indicated by the red dotted line. The black line in Fig. 5(a) represents the chopping reference, which is the same data displayed in the black line in Fig. 4(a). Unlike the hardware lock-in system, the new lock-in reference contains the fundamental and the higher-order sine functions [Fig. 4(b)]. Specifically, it is as follows:
These higher-order components, however, did not affect the final result because the lock-in detection only singled out the fundamental component as we will see in the next paragraph. Because the FFT process has not been used, the running time of the analysis program is significantly reduced.
The next step is multiplying the lock-in reference with the raw detector signal at each delay line. Mathematically, this multiplication can be expressed as follows:
The Fig. 5(b) shows the multiplication between the new lock-in reference and the raw detector signal at 13.15 ps delay line as an example. Due to the higher order components of the lock-in reference, the resulting multiplication data [Fig. 5(b)] differ significantly from the previous one [Fig. 4(c)]. Equation (8) can be alternatively expressed using the trigonometric identity:
By comparing Eqs. (5) and (9), the DC component we want to pick up is not changed at all although the lock-in reference contains the higher-order sine functions.
The final step is to extract only the DC component from Eq. (9) or the data displayed in Fig. 5(b). As discussed previously, the reason for using a low-pass filter in hardware lock-in is to leave only the DC component in Eq. (5). The DC component can also be extracted by simply averaging the multiplication signals [Eq. (5) or Eq. (9)] instead of passing them though the low-pass filter because all AC components may become zero after averaging, whereas the DC component would add up. The averaging process of the time-dependent signal in hardware is more difficult to implement than a low-pass filter. Therefore, the hardware LIA typically uses a low-pass filter rather than time averaging. In contrast, software-wise, averaging is significantly easier to implement than a low-pass filter because parameters such as filter order or time constant are not required for averaging. The averaged multiplication data at the 13.15 ps delay line in Fig. 5(b) were approximately 0.15 (marked with a black dotted line). Such a multiplication and averaging process was performed at every delay line, and the gathered data are displayed in the lower panel in Fig. 2 (green line). Our new lock-in detection method extracts THz-TDS signals from noise very well at a faster speed than the previous method. As neither the filter order nor the time constant is necessary, there is no need for their optimization process. Therefore, our new lock-in technique can be used universally even if the detection environment is different.
Although we successfully demonstrated the software-based lock-in detection in the previous chapter, we still use expensive and bulky hardware, including a function generator and an oscilloscope. In this chapter, we demonstrate that how a built-in sound card can replace both pieces of hardware.
In our experiments, the function generator plays two roles: one is to apply a 0–10 V periodic square pulse voltage to the emitter, and the other is to deliver a reference signal to the lock-in system. Our goal is to implement a function generator using a line-out port (an earphone port) of a sound card. The model number of the main board used for this experiment was Samsung DB400T6A-B0K/R (Samsung, Suwon, Korea), where the sound card (Realtek HD Audio ALC662) was built-in. Although the analog line-out port has only a single hole at the main board, there are two channels because of the stereo sound system. Therefore, we can use one of them as the emitter bias and the other for the reference signal of the software lock-in detection. To generate the 1 kHz periodic square pulse, we played the video (1 kHz square wave with sampling rate 96 kHz) [23]. Because of the voltage limitations of the sound card, the output voltage range was limited to between −0.4 to 0.4 V, which was sufficient for the lock-in reference signal but insufficient for the emitter bias. To enhance the bias voltage, the voltage amplifier [inset picture in Fig. 1(b)] was adopted as depicted in Fig. 1(c). The raw (1 kHz square pulse played) data and their amplification are depicted in Fig. 6 (blue line: raw data, red line: amplified data). Although the noise is higher than that of commercial function generators, the built-in sound card can sufficiently produce the desired signal. As described in the next paragraph, lock-in detection works well even with such high-bias noise.
The MIC (microphone) port (line-in port) in the built-in sound card was used for data acquisition. As is the line out port, the MIC port has two channels. One channel is directly connected to a line out channel to record the lock-in reference signal, and the other channel is connected to the detector for raw detector acquisition. As before, the voltage amplifier was inserted between the detector and the sound card to enhance small detector signals. Figure 7(a) shows the measured lock-in reference from the line out channel (blue line) and the raw detector signal at the zero-delay position between the THz wave and the optical probe beam (red line). The detector signal is modulated according to the reference signal. Likewise, at every delay line, we recorded the lock-in reference and the raw detector signal. To complete the lock-in detection, the software lock-in method 2 was used and the final THz time domain signal is shown in Fig. 7(b). The same THz signal was also measured with a conventional hardware LIA and the function generator as well [Fig. 7(c)]. Comparing Figs. 7(b) and 7(c), the built-in sound card and software lock-in detection work very well without any expensive and bulky commercial hardware.
THz-TDS is a unique tool compared with other spectroscopy systems because both amplitude and phase information can be measured simultaneously. A conventional THz-TDS system requires a function generator and hardware LIA for small signal detection. Although successful, such expensive and bulky hardware has prevented THz-TDS from being used outside the laboratory. In this study, we have developed a novel software lock-in detection method. Although there have been software algorithms that mimic hardware lock-in, we have demonstrated a significantly simpler and faster method. Since our novel method requires neither a filter order nor time constant, no optimization process is required when the emitter or detector system is changed. Furthermore, we successfully replaced the function generator and LIA with a single built-in sound card to further reduce the setup size, weight, and cost. THz-TDS systems are currently piquing interest in the field of biomedical imaging and non-destructive detection. Several studies have been constructed compact THz spectroscopic systems by reducing the number of optical components [24, 25]. We, therefore, believe that our work along with previous research can pave the way for developing portable cost-effective THz-TDS systems for external laboratory applications.
This work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (NRF 2020R1F1A1074832, NRF 2021R1F1A1058307, and NRF 2022R1A2C2006379), International Research & Development Program of the NRF funded by the Ministry of Science and ICT (Grant no. 2022K1A3A1A73080783), Nano•Material Technology Development Program through the NRF funded by the Ministry of Science, ICT and Future Planning (NRF 2009-0082580, Project number K210309005, K230208009), and Research-focused Department Promotion Project as a part of the University Innovation Support Program 2020 of Dankook University.
National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (NRF-2020 R1F1A1074832, NRF-2021R1F1A1058307, NRF-2022 R1A2C2006379); International Research & Development Program of the NRF funded by the Ministry of Science and ICT (Grant no. 2022K1A3A1A73080783), Nano•Material Technology Development Program through the NRF funded by the Ministry of Science, ICT and Future Planning (NRF 2009-0082580, Project number K210309005, K230208009), and Research-focused Department Promotion Project as a part of the University Innovation Support Program 2020 of Dankook University.
The authors declare no conflicts of interest.
Data underlying the results presented in this paper are not publicly available at the time of publication, which may be obtained from the authors upon reasonable request.
Curr. Opt. Photon. 2023; 7(6): 683-691
Published online December 25, 2023 https://doi.org/10.3807/COPP.2023.7.6.683
Copyright © Optical Society of Korea.
Department of Physics, Dankook University, Chungnam 31116, Korea
Correspondence to:*kyoungjs@dankook.ac.kr, ORCID 0000-0001-6736-9118
This is an Open Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License (http://creativecommons.org/licenses/by-nc/4.0/) which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.
A typical terahertz time-domain spectroscopy system requires large, expensive, and heavy hardware such as a lock-in amplifier and a function generator. In this study, we replaced the lock-in amplifier and the function generator with a single sound card built into a typical desktop computer to significantly reduce the system size, weight, and cost. The sound card serves two purposes: 1 kHz chopping signal generation and raw data acquisition. A unique software lock-in (Python coding program to eliminate noise from raw data) method was developed and successfully extracted THz time-domain signals with a signal-to-noise ratio of ~40,000 (the intensity ratio between the peak and average noise levels). The built-in sound card with the software lock-in method exhibited sufficiently good performance compared with the hardware-based method.
Keywords: Data acquisition, Software lock-in amplifier, Soundcard, Terahertz time-domain spectroscopy
Over the past few decades, terahertz time-domain spectroscopy (THz-TDS) has become a valuable tool in various research fields such as material characterization [1–4], chemical detection [5–8], medical imaging [9–11], and nondestructive screening [12–14] owing to its unique characteristics. First, THz-TDS provides broadband spectral information (0.1–10 THz) in a single measurement. Another important advantage of THz-TDS compared with continuous wave THz measurements is that the measured THz spectrum has both amplitude and phase at each frequency. Therefore, a complex refractive index can be directly extracted without using the Kramers-Kronig relation [15, 16].
A typical THz-TDS system uses a pair of photoconductive antennas (PCAs) with a femtosecond laser [17]. The femtosecond laser beam is divided into two parts: Pump and probe. When an emitter PCA with a moderate bias voltage (1–20 V) is illuminated by the pump beam, photo-excited electrons are accelerated and a single cycle THz wave is generated. THz measurements by a detector PCA are similar to the reverse generation process, but do not require a bias voltage. The photo-excited electrons illuminated by the probe beam are accelerated by the incident THz wave, and small currents are produced across the electrodes on the detector PCA.
The electric field of the THz wave at the detector is typically approximately 10–100 V/cm. Currents are measured in picoamps to nanoamps [18]. Measuring such tiny currents is challenging in general under the thermal noise voltage. Therefore, a hardware lock-in amplifier (LIA) is extensively used to detect weak signals in noisy environments. In addition, a function generator or an optical chopper is required to modulate such signals for lock-in detection. In the past few decades, the field of femtosecond lasers has made significant progress, allowing tabletop fiber lasers to replace bulky Ti:sapphire lasers for THz-TDS. As a result, THz-TDS systems are smaller in size than in the past. However, the hardware LIA and the accompanying modulation system prevent further reduction in the size and cost of THz-TDS systems. In this study, by developing a simple software algorithm and using a built-in sound card as both a function generator and a data-acquisition device, respectively, we reduced the size, weight, and cost of THz-TDS systems significantly. In the following section, we first explain our software LIA and then show how to construct a THz-TDS system with our built-in sound card.
Lock-in detection also known as phase-sensitive detection uses a specific reference frequency to single out the component of a signal [19, 20]. Environmental noise signals at frequencies other than the reference frequency are rejected. Specifically, the configuration of a THz-TDS system with a function generator and a hardware LIA is schematically displayed in Fig. 1(a). When the bias voltage across the emitter PCA given by a function generator is a square pulse with an angular frequency ωr, the THz signal at the detector might be modulated with the same frequency. The modulated bias voltage is the reference signal of the system. Mathematically, the modulated THz signal at the detector can be written as follows:
where Vs denotes the THz signal amplitude, and θs denotes the additional phase difference between the emitter bias and the detector signal. The actual signal from the detector PCA contains background noise [Vn(t)] that changes randomly independent of the reference. Therefore, the total signal from the detector is defined as follows:
The hardware LIA receives reference information from the function generator and generates its own reference sine wave, as follows:
where VL and θL denote the lock-in reference amplitude and the phase constant, respectively. The hardware LIA amplifies the input noisy signal from the detector PCA [Eq. (2)] and multiplies it by the lock-in reference [Eq. (3)]. The result is
From the trigonometric identity, the second term of Eq. (4) can be expressed as a sum instead of a product.
As shown in the equation, the first two terms are AC signals that vary rapidly (typically 1–10 kHz), whereas the last term is a DC signal that does not change with time. Then, the hardware LIA passes the multiplied signal through a low pass filter, leaving only the DC signal. Finally, the locked and amplified signal becomes
which is directly proportional to the THz signal amplitude (Vs) that we want. The time constant of the hardware LIA determines how low frequencies are allowed to pass, whereas the sensitivity determines the amplification level of raw detector signals.
We measured the THz-TDS signal in the usual way using a function generator (AFG3000; Tektronix, OR, USA) and a hardware LIA (SR830; Stanford Research Systems Inc., CA, USA). The pairs of PCA (PCA-40-05-10-800, BATOP GmbH, Jena, Germany) were used for the emitter and detector. A 10 V, 1 kHz square pulse bias was applied to the emitter. The excitation laser (center wavelength: 780 nm) had 10 mW power with a 100 MHz repetition rate for both the emitter and detector. The LIA obtained the reference information from the function generator, and the detector PCA was directly connected to the signal input part of the LIA. The time constant and sensitivity were set to 10 ms and 1,000 uV, respectively. Time domain data were measured in a total of 20 ps time windows at 0.05 ps intervals. The measured THz-TDS signal is displayed in the top panel of the Fig. 2(a). As shown in the Fig. 2, a typical nice terahertz pulse had been measured using a conventional method.
In this study, we have developed two software lock-in detection methods: One is to simply emulate a hardware LIA in software (method 1), and the other is a novel unique method (method 2), which does not require a low-pass filter. To realize the lock-in detection by the software, raw data of the reference signal (bias voltage pulse) and detector signal (small THz signal with large noise) are necessary. To this end, the THz-TDS setup was changed as shown in Fig. 1(b). The hardware LIA was removed, and the conventional oscilloscope (Lecroy waverunner LT342) was employed as the data acquisition device. Our oscilloscope has two input channels: One channel is used to acquire the reference signal from the function generator, and the other channel is used to obtain raw detector signals. As the raw THz signal was extremely weak, a small and cheap voltage amplifier was used between the detector and oscilloscope [Fig. 1(b); The diameter of the coin is 21.60 mm). The voltage amplifier is made by YUFO Electronics Limited [21]. The gathered raw data were sent to a desktop computer through local area network cards.
The amplified raw detector signals [modulated THz signals with noise corresponding to Eq. (2)] collected for 10 ms at each delay line are drawn as a two-dimensional (2D) image in Fig. 3(a). The jet colormap was selected to depict the image so that the reddish and blueish areas represent positive and negative values, respectively. The signal is feeble in most areas except around 13 ps of the delay line where the positive and negative time domain peaks are located (Fig. 2). In our setup, the positive time domain peak was observed at 13.15 ps, whereas the negative peak was located at 13.55 ps. Therefore, the polarity changed from positive to negative as the delay line changed by 0.4 ps. Such an opposite polarity was directly observed in the 2D raw detector signals. As the delay line passed from 13 to 14 ps, the colormap changed its color from red to blue or vice versa, meaning that the polarity was reversed along the delay line. The reference bias voltage and the amplified raw detector signals as a function of time are displayed in Fig. 3(b). The chopping frequency was 1 kHz; Thus, the total five numbers of the square pulse appeared within 5 ms [upper panel in Fig. 3(b)]. Although the peak-to-peak voltage (Vpp) of the reference bias voltage recorded through the oscilloscope was approximately 3.2 V, the Vpp of the actual voltage across the emitter was 10 V. When performing Lock-in detection, only the frequency and shape of the signal are important, not its absolute amplitude. Therefore, we used a reference signal for data analysis. The raw detector signals at 13.15 and 13.55 ps within the same 5 ms are shown in the lower panel of Fig. 3(b). The opposite polarity discussed above was observed: The signal at the 13.15 ps delay line [red line in the lower panel of Fig. 3(b)] was in-phase with the reference bias voltage, whereas it was out-of-phase at the 13.55 ps delay line [blue line in the lower panel of Fig. 3(b)].
To mimic the hardware LIA, a lock-in reference signal [Eq. (3)] in the form of a sine function is necessary. The black line in Fig. 4(a) indicates the raw reference chopping signal from the function generator, which timely syncs with the emitter bias voltage (1 kHz square pulse). To create the lock-in reference from the chopping reference, the fast Fourier transform (FFT) was performed. The absolute amplitude of the FFT is shown in Fig. 4(b). Because the chopping reference had a square shape, infinitely many frequency components were required. However, as expected, the maximum amplitude was observed at a 1 kHz frequency. In addition, the phase information at the 1 kHz frequency was obtained by FFT. Based on the FFT results, we successfully constructed the lock-in reference [Eq. (3), a 1 kHz sine wave matched the chopping reference], as indicated by the red dotted line in Fig. 4(a). The next step is to multiply the lock-in reference [red dotted line in Fig. 4(a)] with the raw noisy time-dependent signals [Fig. 3(a)] to obtain Eq. (4) or (5). This process has been performed at each delay line to extract the full time-domain signal. The multiplication between the lock-in reference and the raw data at the delay line 13.15 ps [red line in the lower panel of Fig. 3(b)] is depicted as an example in Fig. 4(c).
The last step is to pass the multiplication data through the low-pass filter implemented by the software. The performance of the low-pass filter for a hardware LIA is typically modulated by setting the time constant. As the time constant increases, the cutoff frequency becomes lower, meaning that the noise signal can be mostly eliminated. However, the processing time can increase significantly. Therefore, an optimal time constant must be found through trial and error. Our software low pass filter was realized using the Butterworth filter in the Python SciPy module [22]. In addition to the time constant, the software Butterworth filter requires the optimal setting of the filter order. After many trial and error processes, we found the optimal values of 2 for the filter order and 200 ms for the time constant in our system. The multiplication data in Fig. 4(c) (at the 13.15 ps delay stage) was passed through our software low-pass filter, and the results are illustrated in Fig. 4(d). The terahertz wave signal extracted from the noise was the last value of the filtered data [Eq. (6)]. After gathering the filtered signal at each delay line, we finally obtained the full-scale time-domain signal, as shown in the middle panel of Fig. 2 (blue line). Compared with the hardware lock-in result (upper panel in Fig. 2), our software lock-in works very well.
Although the previous method of software lock-in detection is accomplished by mimicking the hardware LIA, there are several drawbacks. First, it requires the optimal values of filter order and time constant to construct a software-based low-pass filter. Finding the optimal value is a time-consuming task due to the raster scanning process. In addition, because the optimal values may vary depending on the experimental condition, they must be newly found each time the system is changed. Second, in the entire algorithm, the time spent performing the FFT (to generate the sine form of the lock-in reference) and running the low-pass filter consumes a significant portion, slowing down the running speed of the program. Therefore, we propose a novel software lock detection method that requires neither the FFT nor a low-pass filter.
Our method uses the chopping reference directly as a lock-in reference without FFT. Instead, the chopping reference was normalized and shifted so that the minimum and maximum voltages are −1 and 1 V, respectively, and the average value is zero. The lock-in reference for method 2 is depicted in Fig. 5(a), as indicated by the red dotted line. The black line in Fig. 5(a) represents the chopping reference, which is the same data displayed in the black line in Fig. 4(a). Unlike the hardware lock-in system, the new lock-in reference contains the fundamental and the higher-order sine functions [Fig. 4(b)]. Specifically, it is as follows:
These higher-order components, however, did not affect the final result because the lock-in detection only singled out the fundamental component as we will see in the next paragraph. Because the FFT process has not been used, the running time of the analysis program is significantly reduced.
The next step is multiplying the lock-in reference with the raw detector signal at each delay line. Mathematically, this multiplication can be expressed as follows:
The Fig. 5(b) shows the multiplication between the new lock-in reference and the raw detector signal at 13.15 ps delay line as an example. Due to the higher order components of the lock-in reference, the resulting multiplication data [Fig. 5(b)] differ significantly from the previous one [Fig. 4(c)]. Equation (8) can be alternatively expressed using the trigonometric identity:
By comparing Eqs. (5) and (9), the DC component we want to pick up is not changed at all although the lock-in reference contains the higher-order sine functions.
The final step is to extract only the DC component from Eq. (9) or the data displayed in Fig. 5(b). As discussed previously, the reason for using a low-pass filter in hardware lock-in is to leave only the DC component in Eq. (5). The DC component can also be extracted by simply averaging the multiplication signals [Eq. (5) or Eq. (9)] instead of passing them though the low-pass filter because all AC components may become zero after averaging, whereas the DC component would add up. The averaging process of the time-dependent signal in hardware is more difficult to implement than a low-pass filter. Therefore, the hardware LIA typically uses a low-pass filter rather than time averaging. In contrast, software-wise, averaging is significantly easier to implement than a low-pass filter because parameters such as filter order or time constant are not required for averaging. The averaged multiplication data at the 13.15 ps delay line in Fig. 5(b) were approximately 0.15 (marked with a black dotted line). Such a multiplication and averaging process was performed at every delay line, and the gathered data are displayed in the lower panel in Fig. 2 (green line). Our new lock-in detection method extracts THz-TDS signals from noise very well at a faster speed than the previous method. As neither the filter order nor the time constant is necessary, there is no need for their optimization process. Therefore, our new lock-in technique can be used universally even if the detection environment is different.
Although we successfully demonstrated the software-based lock-in detection in the previous chapter, we still use expensive and bulky hardware, including a function generator and an oscilloscope. In this chapter, we demonstrate that how a built-in sound card can replace both pieces of hardware.
In our experiments, the function generator plays two roles: one is to apply a 0–10 V periodic square pulse voltage to the emitter, and the other is to deliver a reference signal to the lock-in system. Our goal is to implement a function generator using a line-out port (an earphone port) of a sound card. The model number of the main board used for this experiment was Samsung DB400T6A-B0K/R (Samsung, Suwon, Korea), where the sound card (Realtek HD Audio ALC662) was built-in. Although the analog line-out port has only a single hole at the main board, there are two channels because of the stereo sound system. Therefore, we can use one of them as the emitter bias and the other for the reference signal of the software lock-in detection. To generate the 1 kHz periodic square pulse, we played the video (1 kHz square wave with sampling rate 96 kHz) [23]. Because of the voltage limitations of the sound card, the output voltage range was limited to between −0.4 to 0.4 V, which was sufficient for the lock-in reference signal but insufficient for the emitter bias. To enhance the bias voltage, the voltage amplifier [inset picture in Fig. 1(b)] was adopted as depicted in Fig. 1(c). The raw (1 kHz square pulse played) data and their amplification are depicted in Fig. 6 (blue line: raw data, red line: amplified data). Although the noise is higher than that of commercial function generators, the built-in sound card can sufficiently produce the desired signal. As described in the next paragraph, lock-in detection works well even with such high-bias noise.
The MIC (microphone) port (line-in port) in the built-in sound card was used for data acquisition. As is the line out port, the MIC port has two channels. One channel is directly connected to a line out channel to record the lock-in reference signal, and the other channel is connected to the detector for raw detector acquisition. As before, the voltage amplifier was inserted between the detector and the sound card to enhance small detector signals. Figure 7(a) shows the measured lock-in reference from the line out channel (blue line) and the raw detector signal at the zero-delay position between the THz wave and the optical probe beam (red line). The detector signal is modulated according to the reference signal. Likewise, at every delay line, we recorded the lock-in reference and the raw detector signal. To complete the lock-in detection, the software lock-in method 2 was used and the final THz time domain signal is shown in Fig. 7(b). The same THz signal was also measured with a conventional hardware LIA and the function generator as well [Fig. 7(c)]. Comparing Figs. 7(b) and 7(c), the built-in sound card and software lock-in detection work very well without any expensive and bulky commercial hardware.
THz-TDS is a unique tool compared with other spectroscopy systems because both amplitude and phase information can be measured simultaneously. A conventional THz-TDS system requires a function generator and hardware LIA for small signal detection. Although successful, such expensive and bulky hardware has prevented THz-TDS from being used outside the laboratory. In this study, we have developed a novel software lock-in detection method. Although there have been software algorithms that mimic hardware lock-in, we have demonstrated a significantly simpler and faster method. Since our novel method requires neither a filter order nor time constant, no optimization process is required when the emitter or detector system is changed. Furthermore, we successfully replaced the function generator and LIA with a single built-in sound card to further reduce the setup size, weight, and cost. THz-TDS systems are currently piquing interest in the field of biomedical imaging and non-destructive detection. Several studies have been constructed compact THz spectroscopic systems by reducing the number of optical components [24, 25]. We, therefore, believe that our work along with previous research can pave the way for developing portable cost-effective THz-TDS systems for external laboratory applications.
This work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (NRF 2020R1F1A1074832, NRF 2021R1F1A1058307, and NRF 2022R1A2C2006379), International Research & Development Program of the NRF funded by the Ministry of Science and ICT (Grant no. 2022K1A3A1A73080783), Nano•Material Technology Development Program through the NRF funded by the Ministry of Science, ICT and Future Planning (NRF 2009-0082580, Project number K210309005, K230208009), and Research-focused Department Promotion Project as a part of the University Innovation Support Program 2020 of Dankook University.
National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (NRF-2020 R1F1A1074832, NRF-2021R1F1A1058307, NRF-2022 R1A2C2006379); International Research & Development Program of the NRF funded by the Ministry of Science and ICT (Grant no. 2022K1A3A1A73080783), Nano•Material Technology Development Program through the NRF funded by the Ministry of Science, ICT and Future Planning (NRF 2009-0082580, Project number K210309005, K230208009), and Research-focused Department Promotion Project as a part of the University Innovation Support Program 2020 of Dankook University.
The authors declare no conflicts of interest.
Data underlying the results presented in this paper are not publicly available at the time of publication, which may be obtained from the authors upon reasonable request.