Spectrum and Energy-Efficiency Maximization in RIS-Aided IoT Networks

New device capabilities supporting spectrum and energy-efficient internet of things (IoT) deployments are expected to drive the evolution of fifth-generation (5G) and beyond networks. Due to operating on the same spectrum of resources, every IoT pair interferes with each other. This paper utilizes reconfigurable intelligent surfaces (RISs) to mitigate inter-node interference in an IoT network through directional beamforming by adjusting the phase shifts of the passive elements of the RIS. We consider an RIS-assisted IoT network consisting of multiple pairs of IoT devices that utilize both direct paths and one-hop reflected paths. Two resource allocation problems, namely spectrum-efficiency maximization (SEM) and energy-efficiency maximization (EEM), are studied. Since the formulated optimization problems are non-convex in nature, we divide them into two sub-problems and solve them alternately. To obtain the optimal phase shifts of the elements of the RIS for both SEM and EEM, we extend the conjugate gradient technique to Riemannian manifolds. On the other hand, to obtain the optimal transmit power, we solve the transmit power allocation sub-problem as a difference of concave functions for the SEM and use a pricing-based technique for the EEM. Numerical results validate the effectiveness of deploying RISs to assist IoT networks, albeit concerning the RIS’s location, its number of elements, and the number of IoT node pairs. In particular, considerable spectrum and energy efficiency gains are achieved in comparison to baseline state-of-the-art networks.


