RIS-Aided Mobile Localization Error Bounds Under Hardware Impairments

Reconfigurable intelligent surfaces (RISs) are a recent yet revolutionary development in communications systems. Particularly applicable to millileter wave (mmWave) systems, these surfaces can increase localization performance and decrease vulnerability to environmental influences, all by adjusting the incoming signals’ phase. At the same time, manufacturing ideal hardware to be deployed at the transceivers is not feasible nor practical. These non-linearities in hardware, collectively known as hardware impairments (HWIs), cause signal degradation and adversely affect localization. In this paper, the effect of HWIs on RIS-aided localization is examined. Towards that, the mean squared error (MSE) of the user’s position is found through a maximum likelihood estimator (MLE) and its functionality is verified by the position error bounds (PEB), derived from Cramér-Rao lower bounds (CRLB). Our numerical results show that active RISs mitigate the deteriorating effect of HWIs on the user’s PEB. Based on our outcome, increasing the inter-RISs space generally creates more resolvable paths and leads to improved localization.


I. INTRODUCTION
A CCORDING to the Cisco Annual Report from 2020, the number of internet users is projected to increase by 15% from 2018 to 2023. Moreover, the number of mobile devices is expected to increase by nearly 5 billion [1]. In response to such growing connectivity, fifth generation (5G) wireless networks have been deployed in some developed and developing countries. However, there is a need for technologies that can support all 5G and beyond application requirements, including escalated mobile broadband, ultra low latency communication and massive communication [2]. Besides, the complexity, cost and energy consumption of multiple-input multiple-output (MIMO) millimeter wave (mmWave) communication systems have become a pivotal concern [3]. For this reason, nowadays, researchers are more focused on a brand-new technology with Localization is one of the main features of 5G mmWave communication systems. The multiple paths, due to the RISs, make the estimation of angle of departure (AoD), angle of arrival (AoA) and time of arrival (ToA) achievable [9], [10]. For example, the works in [11], [12], and [13] used a combination of AoD, AoA and ToA to find the position error bound (PEB) and the orientation error bound (OEB) of the user equipment (UE). Even more, [14] proved that RIS has a significant effect on localization under asynchronous condition. Moreover, [15] noted that RIS makes joint localization and synchronization possible, using only downlink multiple-input single-output (MISO) transmission. In addition, near-field positioning is done using a proper RIS phase design and another two algorithms by [16] and [17], respectively. In [18], multitarget localization is performed, whereas in [19] the authors optimized RIS phase shifters using the hierarchical code book (HCB) algorithm. Moreover, [20] and [21] proposed novel methods for an RIS-aided communication system. The former exploited the sparse nature of mmWave communication system in an attempt to estimate the channel while the latter used a multidimensional orthogonal matching pursuit (MOMP) strategy for compressive channel estimation. RIS is profitable for indoor localization as well, in which the blockage can be compensated; [22] combined RIS and ultra wide band (UWB) signals for this purpose. Furthermore, the authors in [23] designed a novel algorithm in order to solve the environment sensing problem in a multi-user RIS-aided communication system.
At the same time, the localization accuracy is affected by hardware impairments (HWIs) at the transceivers. Ideally, baseband samples at the transmitter generate the accurate passband signals; then, at the receiver side, the signal is reliably demodulated [24]. However, this is not achievable since manufacturing the transceivers often comes with some minor deficiencies and non-linearities, known as HWIs. It is well-known that hardware impairments (HWIs) limit the system's performance. For example, it is shown in [25] that HWIs cause major degradation to the localization performance of the UE. Furthermore, the work in [26] studied the effect of HWIs on a reconfigurable intelligent surface-based Space shift keying (RIS-SSK) communications system; the results demonstrated that RIS-SSK performance was degraded in the presence of HWIs even in high SNR regions or when using an increased number of reflectors. The studies in [27] examined the impact of transceiver impairment on the spectral efficiency (SE) and energy efficiency (EE) performance of the RIS-aided wireless systems; the results showed that the destructive effect of hardware imperfection cannot be neglected. Moreover, this study revealed that the SE saturates in the high SNR region, and no further improvement can be obtained, neither by increasing the number of RISs nor by increasing the transmit power. The investigation in [28] analyzed the potential of RIS-aided communication systems assuming both HWIs and correlated channel conditions. Based on their results, the correlation between fading channels degrades the system's performance, which has a significant impact as the correlation becomes stronger. Interestingly, this effect decreases while increasing the number of reflectors. Although [27] studied the effect of HWIs on RIS-aided wireless communication, its effect on the UE's localization has not been studied yet. In this paper, we examine the effect of this imperfection on the RISaided single-input single-output (SISO) communication system to see how RIS compensates the degradation originating from the HWIs.
To the best of our knowledge, the effect of HWIs on mmWave RIS-aided localization has not been studied yet. In this paper, we present a scenario in which RIS assists the localization process affected by HWIs. Focusing on the uplink transmission and considering both line of sight (LoS) and non-line of sight (NLoS) paths (reflected from the RISs) and by verifying the applied maximum likelihood estimation (MLE) with the CRLB, our main contributions can be summarized as • Calculating and analyzing the mmWave RIS-aided localization error bounds in the presence of HWIs at both source and destination. • Optimizing the RISs' phase corrections to steer the signal towards the UE and subsequently maximize the SNR.
• Designing an MLE to estimate the user's position, and verify its functionality by the position error bound (PEB), derived from the Cramér-Rao lower bounds (CRLB). • Studying how much the localization can benefit from the RISs to overcome the degradation caused by HWIs. • Studying how much increasing the number of passive elements in each RIS and increasing the number of RISs can help reducing the localization bounds. • Discussing the differences between the behavior of SNR and the positioning performance. The rest of the paper is organized as follows. Section II provides the signal and channel model affected by HWIs. After estimating the unknown channel parameters in section III using MLE, their Fisher information matrix (FIM) is determined in section IV, followed by the transformation to the location parameters' FIM. In order to optimize the RISs' control matrix, the RIS resource allocation is presented in subsection IV-C. Section V provides the simulation setup and discusses the numerical results. Finally, section VI concludes the paper.
Notations: Lower-case letters are used for scalars. The column vector and the matrix are denoted as bold-face lowercase and capital-case letters, respectively. The E{·} is used for the statistical expectations, [A] m,n for the element located in the m th row and n th column of the matrix A, (.) T and (.) H are the transpose and complex conjugate transpose operators, respectively. . is L 2 norm of a vector, R N and R N×M are the N -dimensional and N × M dimensional real matrix space, respectively. Moreover, CN ∼ (0, σ 2 n ) represents the complex Gaussian distribution with zero mean and σ 2 n variance. Furthermore, 1 n represents a vector of n ones.

