## 3 Experiment Setup
### Neural Network Architecture and Training Configuration  
The proposed two-stage time-domain equalization framework is implemented using a standard LSTM module in PyTorch 2.1.1. No pre-trained weights or external models are used; all networks are trained from scratch using internal experimental data collected from the system described in Section 3.1. Each equalizer stage uses a four-layer LSTM network with 128 hidden units in each layer, and dropout is applied between layers to improve generalization and prevent overfitting. The input dimension is 2, representing the real and imaginary parts of the received baseband signal; the output dimension is also 2, corresponding to the complex signal components after equalization. The original dataset (210 GHz/2.1 m) contains 15,000 transmitted symbols, each representing two bits. The data are randomly divided into training, validation, and test sets in a ratio of 7:2:1. In addition, the test set also includes signals acquired at 310 GHz/1.5 m. After applying the data augmentation strategy described in Section 2.7 and the upsampling process described in Section 2.2 to the training set, the total number of training samples increases to approximately 168,000. Each sample consists of a transmitted sequence and a corresponding received waveform sequence that has been expanded according to the sampling factor. The test set and validation set apply the same sampling strategy when used, but no data augmentation is performed. It should be added that in order to compare the two-stage method and the two traditional equalizers more fairly, when we tested the versatility of the two-stage method (that is, using the 310 GHz test set), we retrained the two traditional equalizers because the two models had poor learning ability and versatility. Here, the two equalizers were trained with the same data preprocessing and data enhancement. The purpose is to ensure fairness (the two-stage time-domain equalization method is tested directly without retraining). All input sequences are normalized and sliding-windowed following the preprocessing procedure described in Section 2.6. Training is supervised, using the transmitted symbols as target labels. For the first-stage equalizer, augmented data are used for training  
Figure 4: Photograph of the real-time baseband digital signal processing testbed for THz communication. The platform integrates a PXIe-based system for baseband I/Q signal generation and acquisition, a Schottky diode-based RF front-end for up/downconversion, and IF-band low-noise amplification. Key components include a PXIe-8881 embedded controller, PXIe-5841 VST, and external LO and IF circuits. Baseband processing is implemented in LabVIEW 21.0, and equalization is performed offline using Python 3.9.18.  
to improve its robustness under low-SNR conditions. For the second-stage equalizer, the model is trained directly on the output of the first-stage equalizer after downsampling, so no data augmentation is required. Both stages are trained using the Adam optimizer with an initial learning rate of 0.001. A learning rate scheduling mechanism is used during training to allow the learning rate to be automatically adjusted based on the optimization progress. The batch size is set to 64, and a weight decay of \(1\times 10^{-7}\) is used to apply mild L2 regularization. Although the maximum number of training epochs is set to 100, we use an early stopping strategy with patience set to 10 epochs, monitor the validation set loss to prevent overfitting and reduce unnecessary computation, and adjust the number of training epochs based on the training results. In addition, as shown in Figure 5, through experimental comparison, we selected the number of LSTM units and the sampling factor to achieve a good balance between performance and efficiency. All training is performed on an NVIDIA RTX 3060 GPU with 8 GB of memory. The entire training process is implemented and executed independently by the author without using any pre-training modules or external training assistance.