I. INTRODUCTION
Future use cases of fifth-generation (5G) and beyond communications will enable massive connectivity for mobile and fixed internet of things (IoT) devices, which will connect and exchange data among themselves, other devices, systems, and networks over the Internet to perform specific automated or semi-automated tasks [1]. Enabling seamless connectivity in an IoT network requires high spectrum efficiency (SE) as bandwidth resources become limited with the increase in the number of devices [2]. Furthermore, energy-efficiency is also one of the primary design goals of mobile IoT The associate editor coordinating the review of this manuscript and approving it for publication was Jad Nasreddine .
devices [3], [4] due to the increasing gap between the power consumption of signal processing circuits and device battery capacity. Furthermore, dense deployment of devices in an IoT network results in very high inter-device interference, which may degrade the overall capacity of the network. To address the aforementioned challenges in IoT networks, recently, there has been a great deal of interest from both industry and academia in an evolving hardware technology called reconfigurable intelligent surfaces (RISs) [5], [6], [7], [8], [9].
In particular, RIS is an engineered two-dimensional surface made up of an array of discrete elements that can be controlled at an individual level or collectively [10]. It is a novel way to control the wireless propagation medium, which until now had been deemed uncontrollable. Accordingly, the fundamental role of an RIS is to affect the dispersion of wireless signals transmitted by other devices without producing their own signals.
RIS can be used in a wireless IoT network to assist communication by generating supplementary propagation paths, enhancing the characteristics of existing paths, and mitigating interference. Furthermore, the elements of an RIS are almost passive in the sense that incoming signals are re-radiated in the desired direction after ''passive'' analog filtering without the need for additional power. Similar to back-scatter communications, 1 but different from traditional relaying such as amplify-and-forward (AF) and decode-and-forward (DF) relaying [13], [14], RIS can only reflect the incoming signal without amplifying or decoding it. Accordingly, RIS can provide vital flexibility for the design of the ''smart'' environment, which can be suitably configured for low-cost and energy-efficient communication in IoT networks. In practice, however, some active components are needed for adaptive phase-shifting. Though the power dissipation of each element is low, it cannot be overlooked when considering very large surfaces. Compared to DF relaying, the authors in [15] show that RIS-aided transmission can outperform the DF relaying protocol in terms of EE for high-rate transmissions. Nevertheless, the primary challenge of using RIS in an IoT network is the algorithm design for controlling the phase shifts of the passive elements.
Accordingly, in [16], the authors investigated an RISassisted device-to-device (D2D) communication scheme for maximizing the sum rate of the system by designing the phase shift controller using a local search algorithm. Similarly, in [17], the authors analyzed the throughput of an RIS-aided D2D communication system by optimizing the power levels and phase shifts using the block coordinate descent (BCD) algorithm and semi-definite relaxation (SDR), respectively. Next, concerning IoT, in particular, the authors in [18] analyzed the performance of RIS-assisted unmanned aerial vehicles (UAV) for IoT networks. It was shown that the use of RIS significantly helped in improving the achievable symbol error rate (SER) by five orders of magnitude and enhanced the capacity of conventional UAV communication systems by tenfold. In [19], the authors investigated an RISassisted access point (AP) equipped with an edge server that provides mobile edge computing (MEC) services to multiple IoT devices. They formulated an optimization problem that maximizes the sum of computational bits to optimally design the CPU frequency, the transmit power, and time allocation for computational offloading, as well as the phase shifts of the RIS.
Apart from D2D and IoT communications, RISs have also been deployed in cellular communication systems. For example, in [20] and [21], the authors analyzed the coverage of RIS-assisted millimeter wave (mmWave) networks using stochastic geometry. Next, in [22], the authors explored the performance of an RIS-assisted multi-inputsingle-output (MISO) communication system with hardware impairments. In particular, they analyzed the spectrum and energy efficiency by varying the transmit power and the number of reflecting elements at the RIS. Similarly, in [23], the authors proposed a fast converging algorithm to maximize the sum rate of a bi-directional MISO communication system and compared it with other existing algorithms. In [24], the authors studied the non-trivial trade-off between energy efficiency (EE) and spectral efficiency (SE) in multi-user multiple-input multiple-output (MIMO) uplink communications aided by a RIS equipped with discrete phase shifters. While the authors in [25] focused on maximizing SE for RISassisted multi-user MISO networks, the sum-rate maximization problem was studied in [26] for an RIS-aided NOMA system. The authors in [27] and [28] proposed several algorithms either to maximize the EE or to minimize the transmit power. For example, the authors in [28] and [29] proposed algorithms to maximize EE and minimize the total transmit power, respectively.
Though RIS provides the fundamental flexibility to control the wireless propagation paths, it also brings along several technological and engineering challenges. First, though RIS effectively enhances the signal, it reduces the degree of spatial freedom as well as the channel rank. Furthermore, multi-path signal regulation is a major challenge in the implementation of RIS. Next, by breaking the barrier of conventional cell sector coverage, RIS enhances the signal coverage area but introduces complexity to network planning and optimization. Last but not least, resource management, including active and passive beamforming design of the RIS in conjunction with the base station, is a key challenge in the designing of a RIS-aided system [7]. The consideration of an interference channel framework in a RIS-aided IoT network to maximize the SE and EE by optimizing the active and passive beamformers introduces fundamental new challenges to traditional IoT systems, which have not been addressed in the aforementioned works.
Accordingly, different from existing works, in this paper, we study an RIS-aided IoT network where the reflected links from the RIS for an IoT node pair are considered to interfere with the signals of other IoT node pairs. The primary objective of this work is to design an interferenceaware IoT network by maximizing the spectrum and energy efficiency of the network subject to the constraints of transmitting power at the IoT nodes and phase shift coefficients at the RIS. The primary contributions are summarized below.
• We study two resource allocation problems, namely spectrum efficiency maximization (SEM) and energy efficiency maximization (EEM) in an RIS-assisted IoT network by considering a system model where each source node communicates with its destination node through a direct link and a reflected link via the RIS. VOLUME 10, 2022 • Since the formulated SEM problem is non-convex in nature, we solve the problem in an alternating fashion by using two low-complexity algorithms. We first fix the transmit power to solve the sub-problem of optimizing the phase shifts by extending the conjugate gradient technique to Riemannian manifolds. Next, using the obtained phase-shifts, the transmit power allocation subproblem is solved as a difference of concave functions.
• To solve the EEM problem, the fractional form of the objective function in the transmit power allocation subproblem is first changed into a subtraction form and then solved using non-negative pricing parameters that are updated until the optimal solution is achieved. The phase shifts are optimized in a similar way as in the SEM.
• Lastly, extensive numerical analysis is performed via computer simulations under practical channel conditions to verify the feasibility of the proposed techniques.
In particular, to quantify and substantiate the SE and EE of the designed framework, analysis was performed concerning the RIS's location, its number of elements, and the number of IoT node pairs. Furthermore, we compare the proposed algorithms with a baseline IoT network without RIS and an IoT network with RIS but with random phase shifts. We show that the proposed algorithms achieve significant improvement in terms of both SE and EE at a fraction of the cost of computation complexity. Structure: The rest of this paper is organized as follows. Section II introduces the system model of the RIS-assisted IoT network. In Section III, we provide the problem formulation for SE and EE maximization. In Sections IV and V, we propose algorithms for solving the problems of transmit power allocation and phase shift optimization, respectively. In Section VI, numerical results are presented, while we conclude the paper in Section VII.
Notations: C and R denote the complex and real space, respectively. F, f, and f denote a matrix, a vector, and a scalar, respectively. F H is the Hermitian of the matrix F. f kn denotes the k-th row and n-th column of the matrix F. Re{·} is the operator that takes a real part from a given complex variable. diag{·} is the operator that generates a diagonal matrix form a given vector. • is the hadamard product operator and ∇ is the differential operator. I N denotes the identity matrix of size N .

