## 4 Adaptive Modulation for the Single User
\begin{split}\textbf{P2}:&\max\limits_{\{\Delta f_{m,n }\}}R=\sum\limits_{m=1}^{W(d)}\sum\limits_{n=1}^{N_{m}}\Delta f_{m,n}\log_{2}M _{m,n}\\ s.t.&\text{C1}:&\sum\limits_{m=1}^{W(d )}\sum\limits_{n=1}^{N_{m}}\Delta f_{m,n}\leq B(f,d)\\ \text{C2}:&\sum\limits_{n=1}^{N}\Delta f_{m,n}\leq B _{m}(f,d),\forall m=1,2,\dots,M(d)\\ \text{C3}:& M(\gamma_{m,n})\leq 1+\frac{1.5l_{m,n}P_{ m,n}(\gamma_{m,n})}{-\ln(5l_{m,n})N_{0}\Delta f_{m,n}}\\ \text{C4}:&\Delta f_{m,n}\geq 0.\end{split}  \tag{15}\]  
The above sub-problems **P1** and **P2** are convex and can be solved directly using a CVX tool or lagrangian dual method. The details of the BCD algorithm are described in Algorithm 2. ```
0: The THz channel power gain \(h\), the number of available bandwidth windows \(M\), the number of subcarriers on each window \(N_{m},m\in\{1,2,\dots,M\}\), the initial sub-bandwidth \(f^{(0)}\) and the convergent threshold \(\delta_{s}\). 0: The optimal sub-bandwidth \(f_{m,n}\), transmit power \(P_{m,n}\) and modulation order \(M_{m,n}\), \(m\in\{1,2,\dots,M\}\), \(n\in\{1,2,\dots,N_{m}\}\). 1: Solve the sub-problem **P1 based on the initial sub-bandwidth \(f^{(0)}\). **
2: Solve the sub-problem **P2 based on the obtained solution from P1. **
3: Solve the sub-problem **P1 again by replacing \(f\)** with \(f^{(1)}\) from P2 and \(M^{(1)}_{m,n}\) from P1. **
4: Solve the sub-problem **P2 again by replacing \(P^{(1)}_{m,n}\) and \(M^{(2)}_{m,n}\) from P1. **
5: Repeat until the data rate difference of two iterations below the convergent threshold. 6: Obtain the final \(f_{m,n}\), transmit power \(P_{m,n}\), and modulation order \(M_{m,n}\), \(m\in\{1,2,\dots,M\}\), \(n\in\{1,2,\dots,N_{m}\}\). ```  
**Algorithm 2** BCD Algorithm  
The convergence of the entire method is proven in Appendix A. Although the convergence speed of the BCD methods cannot be analyzed theoretically [52], the methods typically converge in a few iterations for a moderate number of optimization variables as will be numerically shown in Section 4. Meanwhile, the sub-problems in each iteration of the BCD method are all convex optimization problems, which can be solved in polynomial time. Therefore, the time complexity of the proposed iterative method is polynomial, and it can be practically implemented with fast convergence for a THz wireless communication system with distance-adaptive modulation. The BCD algorithm involves solving two sub-problems **P1** and **P2** in each iteration. Due to the convexity of **P1** and **P2**, they can be solved using the CVX tool, which typically employs the interior-point method to obtain the optimal solution. The computational complexity of the interior-point method is polynomial, determined by the number of variables and constraints. Therefore, the arithmetic complexity of solving **P1** and **P2** is \(O(\sqrt{3 MN_{m}})\) and \(O(\sqrt{8 MN_{m}})\), respectively. According to the iteration stop condition \(\delta_{s}\), the total computation complexity of BCD method is \(O(\sqrt{1 MN_{m}}log(1/\delta_{s}))\), respectively. The water-filling power allocation method allocates more power to channels with higher signal-to-noise ratios (SNR) while maintaining a total power constraint. This method involves calculating the SNR for each channel, updating the power allocation, computing the total power, and comparing it with the power constraint. The complexity of calculating the SNR for each channel and updating the power allocation is determined by the number of channels, so the complexity of these operations is \(O(MN_{m})\). Assuming the number of iterations is \(m\), the total complexity of the water-filling algorithm is \(mO(N)\). However, the water-filling algorithm is not suitable for scenarios where the channels change frequently. When the channels change frequently, it necessitates frequent recalculations of SNR and updates to the power allocation, increasing the overall computational burden.