A. Geometric Model
We assume a 3D scenario as shown in Fig. 1, considering an uplink transmission that consists of a base station (BS) and a UE, each with a single antenna. We consider a wall mounted with a series of G-RISs, each with an M-element uniform rectangular array (URA) on the xy-plane. Here, M = M x M y and there are M x and M y elements located on the x and y axis, respectively, with spacing λ 2 , where λ denotes the signal wavelength. The inter-RIS spacing D is assumed to be the distance between neighboring RISs. We assume that only G RISs can be activated, where G ≤ G. Both the BS and the UE are affected by HWIs with factors κ s and κ r at the transmitter and receiver, respectively. In this scenario, the wall is located at the cell's edge, where each RIS is placed at x g = [x g , y g , z g ]. The BS and UE are located at the origin and x = [x, y, z], respectively.

B. Signal and Channel Model
Considering the HWIs model in [24], and taking mmWave communication into account, the UE transmitted signal f (t) can be modeled as in which κ s is the HWI factor at the transmitter antenna, η s is the source additive distortion noise with mean zero and variance σ 2 ηs = E(1 − κ s ), and E is the power of the transmitted signal s(t). The received signal at the BS, consisting of LoS and reflected signals from RISs, can be written as where f (t) is the signal affected by HWIs, Ω g ∈ M ×M is the diagonal controlling matrix, η r is BS additive distortion noise with mean zero and variance σ 2 is the proper white Gaussian noise with power spectral density (PSD) N 0 . Here, κ r is the BS's HWIs factor. The g th path channel gain β g , for the LoS path (g = 0) and the reflected paths (g = 0) can be presented as where x and x g represent the UE and g th RIS locations. Moreover, f c is the carrier frequency. τ 0 = x /c is the LoS path delay while τ g = x g /c + x − x g /c are the reflected path delays and c is the propagation speed. Furthermore, λ = c/f c is the signal wavelength and 0 ≤ Γ ≤ 1 is the reflection coefficient when the corresponding RIS is inactive. Furthermore, h g ∈ C M×1 is the UE-to-RIS response vector, and g g ∈ C M×1 is the RIS-to-BS response vector, [29] and [12]. Defining (m = 0, · · · , M − 1), the RIS response vectors can be found as where k(φ azg , φ elg ) is the wave number vector in the azimuth direction φ azg and elevation direction θ azg , and which can be calculated as Δ is the antenna location matrix, and assuming a starting point at (0; y 0 ; z 0 ), for the (m x , m y ) th element of g th RIS, can be written as sg(1) ) and φ elg = cos −1 (