II. SYSTEM MODEL
We consider N IoT pairs, each consisting of a source node and a destination node. Every source and destination node communicates through a direct channel and a reflected channel with the help of an RIS, which has M passive elements for reflecting the incident signal. Meanwhile, the communication between the nodes in the nth IoT pair (n = 1, . . . , N ) interferes with the received signal at the ith destination node and vice versa (i = 1, . . . , N , i = n). A pictorial illustration for the same is given in Fig. 1. Let the channel coefficient from the k-th source node to the n-th destination node be defined as h kn ∈ C and the channel coefficient vector from the source node k to an RIS and from the RIS to the destination node n as g k ∈ C M ×1 and f n ∈ C M ×1 , respectively. Also let the phase-shift matrix be defined as a diagonal matrix = diag(θ 1 , θ 2 , θ m , . . . , θ M ), where θ m = e jφ m is the phase of the m-th reflection element of RIS. Thus, the received signal at the RIS can be expressed as where G = [g 1 , g 2 , . . . , g N ] ∈ C M ×N is the channel coefficient matrix between all of the source nodes and the RIS while x = [ √ p 1 s 1 , √ p 2 s 2 , √ p n s n , . . . , √ p N s N ] T ∈ R N ×1 is the transmitted signal vector from all of the source nodes. Here, the symbols p n and s n denote the transmit power and the transmit data symbol corresponding to the n-th source node, respectively. The reflected signal from RIS can be written as We assume that perfect channel state information (CSI) of all the links is available at every source node. 2 Accordingly, the received signal y ∈ C N ×1 at the destination nodes can be written as where y = [y 1 , y 2 , . . . , y N ] T , H, F H and w in (3) are the matrix of direct channel coefficient with the dimension N ×N , matrix of channel coefficient between the RIS and all of the destination nodes with the dimension N × M , and additive 2 Note that the perfect CSI estimation is an important assumption in RISaided IoT network, wherein some standard algorithms such as parallel factor decomposition [30], [31] or pilot transmission as proposed in [32] can be used to acquire it. However, the results of these works serve as a theoretical performance upper bound for the considered IoT network, which can provide a benchmark for the network design under imperfect CSI. The system model involving imperfect CSI will be considered as a future extension of this work.
white Gaussian noise (AWGN) vector with zero mean and covariance σ 2 I N , respectively, and are defined as where h T n ∈ C N ×1 and f n ∈ C M ×1 for n = 1, 2, . . . , N . Thus, the received signal at the n-th destination node can be written as Using (4), the signal-to-interference-plus-noise ratio (SINR) at the n-th destination node is expressed as Based on Shannon's capacity theorem, the achievable rate of the n-th destination node can be written as From (6), the achievable sum rate of the network is given by Note that we will use (7) as a SE metric in Section III. In order to maximize the EE metric, we need to define the total power consumption of the system model. The transmit power and the static power consumption at every node are two important factors that affect the EE of the network. The transmit power is influenced by the channel condition, cell coverage areas, user locations, etc. and restricted by the transmit power budget. Moreover, the static power consumption is constant and is consumed by all active nodes in the network. Furthermore, the static power consumed by each RIS element is very small compared with that consumed by active nodes, however, we will consider this power dissipation in maximizing the EE of the network. Note that the RIS does not consume any transmit power since it is composed of a number of passive elements that do not directly amplify the magnitude of the impinging signal. The RIS simply serves to properly adjust the phase shift of the reflected signal in an optimal manner such that the received signal has maximum amplitude. Therefore, energy consumption at RIS depends on the material type and the number of reflecting elements which optimally carry out phase shifting to the reflecting signals [33]. Based on the explanation above, the total power consumption of the wireless link between every source node and destination node can be expressed as Since there are M reflecting element at the RIS, where each element works as a phase shifter, the total power dissipation at the RIS can be written as P RIS = MP b , where P b denotes the power consumption of each passive element. 3 In our system model, we consider N pair of IoT nodes and static power consumption at each node is denoted by P c .
Using (5) and (8), the EE metric can be defined as the ratio between the achievable sum rate and the total power consumption. Thus, the EE is given by In addition, the transmit power constraint for each transmit node is given by

III. PROBLEM FORMULATION
The primary objective of this work is to maximize the SE and EE of the network by jointly designing the transmit power budget for all the source nodes and the phase shift angles at the RIS. Accordingly, the master problems for both SE maximization (SEM) and EE maximization (EEM) are given below.

A. SE MAXIMIZATION
For SEM, we define the objective function by substituting (6) into (7) and then write the problem as Here, the constraint (11b) indicates the maximum transmit power constraint and manages the interference by making sure that the transmit power of the n-th source node doesn't exceed the maximum feasible threshold P max . The constraint (11c) ensures that the amplitude reflection coefficient of each element is equal to 1. Thus, the diagonal phase shift matrix has M unit modulus components on its main diagonal. With regards to a practical implication, this means that each RIS element cannot amplify the incoming signal, but only add a phase shift to the existing signal.

B. EE MAXIMIZATION
The EEM problem is formulated in a similar way to the SEM case, with the primary distinction that the cost function is now replaced by the EE metric from (9). Accordingly, the maximization problem for EE can be given as It is difficult to get the optimal solution to the problems (11b) and (12a) due to the non-convex nature of the cost functions and the coupling of the variables p and . Hence, we divide both problems into two sub-problems and solve them alternately by employing alternating optimization techniques [35]. In particular, we solve the problem for fixed to obtain the optimum value of p and vice versa. The two subproblems i.e., phase-shift optimization and transmit power optimization and their corresponding solutions are presented in the following sections.

IV. SPECTRUM EFFICIENCY MAXIMIZATION
The SEM problem is decomposed into two sub-problems as shown below to obtain the optimal solution efficiently.
1) Phase shifting optimization (PSO): This sub-problem provides an optimal phase shift matrix that maximizes the SE of the network from all possible combinations of angles for each RIS element for a particular transmit power. In particular, when p is fixed, the problem in (11b) can be relaxed as 2) Transmit power optimization (TPO): This sub-problem designs the transmission power for each IoT node to maximize the SE of the network for a particular . Accordingly, for fixed , the optimization problem can be relaxed as Based on the above two sub-problems, in the following, we develop a tractable algorithm to solve the master optimization problem efficiently.

A. ALGORITHM DESIGN FOR PSO
By defining the combined channel as z kn = diag(f H )g k ∈ C M ×1 and substituting it into (4), the received signal y n can be written as Now, for fixed p, the optimization problem (11b) is reduced into (13a). For ease of design, we define the effective channel for reflecting one-hop propagation and direct propagation as respectively. Now, the sub-problem (13a) can be represented as where Here, f (θ ) is continuous and derivable. Besides, the constraint sets of θ form a complex circle manifold. Therefore, to obtain the solution of sub-problem (17a), we extend the conjugate gradient technique to Riemannian manifolds [34], [36]. The Riemannian gradient of function f (θ ) at point θ i denoted by gradf is the orthogonal projection of the Euclidean gradient f into complex circle manifold. Accordingly, the Riemannian gradient can be written as where the Euclidean gradient of the objective function in (19) is given by with parameters Now, with the Riemannian gradient at hand, abundant optimization techniques developed for the Euclidean space can be incorporated into manifold optimization [25]. Accordingly, we can find the direction of search of the conjugate gradient for each iteration using where the transport function τ (·) is defined as and β i is conjugate gradient update parameter known as Polak-Ribiere parameter [37], [38]. After calculating the Find θ i+1 using (23).

5
Determine Riemannian gradient gradf using (19). 6 Calculate vector transport τ (d i ) by (22). 7 Choose Polak-Ribiere updating parameter β i . 8 Calculate search direction d i+1 using (21). 9 Update i = i + 1. 10 end 11 Put the optimal θ into diagonal element of matrix . 12 Output: search direction, we find the destination using retraction operation, where the tangent vector is projected back into the complex circle manifold as Here, α i is the Armijo step size [38]. The Riemannian gradient method (RGM) is summarized in Algorithm 1.

B. ALGORITHM DESIGN FOR TPO
With the obtained from Algorithm 1, the sub-problem (11b) now reduces to (14a). However, the sub-problem (14a) is still non-tractable and hard to solve due to its non-convexity and non-concavity. To solve it, the achievable sum-rate in the objective function is rewritten as a difference of convex functions (DCF). For the ease of design, we define new variables r 1 and r 2 and write the sum-rate as Here, Before implementing the DCF algorithm, to solve the subproblem, we linearise the concave part r 2 (p) similar to [29] at a given p (i) as Then, the sub-problem (14) can be written as s.t. 0 ≤ p n ≤ P max ∀n = 1, 2, . . . , N .
The above problem can be solved using CVX [39] in an iterative manner. The algorithm for solving the sub-problem (14a) is summarized in Algorithm 2.