sg(3)
sg ) are the azimuth and elevation AoA of the received signal in g th RIS from UE. θ azg and θ elg are the azimuth and elevation AoD of the transmitted signal from the g th RIS to the BS. 1 For the best UE localization performance, as the controlling matrix Ω g will control the phase of departed signal from RIS, it needs to be optimized. Note that, h g T Ω g g g = 1, when g = 0 in the LoS path. The optimization procedure will be explained in detail in subsection IV-C. Now, by substituting (1) into (2), we have in which κ = √ κ s κ r . In order to derive the error bounds, the variance of the received noise needs to be calculated. Towards that, first, we separate the signal and noise parts of the received signal in (8), as μ(t) and w(t), respectively as follows According to (10), and based on the calculated variance of the distortion noises, the received noise variance, σ 2 w , can be calculated as below Note that, based on derivations in subsection IV-C, in order to attain maximum SNR, h T g Ω g g g = 1. After signal acquisition and conversion to the frequency domain by discrete Fourier transform (DFT) in (9), the observation at the n-th point becomes in which F [n] = 2πnW N +1 and where N is the total number of the points.

III. CHANNEL ESTIMATION USING MLE
In this section, we propose an MLE design to estimate the unknown channel parameters. For this purpose, we first assume one RIS, then we extend it to G RISs. It is also practical to assume that the RIS location, the BS location, the noise variance N 0 in (11), the transmitted signal and the HWIs parameters are all known. Based on this, the unknown channel parameters are the ToAs, AoA and AoD which are grouped in ϕ MLE as where ρ g = |β g | and φ g = ∠β g . Our goal is to estimate ϕ MLE . Some of the elements in (13) are helpful in determining the location of the UE, including The relationship between the UE position and the channel parameters of interest can be given as Moreover, we need to estimate {τ 0 , τ 1 , φ az1 , φ el1 } by taking the nuisance parameters {ρ 0 , ρ 1 , φ 0 , φ 1 } into account. Note that since τ 1 can be calculated through τ 0 , it can eliminated from the group of unknown parameters that need to be estimated. Consequently, the ML estimator for ToA, AoA and AoD becomes where L(ϕ MLE ) = log(P (r|ϕ MLE )) represents the log likelihood function of the received signal in (8), which is the set of all observations for the unknown channel parameters, and P () is the conditional probability density function (PDF) of r. Based on (8), we can write the log likelihood function as where r = [r[0], . . . , r[N − 1]] T and δ g is defined as Now, to achieve the parameters of interest, {τ 0 , τ 1 , φ az1 , φ el1 }, we need to find the estimated values of the nuisance parameters {ρ 0 , ρ 1 , φ 0 , φ 1 }. So, for the estimation of φ 0 , we need to set ∂L(ϕMLE) ∂φ0 to zero as follows Defining A ij δ i H δ j and b i δ i H r, then, Similarly, by setting ∂L(ϕMLE) ∂φ1 = 0, we get By solving (18) and (19), we can find e jφ0 and e jφ1 as .
Considering G RISs, an extension will be applied to the derived equations (see appendix A). Unfortunately, (23) and its special case in (25) do not have closed-form solutions when trying to estimate the desired parameters. Therefore, a numerical search is utilized instead. The pseudo-code in order to estimate the channel parameters ϕ MLE in (13) is given below.  (14).

IV. 3D LOCALIZATION PROBLEM
The CRLB is a performance parameter that gives a lower bound for the estimation error variance in a set of unbiased estimates. It can therefore be used as a benchmark to evaluate the estimator's performance [30]. In this section, our goal is to obtain the UE PEB (CRLB) using the received signal r(t) with optimized diagonal matrix Ω g . To achieve this, we need to accomplish three steps: first, we derive the Fisher information of unknown parameters ϕ {τ , φ az , φ el , β R , β I }, where β R and β I are the real and imaginary parts of the channel gain β. Then, we calculate the equivalent FIM (EFIM) for the channel parameters ϕ CH {τ , φ az , φ el }. Finally, we transform the channel parameters ϕ CH to location parameters ϕ L {x}.