Algorithm 2 TPO for SEM
1 Initialization: Initialize R, p (i) , I max = 1000, and = 10 −3 2 for i = 1 : I max do 3 Find the optimal value of p using (27a) 4 Set the value of p (i) = p 5 Calculate R (i) with optimized p using (7) to obtain the p * . 4: Calculate SE with obtained p * . and * . 5: Output: R * 1) REMARKS 1) Convergence: Utilizing the PSO and TPO algorithms, the holistic SEM algorithm for solving the SEM problem (11b) can be formulated, which is summarized in Algorithm 3. Note that the PSO and TPO here are deeply coupled. Since the problem (11b) is not jointly convex over the optimization variables, the proposed algorithm does not guarantee to converge to the global optimal solution. Because of the nonconvexity of the optimization problem, we need to choose good initialization points to obtain a sub-optimal solution with a good performance. Reasonable choices for initialization points, such as right singular matrices, random matrices and interference alignment (IA) can be found in [40]. Since the updates through Algorithm 1 and Algorithm 2 all maximize the objective function at each iteration, the iterations in Algorithm 3 lead to monotone increase of the cost function in (11b). Since the objective function under the power and amplitude reflection coefficient constraints is bounded, the convergence of the alternating maximization algorithm can be guaranteed with the monotonic convergence theorem [41]. Furthermore, since the cost function in (11b) is differentiable, it follows from the general optimization theory [41], [42] that a block coordinate ascent method converges to a stationary point of problem (11b). Based on these analyses, the convergence of the Algorithm 3 can be guaranteed with the fractional theorem obtained in [43].
2) Complexity: The total complexity of the SEM algorithm is the summation of the complexities of the PSO (Algorithm 1) and TPO (Algorithm 2). The complexity of Algorithm 1 is dominated by step 5, i.e., computing the Euclidean gradient, which is O (IM 2 N 2 ), where I is the VOLUME 10, 2022 maximum number of iterations. The retraction step also requires iteratively searching the armijo step size i.e., α i , but fortunately the complexity is only O(N 2 M ) and can be ignored when M is large. Accordingly, the total complexity of the Algorithm 1 is O(IM 2 N 2 ).
The complexities for solving step 3 and step 5 in Algorithm 2, which is given by equation (27a) and (7) are O N (2M 2 + M ) and O(N 2 M 2 ), respectively, while the rest of the terms can be ignored [29]. Hence, the total complexity of Algorithm 2 is in the order of O I N (2M 2 + M ) + N 2 M 2 . Accordingly, the total complexity of the SEM algorithm can be approximately given as

V. ENERGY EFFICIENCY MAXIMIZATION
In this section, we design the algorithm for EEM. The PSO for this case is the same as SEM and hence, Algorithm 1 is first implemented to obtain the optimal phase shifts for the RIS elements. Next, the TPO algorithm for the EEM is designed. First, we rewrite the achievable sum rate as DCF, similar to TPO for SEM. Then we linearise the concave part r 2 (p) for a given p (i) . Accordingly, the EEM sub-problem in (12a) can be reformulated as To solve the above problem, we introduce a non-negative pricing parameter λ. The optimal solution p * of the EEM problem can be obtained by finding the optimal λ as given in Lemma 1.
Lemma 1: Let f 1 (p) = r 1 (p) − r 2 (p (i) ) − p T * ∇r 2 (p (i) ) and f 2 (p) = N n=1 (p n + 2P c )+P RIS . Then, the optimal power p * is achieved by the maximum non-negative pricing parameter λ * such that with f 1 (p) > 0 and f 2 (p) > 0. From Lemma 1, we understand that a fractional form of a function is equivalent to its subtractive form, which shares the same objective and constraint values. Hence, λ * is the optimal price, if and only if the optimal transmit power with respect to λ * satisfy the equation In the above, setting λ * = 0 to maximize (30) is not feasible as the transmit power cannot be equal to zero. Now, based on (29) and (30), we can rewrite the sub-problem as

Algorithm 4 TPO for EEM
1 Initialization: Initialize p (i) , λ (0) = 0, I max = 1000, and = 10 −3 2 for i = 1 : I max do 3 Find the optimal value of p using (31a) 4 Update the λ (i) using (32) The optimal value of the non-negative pricing parameter λ * can be found by iteratively solving the sub-problem (31a). In each iteration, the non-negative pricing parameter is updated as The details of the algorithm for TPO for EEM are shown in Algorithm 4.

Algorithm 5 EEM Algorithm
1: Solve (13a) for fixed p using Algorithm 1 to obtain θ * . 2: Put the optimal θ * into diagonal element of matrix . 3: Solve (31a) with the obtained using Algorithm 3 to obtain p * . 4: Calculate EE using (9) with the obtained p * and * . 5: Output: EE * 2) REMARKS 1) Convergence: The PSO and TPO in the EEM algorithm are deeply coupled similar to the SEM case. The iterative alternating algorithm for solving the EEM problem (12a) is given in Algorithm 5. Since the updates through Algorithm 1 and Algorithm 4 all maximize the objective function at each iteration, the iterations in Algorithm 5 lead to monotone increase of the cost in (12a). Since the objective function under the power and amplitude reflection coefficient constraints is bounded, the convergence of the alternating maximization algorithm can be guaranteed with the monotonic convergence theorem [41]. Furthermore, since the cost function in (12a) is differentiable, it follows from the general optimization theory [41], [42] that a block coordinate ascent method converges to a stationary point of problem (12a). Based on these analyses, the convergence of the Algorithm 5 can be guaranteed with the fractional theorem obtained in [43].
2) Complexity: The complexity of the EEM algorithm is the summation of the complexities of the RGM and the pricing-based approach. The RGM's complexity is already discussed in the previous section, which is in the order of O (IN 2 M 2 ). With regards to the pricing-based approach of Algorithm 4, the complexities are O(N (2M 2 + M )) for step 3 and O(N 2 M 2 ) for updating the non-negative pricing parameter in step 4. Hence, the complexity of this approach can be given as O I (N (2M 2 + M ) + N 2 M 2 ) . Accordingly, the complexity of the EEM algorithm can be approximately given

VI. EXTENSION TO IMPERFECT CSI CONSIDERATIONS
While the analytical results of this work can be considered as a theoretical performance upper bound, given the presence of channel uncertainty at the transmitting nodes in practice, more relevant and difficult problems of interest are the robust counterparts of (11b) and (12a) in the presence of bounded channel errors 4 [45], [46]. In this section, the CSI of the channels are assumed to be imperfectly known. Accordingly, the reflected channel from the RIS {f n } ∀n∈N can be modelled as Here, { f n } denotes the corresponding channel error vectors and {|| n || 2 ≤ ε n } ∀n∈N , where ε n is the radius of the uncertainty region known by the source node. Accordingly, with the imperfect CSI, the worst case SEM problem under channel uncertainty can be formulated as Similarly, the worst case EEM problem under channel uncertainty can also be formulated in a similar way, which is given as Due to the constraints (34b),(34c) and (35b),(35c) the problems (34a) and (35a) are semi-infinite in nature. The main challenge lies in the non-convex constraints over the CSI uncertainty regions and the non-convex unit-modulus constraints. To solve these problems, one may derive equivalent constraints in linear matrix inequality (LMI) forms, so that the problems can be turned into equivalent semidefinite programming (SDP). These can then be efficiently solved by standard interior point methods. 4 A stochastic error model may also be considered as given in [44].

VII. NUMERICAL RESULT
In this section, we validate the analysis presented so far by numerically investigating the SEM and EEM algorithms for an RIS assisted IoT network.

A. SIMULATION SET-UP
N IoT node pairs are placed randomly based on uniform distribution in a 100m×100m positive quadrant as illustrated in Fig. 2, where S N and D N denote N -th source node and N -th destination node. 5 We assume the direct propagation path between a source node and a destination node to be dominated with non-line-of-sight (NLoS) components and hence follow Rayleigh fading. The channel is generated as h kn ∼ CN (0, 1), where CN (µ, σ 2 ) denotes the circularly symmetric complex Gaussian (CSCG) distribution with mean µ and variance σ 2 . Meanwhile, we consider the reflecting one-hop propagation channel to follow Rician fading because we assume that the RIS is placed in a way that it is not obstructed by any obstacles and has line of sight (LoS) coverage with both the source and the destination nodes. Hence, the channel vector f n is given by [28] where ε is the Rician factor, andf n ∈ C M ×1 , andf n ∈ C M ×1 are the LoS and NLoS components, respectively. While the LoS components can be generated by e −j 2π λ (d) , the NLoS components generated by CSCG distribution. We also applies the same channel model for the channel between the RIS and n-th source node g n , which is modeled as 5 Stochastic geometry can also be used to evaluate the average behavior over many spatial realizations of the IoT network whose devices are placed according to some probability distribution. VOLUME 10, 2022 In the above L(d) is the distance-dependent path-loss factor given as where C 0 is the path-loss at the reference distance D 0 = 1 m, d denotes the distance between each sourcedestination pair, and α denotes the path-loss exponent. The rest of the simulation parameters are summarized in Table 1. Now, to evaluate the performance of the proposed IoT network, we compare the SE and EE performance of the SEM and EEM algorithms with respect to two baseline scenarios: • Random Phase Shift: In this scenario, we select the phase shift randomly, but uniformly with the randomization parameter ν. Accordingly, the initial phase shift for each element is defined as θ m = e jν2π . Reconfiguration is not performed in this case and we directly maximize the SE and EE of the network by solving the transmit power allocation sub-problem in (14a) and (19). This scenario involves the TPO case with random phase shifts for the RIS elements.
• Without RIS: In this scheme, we simulate the network without deploying any RIS, i.e., M = 0. Accordingly, the received signal at the destination node includes only the direct propagation path and hence, y n can be expressed as This scenario involves the TPO case only.