A. Fisher Information Analysis
We now derive the FIM of the vector ϕ, which contains 5G + 3 parameters and can be defined as where β Rg and β Ig are also the real and imaginary parts of the g th path channel gain β g . Then, the corresponding FIM is denoted as in which J ϕCH and J ϕN are the channel and the nuisance parameters' FIM, respectively, and J ϕCN is the mutual information of the channel and nuisance parameters. The matrices in (27) can be written as follows The full derivation of the elements of (27) is provided in appendix B. The FIM J ϕCH contains important information about the UE's location. In order to eliminate the effect of nuisance parameters ϕ N from the channel parameters ϕ CH , the Schur complement can be utilized as below [32] where J e ϕCH is the EFIM of the channel parameters.

B. FIM of the Location Parameters
With a focus on presenting the position error bound, the derived EFIM in (32) needs to be transferred to the location parameter ϕ L [x]. To that end, the transformation matrix γ is defined as below A complete derivation of the transform matrix γ is provided in appendix C. Thus, the EFIM of the location parameter, J e ϕL , can be computed as Finally, the diagonal elements of the inverse matrix of J e ϕL contains the position error bounds which can be derived as where C = J e ϕL −1 .

C. RIS Resource Allocation
Similar to [11], we consider two variables when allocating RIS resources: the vector a = [a 1 , a 2 , . . . , a g ] and the controlling matrix Ω g = diag e jωg,0 , . . . , e jωg,M−1 , where ω g = [ω T 1 , . . . , ω T G ] T . The first variable (i.e., a) represents the inactive RIS when a g = 0 and active RIS when a g = 1. For the inactive case, the RIS acts as an omnidirectional reflector, so that Ω g = I M . On the other hand, if the RIS is active, Ω g needs to be optimized in order to minimize the error bounds. The mentioned optimization problem can be formulated as where W is the signal bandwidth and d min (a) is the minimum distance between any two active RISs. Now, achieving maximum SNR minimizes the PEB. Based on the signal model in (12) and the received noise variance in (11), the SNR can be calculated as (37) As it can be seen from (37), the SNR is maximized if the term |h T g Ω g g g | 2 is maximized [11]. By noting the term and by the given active RIS vector (i.e., a), the optimization over ω g is effortless and can be obtained as Note that, from (8), both active and inactive RISs are used in order to localize the UE.

A. Simulation Setup
In this simulation, we consider uplink transmission, in which the receiver (BS) is located at the origin, 10 m above the transmitter (UE), and both are under the effect of HWIs. The UE is assumed to be located anywhere in one sector of a 50 m radius cell on the xzplane. Both the UE and BS are equipped with a single antenna and operate at frequency f = 38 GHz. In order to assist the UE localization, three RISs, each equipped with 100 elements, are located in one edge of the cell in the xy-plane, with x g (3) = 25 √ 3. The elements of the RIS form a 10 × 10 URA.
Similar to [33], we pass the transmitted signal through a unit energy ideal sinc pulse shape filter so that the signal has the bandwidth W = 125 M Hz. Additionally, in order to implement the frequency conversion through DFT, we chose 129 points. Moreover, the noise variance N 0 is set to −89 dBm. Assuming three different locations for the UE in the mentioned sector, we average the earned mean squared error (MSE) results in section III and the earned PEB through CRLB in section IV. Fig. 2 illustrates the UE position obtained by MLE along with the UE PEB derived through CRLB with respect to the HWIs factor κ for different numbers of active RISs. Here, we consider the practical range for κ ∈ [0.9, 1] [24]. Comparing the MSE and PEB curves indicates that the MSE curve stands above its corresponding PEB one, proving in turn that our presented MLE algorithm performs correctly. Even more, as κ moves towards 1, i.e., perfect hardware conditions, the estimated position error approaches the least position variance, i.e., CRLB; this occurs because the SNR rises when there are no hardware impairments.