B. SE COMPARISON
In this subsection, we assume that the RIS is located at the co-ordinates [50m,100m], while the location of the source and destination nodes are randomly generated in a 100m × 100m rectangular space except for Fig. 4, where a larger space is used to generate more number of IoT node pairs. All the simulation results are averaged over 10 3 channel iterations. In Fig. 3, we simulate the evolution of the proposed algorithms with a stopping threshold of = 10 −3 . In particular, for the optimal obtained through Algorithm 1, optimal p is calculated through Algorithm 2, and accordingly SE of the network is plotted with respect to iteration numbers  for a random initialization. It can be seen that the proposed algorithms converge after 4-5 iterations.
After establishing the convergences of the proposed SEM algorithm, in Fig. 4 we show the average SE performance of all three scenarios for an increasing number of IoT node pairs. We calculate the SE by evaluating the average total sum-rate of all the IoT nodes. It can be seen from the figure that the SE increases with the number of IoT node pairs. However, the growth gradually becomes slower as N increases. This is due to the multiple-node diversity gain, which is more significant when the number of nodes is small. The growth is also a measure of the fact that the passive beamforming at the RIS through optimal phase shift design can mitigate the interference created due to the increase in the number of nodes. Furthermore, it can be seen from the figure that the proposed technique significantly outperforms the rest, whereby it achieves the highest average SE among all other schemes.
Next, in Fig. 5, we illustrate the average SE performance with respect to the number of RIS elements. As can be expected, the number of RIS elements has no impact on the 103546 VOLUME 10, 2022 method without RIS. However, for the proposed method, the SE significantly increases with the number of RIS elements. This is not the case for the random phase shift scheme, which only shows marginal gains. This validates that applying passive beamforming through phase shift optimization in an RIS-assisted IoT network can mitigate the interference and increase SE.
In Fig. 6, we illustrate the average SE performance with respect to the distance between every node pair, i.e., the source node and the destination node of an IoT pair. In particular, by keeping the location of the RIS fixed, we vary the distance between the source and destination nodes. As can be seen from the figure, the average SE decreases with an increasing value of d for the scenario without RIS, which is due to the distance-dependent path-loss. However, what is worth noting is the performance of the network when it is assisted by an RIS. It can be seen from the figure that as the distance between the source and destination nodes increases, the SE first decreases, then increases and attains an optimal value before decreasing again. This can be explained as follows. When the nodes are closer to each other, the direct path is dominant over the reflected path. However, as the distance between the nodes increases, the reflected paths start dominating the direct path. At this point, the superiority of the proposed SEM algorithm can also be observed over the random phase shift case. In particular, the combination of the PSO and TPO in the SEM algorithm provides the best solution with respect to phase shift and power, respectively to achieve 2× the SE over the case with random phase shift at a source-destination separation of 35 m. This is further validated by the fact that when the separation between the nodes is small, e.g., 5m, the gap in performance between the three curves is minimal. This suggests that for a very small distance between IoT node pairs, deploying RIS may not be useful. However, the gap widens and becomes significant as d increases suggesting the impact of optimal phase shift design for the RIS. In particular, it can be concluded that if the distance between the nodes is between 27 − 37m, deploying an RIS can provide high SE. Finally, in Fig. 7, we show the average SE performance of the network with respect to the transmitted power in each pair. While in Fig. 7 (a), we compare the performance of the proposed algorithm with the other two scenarios, in Fig. 7 (b) we show the effect of increasing the number of elements in the RIS. It can be seen from Fig. 7 (a) that for any particular transmit power, the proposed algorithm achieves much higher SE than the other two scenarios. Next in Fig. 7 (b) it can be seen that for any particular transmit power, increasing the number of reflecting elements increases the SE of the network. This validates the efficacy of implementing RIS in an IoT network.

C. EE COMPARISON
In this subsection, we analyze the EE performance of the IoT network based on the proposed EE algorithm. Here, we set the circuit power at each node P c = 15dBm. Since the power consumption for phase shifting in the RIS's elements is relatively small, we assume P b = 1mW . The rest of the parameters are the same as used in the previous subsection.
The evolution of the EE algorithm is shown in Fig. 8. In every iteration, λ is updated with a stopping threshold parameter = 10 −3 . From the figure, it can be observed that the EE curve converges after around 5 iterations.
In Fig. 9, we plot the average EE for an increasing number of IoT nodes. It can be seen from the figure that the proposed algorithm achieves the highest average EE compared to the baseline schemes. Furthermore, the performance of the network decreases when the number of IoT node pairs is increased. This is due to the rise in total power consumption. As more IoT node pairs are added, the power consumption of the network increases because of the transmit and circuit power consumption from each IoT node. Although the SE increases due to phase shift optimization, the power consumption is still very high which dominates the logarithmic increase of SE with respect to the transmitted power.
Nevertheless, the above can be somewhat tackled by increasing the number of RIS elements, which is illustrated in Fig. 10. In particular, this figure compares the EE of the network with respect to the number of RIS elements. It can be seen from the figure that the performance of the proposed algorithm initially increases and then saturates as M increases. The initial increase in the EE is due to the following reasons: i) a large number of M leads to higher SE as was seen in Fig. 5 and ii) since RIS exploits passive beamforming only and no radio frequency chains are required, the power consumption of the network doesn't increase drastically when M increases. Nevertheless, some amount of power is consumed by the RIS as was seen in (9). Accordingly, when the number of elements increases beyond a certain point (M > 100), P RIS accumulates to a substantial value and starts saturating the EE curve.
In Fig. 11, we illustrate the average EE performance of the IoT network with respect to the distance between every node pair, i.e., the source node and the destination node of an IoT pair. In particular by keeping the location of the RIS fixed, we vary the distance between the source and destination nodes. As can be seen from the figure, the average  EE decreases with an increasing value of d for the scenario without RIS, which is due to the following two reasons: i) path-loss increases with increasing d, which results in reduced rates and ii) the source node transmits with a higher power to encounter the effect of distance-dependent path loss. Further, similar to the SEM case in Fig. 6, it can be seen from the curves with circular marker and square marker that as the distance between the source and destination nodes increases, the EE first decreases, then increases and attains an optimal value before decreasing again. Note that both the curves are for the system aided by RIS. This unusual result can be explained as follows. When the nodes are closer to each other, the direct path is dominant over the reflected paths from the RIS and the decrease in EE follows a similar trend to that of the scenario without RIS. However, as the distance between the nodes increases, the reflected paths start dominating the direct path. At this point, the superiority of the proposed EEM algorithm can be observed, whereby the average EE starts to increase. However, the performance gain is sustainable up to a specific distance only, i.e 25m-45m. This result highlights the fact that for very small or very large distances between IoT  node pairs, deploying RIS may not be useful in terms of EE performance. Furthermore, the superiority of the proposed EEM algorithm can also be observed in this figure over the random phase shift case. In particular, the combination of the PSO and TPO in the SEM algorithm provides the best solution with respect to phase shift and power, respectively to achieve the maximum EE. In summary, based on the figure, we can state that for the considered system model, applying RIS is the most energy-efficient when the distance between source and the destination node is 27 − 37m.
The above results ( Fig. 6 and Fig. 11) are interesting in the sense that while they justify a few seminal works regarding the placement of the RIS, it also shows the exact distance in terms of values where optimum performance in SE and EE can be obtained for the considered system model. This may act as a design guideline for system engineers.
Finally, in Fig. 12 we compare the EE performance of the network for various transmit power budgets P max . It can be seen from the figure that as the maximum transmit power increases, the average EE for each scenario increases in the beginning and then becomes constant after a certain  point (P max = 20). This is due to the EEM algorithm finding the optimal power, which is illustrated further in the following sub-section.

D. TRADE-OFF BETWEEN SEM AND EEM
In this subsection, we analyze the trade-off in performance between SE and EE maximization. Accordingly, Fig. 13 depicts both SE and EE for increasing transmit power budget. For a high transmit power budget, the SEM algorithm can improve the average SE ( Fig. 13 (a)) at the cost of degrading the average EE ( Fig. 13 (b)). Meanwhile, in Fig. 13 (a), the average SE of the EEM algorithm remains constant after a certain point while SEM linearly improves as P max increases. Next, in Fig. 13 (b), the average EE of the EEM algorithm gradually saturates after a certain power level, while the performance of the SEM algorithm rapidly decreases as P max increases. This can be explained by the fact that in order to maximize the SE, more power budget is required in the SEM design. This makes the transmit power to linearly increase in the high transmit power regime. Nevertheless, the SE only increases on a logarithmic scale with respect to the transmitted power. This becomes quite significant in the high transmit power regime. Hence, the EE of the SEM algorithm decreases at a high transmit power region. The EEM algorithm on the other hand finds an optimal transmit power and if that power is less than the maximum transmitted power, the TPO method ensures that the system does not transmit at full power. Hence, the EE of the EEM algorithm remains constant after it attains a certain peak power.

VIII. CONCLUSION
Two resource allocation problems, namely spectrumefficiency maximization (SEM) and energy-efficiency maximization (EEM) were studied for an RIS-assisted IoT network. In particular, the transmit power of the IoT nodes and phase shifts at the RIS were jointly optimized under the transmit power constraint and practical phase shift consideration. To solve the non-convex problems, the primary optimization problem for both SE and EE was divided into PSO and TPO sub-problems. While for the SEM, the subproblems were solved using PSO (Algorithm 1) and TPO (Algorithm 2), respectively, for the EEM case, Algorithm 1 and Algorithm 4 were used. Simulation results demonstrated the effectiveness of the proposed algorithms and have elucidated several insights on the deployment of RIS to attain a spectrum-and energy-efficient IoT network.

ACKNOWLEDGMENT
The collaboration between Sudip Biswas and Keshav Singh is an outcome of the MoU: IIITG/NSYSU 20200728 signed between IIIT Guwahati and NSYSU.