B. Performance Analysis
On the other hand, it can also be seen from this figure that when one RIS is active, both PEB and MSE rise sharply from 9 to 32 and from 13 to 100 centimetres (cm), respectively. However, activating one more RIS, and having the third RIS acting as a reflector, improves the localization performance by 2.4 cm for PEB and 1.5 cm for MLE for κ = 1. This is due to the phase correction applied to the active RIS, which maximizes the SNR. It is evident that activating more RISs overcomes more blockage and loss of incoming signal. In other words, the more active RISs there are, the better the localization performance. Moreover, by activating three or more RISs, both PEB and MLE become more steady as κ strays away from 1. Compared to the error bounds found through CRLB, the MSE worsens more aggressively with HWIs.
To assess how the behavior of the error bounds is similar to the SNR, Fig. 3 is provided. As can be seen from this figure, activating more RISs improves the SNR value. This improvement is more explicit when there are no hardware impairments. In general, in comparison with the error bounds, by activating more RISs, SNR change is less explicit. For example, when κ = 0.95, increasing 1 active RIS to 2, improves the SNR by 0.05 dB. However, this improvement is 14.67 cm for MSE. The SNR also deteriorates due to HWIs and this deterioration has the same slope for different numbers of active RISs. Fig. 4 examines the number of elements in each RIS and the number of RISs to see which one stands more beneficial to enhance the localization performance when the system is affected by HWIs. Hence, we considered two scenarios. The first scenario has one active RIS with almost 2m elements. The second scenario has two active RISs, each with m elements. As the figure shows, activating more   RISs has superior performance than using more elements in each RIS. This performance is due to the space between the elements. In other words, each element in the RIS is spaced by λ/2. However, the RISs are located 2-3 meters away from each other, which creates more resolvable paths at the receiver as the signals arrive with different delays. In addition, comparing PEB and MSE, once again, validates the correctness of the  estimation algorithm. Finally, with no HWIs (and so higher SNR) the MLE estimation errors merge with the calculated PEBs. We repeated this examination with a greater number of RISs. As shown from Fig.5, activating more RISs is greatly beneficial to user localization, even more so than adding more elements to each RIS. The results of such an investigation leads us to the discussion of Fig. 6. From this figure, it is clear that as the distance between RISs is increased, the PEB is decreased, which essentially justifies Fig.5.
The SNR of the discussed scenarios is presented in Fig. 7. By activating two RISs with fewer elements, the SNR is better than the case of activating one RIS with more elements; Here, more inter-RIS space results in more noticeable refinement in MSE and PEB than in SNR.
Finally, Fig. 8 presents the PEB corresponding to the UE location in the sector considering ideal conditions and two active RISs. When the UE is in the area between the BS and the RIS or close to one of them, its localization is more accurate than the corners, which have less access to both signal sources (these locations are the lighter dots in Fig. 8). This fact is due to the strong received signals in these cases.

VI. CONCLUSION
In this paper, the effects of hardware impairments (HWIs) on the user equipment (UE) localization with the assistance of the reflecting intelligence surfaces (RISs) are presented. As expected, due to the incoming signal's phase optimization by RISs, more active RISs lead to less localization error. Furthermore, our numerical results reveal that the presented maximum likelihood estimator performs accurately, as its value is greater than the error bounds derived through CRLB. It advances towards the PEB when there are perfect HWI conditions. On the other hand, signal-to-noise ratio (SNR) rises with more active RISs and as the HWI factor gets closer to 1. Moreover, the slope of the SNR, with respect to the HWIs factor κ, is the same for different active RISs. Furthermore, based on our results, activating more RISs with fewer elements is more helpful in the localization process than installing more elements in each active RIS. Future works based on this paper can consider multiple antennas at the transceivers. The effect of asynchronous transceivers in RIS-aided localization along with HWIs can also be examined.

APPENDIX A DERIVATION OF THE MLE CONSIDERING G RISS
Assuming G RISs, the log likelihood function in (16) becomes Then, in order to find the estimated value for φ g ; g ∈ {0, 1, . . . , G}, we calculate ∂L(ϕMLE) ∂φg per g th RIS. This way, we earn G equations as . . .
where A gi and b g are defined earlier in section III. Solving equations (41) provides the estimated e jφg as where, By substituting (42) into the (40), we get Now, by differentiating (43) with respect to ρ 2 0 ,ρ G g=0 ρ 2 g is earned aŝ By substituting (44) into (43), we can write In the case of no HWIs (i.e., κ = 1), the log likelihood function in (40) is given as Consequently, by assuming γ g ρ g e jφg , g ∈ {0, 1, . . . , G}, we earnγ g by maximizing as follows (46) After solving (47) for each g, we get G equations containing G unknowns. The augmented matrix of these equations is given as ⎡ After some simple calculations, we haveγ g = ψ g . By substitutingγ g into (46), equation (45) is earned for κ = 1 as below .
Note that equation (49) is the special case of equation (45) when κ = 1.

APPENDIX B DERIVATION OF FIM ELEMENTS IN RIS-AIDED 3D LOCALIZATION UNDER HWIS
In order to find the scalar elements in (28) The derived Fisher information for the interaction between the g th and g th paths is given as (52a)-(52o), shown at the top of the next page.

APPENDIX C DERIVATION OF TRANSFORMATION MATRIX IN RIS-AIDED 3D LOCALIZATION
According to the provided formula for τ , φ az and φ el in the subsection II-B, the following derivatives in (33)