# Angle-Domain Intelligent Reflecting Surface Systems: Design and Analysis

Xiaoling Hu, Caijun Zhong, and Zhaoyang Zhang X. Hu, C. Zhong, and Z. Zhang
are with the College of Information Science and Electronic Engineering,
Zhejiang University, Hangzhou, China (Email: {11631052, caijunzhong,
ning_ming}@zju.edu.cn).

###### Abstract

This paper considers an angle-domain intelligent reflecting surface (IRS)
system. We derive maximum likelihood (ML) estimators for the effective angles
from the base station (BS) to the user and the effective angles of propagation
from the IRS to the user. It is demonstrated that the accuracy of the
estimated angles improves with the number of BS antennas. Also, deploying the
IRS closer to the BS increases the accuracy of the estimated angle from the
IRS to the user. Then, based on the estimated angles, we propose a joint
optimization of BS beamforming and IRS beamforming, which achieves similar
performance to two benchmark algorithms based on full CSI and the multiple
signal classification (MUSIC) method respectively. Simulation results show
that the optimized BS beam becomes more focused towards the IRS direction as
the number of reflecting elements increases. Furthermore, we derive a closed-
form approximation, upper bound and lower bound for the achievable rate. The
analytical findings indicate that the achievable rate can be improved by
increasing the number of BS antennas or reflecting elements. Specifically, the
BS-user link and the BS-IRS-user link can obtain power gains of order $N$ and
$NM^{2}$, respectively, where $N$ is the antenna number and $M$ is the number
of reflecting elements.

##  I Introduction

Wireless networks are anticipated to connect over 28.5 billion devices by the
year 2022[1], giving rise to questions of coverage, quality of service,
reliability and energy consumption. Recently, the intelligent reflecting
surface (IRS) has been proposed as a promising technology to address these
questions, due to its features of both low energy consumption[2, 3, 4, 5, 6,
7, 8] and low hardware complexity[9, 10].

Specifically, an IRS is a meta-surface equipped with a large number of nearly
passive, low-cost, reflecting elements with programmable parameters[11, 12].
Assisted by a smart controller, each reflecting element independently reflects
the incident signal with adjustable phase shifts. With the ability to smartly
alter phase shifts, the IRS can generate directional beams which are
dynamically adjusted according to the operating requirements and conditions,
thereby realizing programmable propagation environments [13]. Given that there
is no amplifier used, the IRS is more energy-efficient than an Amplify-and-
Forward (AF) relay. Another benefit of the IRS is that it can potentially be
easily deployed, for example on building facades, due to its small size that
is the consequence of an absence of radio frequency (RF) circuitry [14].

Hence, IRS-aided communications have attracted considerable attention as a
promising means to realize dynamically adjustable wireless propagation
channels, which can be used e.g. to fill coverage holes at a low cost. In
particular, there have been a plethora of works on IRS beamforming, see e.g.
[15, 16, 17, 18, 14, 19, 20, 21, 22, 23, 24, 25]. In [15] and [16], the
authors first presented the joint optimization of IRS beamforming and BS
transmit beamforming. By applying a semidefinite relaxation (SDR) method, the
total transmit power at the base station (BS) is minimized. Later on, [17]
considered the minimization of the symbol error rate by iteratively optimizing
the phase shifts and BS precoder, while [18] focused on maximizing the
weighted sum-rate by adopting a Lagrangian dual transform technique under the
assumption of discrete phase shifts. Finally, in [14], the energy efficiency
maximization problem was solved via gradient descent search and sequential
fractional programming. Besides, the integration of IRS with other promising
technologies has also been investigated, for instance, non-orthogonal multiple
access (NOMA) [19], millimeter wave (mmWave) [20], simultaneous wireless
information and power transfer (SWIPT) [21], cognitive radio [26], two-way
relaying [27], and physical layer security [28].

All the prior works on IRS beamforming assumed that perfect channel state
information (CSI) is available at both the BS and the IRS. How to obtain this
CSI, however, is still a challenging issue for an IRS system due to the
typically large number of reflecting elements and the passive architecture of
the IRS. The typical channel estimation scheme is to estimate the cascaded
IRS-aided channel by using various reflection patterns to train all the
reflecting elements [29, 30, 31, 32]. For example, an element-by-element
ON/OFF-based reflection pattern was adopted in [29], while a new IRS
reflection (phase-shift) pattern satisfying the unit-modulus constraint was
proposed in [30]. However, the channel training overhead of such a scheme
would become prohibitively high as the number of reflecting elements
increases. Besides, since the CSI is estimated only at the transmitter and
receiver, the IRS has no access to the CSI needed to perform beamforming. To
tackle this problem, the works [33, 16] proposed a two-mode IRS model, where
the IRS controller can switch between receiving mode for CSIs and reflecting
mode for data transmission. However, the realization of a receiving mode would
lead to higher hardware complexity as well as more power consumption, and
diminishes the main strengths of the IRS, namely its low complexity and cost.
To reduce the hardware cost, a semi-passive IRS architecture has been proposed
[34, 35], where only a small proportion of IRS elements have the capability of
both sensing and reflecting (refereed to as semi-passive elements). As such,
with the aid of these semi-passive elements, the IRS estimates the channels
between itself and BS/users by leveraging on machine learning [34] or
compressive sensing [35]. However, the computational complexity of the machine
learning and compressive sensing methods is usually very high.

Motivated by these observations, in this paper, we propose an angle-domain
IRS-aided system model, where effective angles are estimated by using a low-
complexity method, and then exploited to design the BS beam and IRS phase
shifts. 111 Like the work [36], the proposed angle-domain framework exploits
the angle sparsity. As such, the channel estimation and the corresponding
beamforming design are more efficient compared to those of the conventional
IRS-assisted communication. However, for non-sparse channels where there are a
large number of scatters in the radio frequency environment, the proposed
angle-domain design framework is no longer suitable, since the angular
information detection may also be complicated and time-consuming. Although the
angle-domain signal processing technique has been well studied in the existing
works (e.g.,[36, 37, 38, 39]), this is the first time to introduce the concept
of angle domain to deal with the channel estimation problem in the IRS-aided
communication system. By exploiting angle sparsity, the training overhead as
well as the computational complexity can be significantly reduced. The main
advantages of this model are listed below:

  * •

Only a very limited number of angles, instead of a large-scale channel matrix
corresponding to the IRS, are needed, thereby avoiding massive channel
training overhead and high computational complexity.

  * •

Due to the above, only a very small amount of CSI needs to be communicated
from the BS to the IRS. This allows the passive IRS to obtain CSI without
adding too much hardware complexity, by linking it to the BS via a low-
capacity hardware line. As such, the BS and the IRS can exchange information
(CSI and phase shifts), and thus the joint optimization of BS beamforming and
IRS beamforming can be realized.

The contributions of this paper are summarized as follows:

  * •

An angle-based channel estimation scheme with extremely low complexity has
been proposed. In particular, the maximum likelihood (ML) estimators for
effective angles from the BS to the user are presented, based on which the
effective angles from the IRS to the user are derived.

  * •

With a Gaussian model for the estimation error, we propose a joint
optimization algorithm for BS beamforming and IRS beamforming, which achieves
similar performance to two benchmark algorithms based on full CSI and the
multiple signal classification (MUSIC) method respectively. Furthermore, we
have proved mathematically that the average received signal power is non-
decreasing after each iteration of the proposed algorithm.

  * •

The expression for the achievable rate is presented, based on which a closed-
form approximation, an upper bound for the achievable rate are derived. The
analytical findings show that the BS-user link can obtain a power gain
proportional to the number of antennas $N$, while the BS-IRS-user link can
obtain a power gain of order $NM^{2}$.

The remainder of the paper is organized as follows. In Section II, we
introduce the angle-domain IRS-based system, while in Section III, we propose
an angle estimation scheme. Based on the estimated effective angles, a joint
optimization algorithm for BS beamforming and IRS beamforming is presented in
Section IV. Then, we give a detailed analysis of the achievable rate in
Section V. Numerical results and discussions are provided in Section VI, and
finally Section VII concludes the paper.

Notation: Boldface lower case and upper case letters are used for column
vectors and matrices, respectively. The superscripts
${\left(\cdot\right)}^{*}$, ${\left(\cdot\right)}^{T}$,
${\left(\cdot\right)}^{H}$, and ${\left(\cdot\right)}^{-1}$ stand for the
conjugate, transpose, conjugate-transpose, and matrix inverse, respectively.
Also, the Euclidean norm, absolute value, Hadamard product are denoted by
$\left\|\cdot\right\|$, $\left|\cdot\right|$ and $\odot$ respectively. In
addition, $\mathbb{E}\left\\{\cdot\right\\}$ is the expectation operator, and
$\text{tr}\left(\cdot\right)$ represents the trace.
$\text{Re}\left(\cdot\right)$ denotes the real part. For a matrix ${\bf A}$,
${[\bf A]}_{mn}$ denotes its entry in the $m$-th row and $n$-th column. For
real numbers $a$ and $b$, $\text{Remainder}(\frac{a}{b})$ and
$\text{Quotient}(\frac{a}{b})$ respectively denote the Remainder and the
quotient of $a$ divided by $b$. Besides, $j$ in $e^{j\theta}$ denotes the
imaginary unit. Finally, $z\sim\mathcal{CN}(0,{\sigma}^{2})$ denotes a
circularly symmetric complex Gaussian random variable (RV) $z$ with zero mean
and variance $\sigma^{2}$, and $z\sim\mathcal{N}(0,{\sigma}^{2})$ denotes a
real valued Gaussian RV.

##  II system model

We consider an angle-domain IRS aided system, as illustrated in Fig.1, where
the BS equipped with $N$ antennas communicates with a single-antenna user
assisted by an IRS with $M$ reflecting elements. Both the BS and the IRS have
uniform rectangular arrays (URA) with the sizes of
$\sqrt{N}d_{\text{BS}}\times\sqrt{N}d_{\text{BS}}$ and
$\sqrt{M}d_{\text{IRS}}\times\sqrt{M}d_{\text{IRS}}$ respectively, where
$d_{\text{BS}}$ is the distance between two adjacent BS antennas and
$d_{\text{IRS}}$ is the distance between two adjacent reflecting elements.
Furthermore, the BS is connected with the IRS controller via a backhaul link
so that they can exchange information (e.g. CSI and phase shifts).

Figure 1: Model of the angle-domain IRS aided system

An angle-domain Rician fading channel model is assumed, to model a channel
with a line-of-sight (LOS) component. Such a channel corresponds to the
practically desirable deployment of an IRS with LOS to both the BS and the
user. Specifically, the channel from the BS to the IRS can be expressed as

$\displaystyle{\bf
H}_{\text{B2I}}=\sqrt{\alpha_{\text{B2I}}\frac{v_{\text{B2I}}}{v_{\text{B2I}}+1}}{\bf
b}\left(\bar{\theta}_{\text{x-B2Ia}},\bar{\theta}_{\text{y-B2Ia}}\right){\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2I}},\bar{\theta}_{\text{y-B2I}}\right)+\sqrt{\alpha_{\text{B2I}}\frac{1}{v_{\text{B2I}}+1}}\widetilde{\bf
H}_{\text{B2I}},$ (1)

where $\widetilde{\bf H}_{\text{B2I}}$ is the non-line of sight (NLOS)
component, whose elements have the $\mathcal{CN}\left(0,1\right)$
distribution, $\alpha_{\text{B2I}}$ models large-scale fading,
$v_{\text{B2I}}$ is the Rician K-factor, ${\bf a}$ and ${\bf b}$ are array
steering vectors of the BS and the IRS, respectively. The two effective angles
of departure (AODs), i.e., the phase differences between two adjacent antennas
along the $x$ and $y$ axes, are respectively given by

$\displaystyle\bar{\theta}_{\text{x-B2I}}=-\frac{2\pi
d_{\text{BS}}}{\lambda}\cos\theta_{\text{B2I}}\cos\phi_{\text{B2I}},$ (2)
$\displaystyle\bar{\theta}_{\text{y-B2I}}=-\frac{2\pi
d_{\text{BS}}}{\lambda}\cos\theta_{\text{B2I}}\sin\phi_{\text{B2I}},$ (3)

where $\lambda$ is the carrier wavelength, $\theta_{\text{B2I}}$ and
$\phi_{\text{B2I}}$ are the elevation and azimuth AODs from the BS to the IRS,
respectively. Similarly, the two effective angles of arrival (AOAs) are

$\displaystyle\bar{\theta}_{\text{x-B2Ia}}=\frac{2\pi
d_{\text{IRS}}}{\lambda}\cos\theta_{\text{B2Ia}}\cos\phi_{\text{B2Ia}},$ (4)
$\displaystyle\bar{\theta}_{\text{y-B2Ia}}=\frac{2\pi
d_{\text{IRS}}}{\lambda}\cos\theta_{\text{B2Ia}}\sin\phi_{\text{B2Ia}},$ (5)

where $\theta_{\text{B2Ia}}$ and $\phi_{\text{B2Ia}}$ are the elevation and
azimuth AOAs at the IRS, respectively. Furthermore, we assume
$d_{\text{BS}}=d_{\text{IRS}}=\frac{\lambda}{2}$.

Specifically, the $n$-th element of ${\bf
a}\left(\bar{\theta}_{\text{x-B2I}},\bar{\theta}_{\text{y-B2I}}\right)$ and
the $m$-th element of ${\bf
b}\left(\bar{\theta}_{\text{x-B2I}},\bar{\theta}_{\text{y-B2I}}\right)$ are
given by

$\displaystyle
a_{n}=e^{j\left(i_{N,n}\bar{\theta}_{\text{x-B2I}}+j_{N,n}\bar{\theta}_{\text{y-B2I}}\right)},$
(6) $\displaystyle
b_{m}=e^{j\left(i_{M,m}\bar{\theta}_{\text{x-B2I}}+j_{M,m}\bar{\theta}_{\text{y-B2I}}\right)},$
(7)

where

$\displaystyle
i_{N,n}=\text{Remainder}\left(\frac{n-1}{\sqrt{N}}\right),n=1,...,N,$ (8)
$\displaystyle
j_{N,n}=\text{Quotient}\left(\frac{n-1}{\sqrt{N}}\right),n=1,...,N,$ (9)
$\displaystyle
i_{M,m}=\text{Remainder}\left(\frac{m-1}{\sqrt{M}}\right),m=1,...,M,$ (10)
$\displaystyle
j_{M,m}=\text{Quotient}\left(\frac{m-1}{\sqrt{M}}\right),m=1,...M.$ (11)

Similarly, the channel from the IRS to the user is given by

$\displaystyle{\bf
h}_{\text{I2U}}^{T}=\sqrt{\alpha_{\text{I2U}}\frac{v_{\text{I2U}}}{v_{\text{I2U}}+1}}{\bf
b}^{T}\left(\bar{\theta}_{\text{x-I2U}},\bar{\theta}_{\text{y-I2U}}\right)+\sqrt{\alpha_{\text{I2U}}\frac{1}{v_{\text{I2U}}+1}}\widetilde{\bf
h}_{\text{I2U}}^{T}.$ (12)

Also, the channel from the BS to the user can be expressed as

$\displaystyle{\bf
h}_{\text{B2U}}^{T}=\sqrt{\alpha_{\text{B2U}}\frac{v_{\text{B2U}}}{v_{\text{B2U}}+1}}{\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2U}},\bar{\theta}_{\text{y-B2U}}\right)+\sqrt{\alpha_{\text{B2U}}\frac{1}{v_{\text{B2U}}+1}}\widetilde{\bf
h}_{\text{B2U}}^{T}.$ (13)

During the data transmission, the BS transmits the signal ${\bf w}s$, where
${\bf w}$ is the transmitting beam and $s$ is the data intended for the user.
Then, the signal received by the user is given by

$\displaystyle y_{\text{U}}=\left({\bf h}_{\text{B2U}}^{T}+{\bf
h}_{\text{I2U}}^{T}{\mbox{\boldmath$\Theta$}}{\bf H}_{\text{B2I}}\right){\bf
w}s+n_{\text{U}},$ (14)

where ${\bf w}$ is the BS transmitting beam,
$n_{\text{U}}\sim\mathcal{CN}\left(0,\sigma_{0}^{2}\right)$ is the noise at
the user, and the phase shift matrix $\Theta$ is given by
${\mbox{\boldmath$\Theta$}}={\text{diag}}\left({\mbox{\boldmath$\xi$}}\right)$
with the phase shift beam
${\mbox{\boldmath$\xi$}}={[e^{j\vartheta_{1}},...,e^{j\vartheta_{n}},...,e^{j\vartheta_{M}}]}^{T}$.

To facilitate the design of BS transmitting beam ${\bf w}$ and IRS phase shift
beam $\xi$, we first perform angle estimation as illustrated in the next
section.

##  III Angular Information detection Method

In this section, we propose a detection method to estimate the effective
angles from the BS to the user ($\bar{\theta}_{\text{x-B2U}}$ and
$\bar{\theta}_{\text{y-B2U}}$), based on which the effective angles from the
IRS to the user ($\bar{\theta}_{\text{x-I2U}}$ and
$\bar{\theta}_{\text{y-I2U}}$) are derived. Later, these effective angles will
be exploited to design the BS beam and IRS phase shifts in Section IV.

During the angle estimation period, the IRS is turned off. The user transmits
an unmodulated carrier at the power $P_{q}$ to the BS. The received baseband
signal at the BS is given by

$\displaystyle{\bf r}={\bf h}_{\text{B2U}}^{*}q+{\bf
n}_{\text{BS}}=\sqrt{\frac{\alpha_{\text{B2U}}v_{\text{B2U}}}{v_{\text{B2U}}+1}}{\bf
a}\left(-\bar{\theta}_{\text{x-B2U}},-\bar{\theta}_{\text{y-B2U}}\right)q+\sqrt{\frac{\alpha_{\text{B2U}}}{v_{\text{B2U}}+1}}\widetilde{\bf
h}^{*}_{\text{B2U}}q+{\bf n}_{\text{BS}},$ (15)

where $q=\sqrt{P_{q}}e^{j\theta_{q}}$ is the baseband-equivalent
representation of the unmodulated carrier, and ${\bf
n}_{\text{BS}}\sim\mathcal{CN}\left(0,\sigma_{\text{BS},0}^{2}\right)$ is the
noise at the BS.

In particular, the signal received by the $n$-th antenna is

$\displaystyle r_{n}$
$\displaystyle=\sqrt{\frac{\alpha_{\text{B2U}}v_{\text{B2U}}}{v_{\text{B2U}}+1}}a_{n}q+\sqrt{\frac{\alpha_{\text{B2U}}}{v_{\text{B2U}}+1}}\tilde{h}_{\text{B2U},n}q+n_{\text{BS},n}$
(16)
$\displaystyle=\sqrt{\frac{\alpha_{\text{U}}v_{\text{B2U}}}{v_{\text{B2U}}+1}}e^{\left(-i_{N,n}\bar{\theta}_{\text{x-B2U}}-j_{N,n}\bar{\theta}_{\text{y-B2U}}\right)}q+\sqrt{\frac{\alpha_{\text{B2U}}}{v_{\text{B2U}}+1}}\tilde{h}_{\text{B2U},n}q+n_{\text{BS},n}.$

The phase of $r_{n}$ can be decomposed as

$\displaystyle\vartheta_{n}=\theta_{\text{q}}-i_{N,n}\bar{\theta}_{\text{x-B2U}}-j_{N,n}\bar{\theta}_{\text{y-B2U}}+e_{n},$
(17)

where $e_{n}$ is the phase uncertainty caused by noise and NLOS paths.

###### Proposition 1

With a large Rician K-factor and a high received signal-to-noise ratio (SNR)
at the BS, the phase uncertainty $e_{n}$ is approximately circularly symmetric
Gaussian $\mathcal{CN}\left(0,\sigma_{e}^{2}\right)$ with

$\displaystyle\sigma_{e}^{2}=\frac{4-\pi}{8v_{\text{B2U}}}+\frac{\left(4-\pi\right)\left(v_{\text{B2U}}+1\right)}{8\alpha_{\text{B2U}}P_{q}v_{\text{B2U}}}\sigma_{\text{BS},0}^{2}.$
(18)

###### Proof:

See Appendix A. ∎

###### Remark 1

From Proposition 1, we can observe that the phase uncertainty is a decreasing
function with respect to the transmit power. Also, a larger Rician K-factor
would lead to less phase uncertainy.

The observed phase difference between $r_{n}$ and $r_{m}$ is

$\displaystyle\Delta\bar{\theta}_{n,m}=r_{n}-r_{m}=-\left(i_{N,n}-i_{N,m}\right)\bar{\theta}_{\text{x-B2U}}-\left(j_{N,n}-j_{N,m}\right)\bar{\theta}_{\text{y-B2U}}+\Delta
e_{n,m},$ (19)

where $\Delta
e_{n,m}=e_{n}-e_{m}\sim\mathcal{CN}\left(0,\sigma_{\text{pd}}^{2}\right)$ with
$\sigma_{\text{pd }}^{2}=2\sigma_{e}^{2}$.

Then, we use the observed phase difference $\Delta\bar{\theta}_{n,m}$ to
estimate $\bar{\theta}_{\text{x-B2U}}$ and $\bar{\theta}_{\text{y-B2U}}$.
Specifically, we choose $\frac{N}{2}$ phase differences
$\Delta\bar{\theta}_{n,m_{n}},n=1,...,\frac{N}{2},m_{n}=N-n+1$.

###### Theorem 1

The ML estimators for $\bar{\theta}_{\text{x-B2U}}$ and
$\bar{\theta}_{\text{y-B2U}}$ are given by

$\displaystyle\hat{\bar{\theta}}_{\text{x-B2U}}=-\frac{6\sum\limits_{n=1}^{N/2}\left(i_{N,n}-i_{N,m_{n}}\right)\Delta\bar{\theta}_{n,m_{n}}}{N\left(N-1\right)},$
(20)
$\displaystyle\hat{\bar{\theta}}_{\text{y-B2U}}=-\frac{6\sum\limits_{n=1}^{N/2}\left(j_{N,n}-j_{N,m_{n}}\right)\Delta\bar{\theta}_{n,m_{n}}}{N\left(N-1\right)}.$
(21)

###### Proof:

See Appendix B. ∎

###### Corollary 1

The effective angles ${\bar{\theta}}_{\text{x-B2U}}$ and
${\bar{\theta}}_{\text{y-B2U}}$ can be decomposed as

$\displaystyle\bar{\theta}_{\text{x-B2U}}=\hat{\bar{\theta}}_{\text{x-B2U}}+\epsilon_{\text{x-B2U}},$
(22)
$\displaystyle\bar{\theta}_{\text{y-B2U}}=\hat{\bar{\theta}}_{\text{y-B2U}}+\epsilon_{\text{y-B2U}},$
(23)

where $\epsilon_{\text{x-B2U}}$ and $\epsilon_{\text{y-B2U}}$ are estimation
errors, which follow Guassion distribution
$\mathcal{N}\left(0,\sigma_{\text{est}}^{2}\right)$ with the variance

$\displaystyle\sigma_{\text{est}}^{2}=\frac{6\sigma_{\text{pd}}^{2}}{N\left(N-1\right)}.$
(24)

###### Proof:

Starting from Theorem 1, and noticing that

$\displaystyle\Delta\bar{\theta}_{n,m_{n}}\sim\mathcal{CN}\left(-\left(i_{N,n}-i_{N,m_{n}}\right)\bar{\theta}_{\text{x-B2U}}-\left(j_{N,n}-j_{N,m_{n}}\right)\bar{\theta}_{\text{y-B2U}},\sigma_{\text{pd}}^{2}\right),$
(25)

we can obtain the desired result. ∎

###### Remark 2

Corollary 2 shows that the variance of the estimation error drops
approximately inversely with the square of the antenna number, which indicates
the great benefit of applying a large number of BS antennas in angle
estimation.

With a LOS path between the BS and the user, their distance $d_{\text{B2U}}$
can be obtained with high accuracy, by measuring time difference of arrival,
i.e., wave propagation time from the user to the BS [40].

After obtaining the effective angles and the distance, we can estimate the
location of the user as
$(\hat{x}_{\text{U}},\hat{y}_{\text{U}},\hat{z}_{\text{U}})$ with

$\displaystyle\hat{x}_{\text{U}}=-\frac{d_{\text{B2U}}\hat{\bar{\theta}}_{\text{x-B2U}}}{\pi},$
(26)
$\displaystyle\hat{y}_{\text{U}}=-\frac{d_{\text{B2U}}\hat{\bar{\theta}}_{\text{y-B2U}}}{\pi},$
(27)
$\displaystyle\hat{z}_{\text{U}}=-\frac{d_{\text{B2U}}\sqrt{\pi^{2}-\hat{\bar{\theta}}_{\text{x-B2U}}^{2}-\hat{\bar{\theta}}_{\text{y-B2U}}^{2}}}{\pi},$
(28)

where we assume the BS is located at $(0,0,0)$.

With the estimated user location
$(\hat{x}_{\text{U}},\hat{y}_{\text{U}},\hat{z}_{\text{U}})$ and the perfectly
known IRS location $(x_{\text{I}},y_{\text{I}},z_{\text{I}})$, the BS can
calculate the effective angles from the IRS to the user as follows:

###### Lemma 1

The effective angles from the IRS to the user are

$\displaystyle\hat{\bar{\theta}}_{\text{x-I2U}}=\frac{\left({x}_{\text{I}}-\hat{x}_{\text{U}}\right)\pi}{\hat{d}_{\text{I2U}}},$
(29)
$\displaystyle\hat{\bar{\theta}}_{\text{y-I2U}}=\frac{\left({y}_{\text{I}}-\hat{y}_{\text{U}}\right)\pi}{\hat{d}_{\text{I2U}}},$
(30)

where

$\displaystyle\hat{d}_{\text{I2U}}=\sqrt{{\left(\hat{x}_{\text{U}}-x_{\text{I}}\right)}^{2}+{\left(\hat{y}_{\text{U}}-y_{\text{I}}\right)}^{2}+{\left(\hat{z}_{\text{U}}-z_{\text{I}}\right)}^{2}}.$
(31)

###### Proof:

Lemma 1 is provable using elementary geometry. ∎

###### Theorem 2

The effective angles from the IRS to the user can be decomposed into

$\displaystyle\bar{\theta}_{\text{x-I2U}}=\hat{\bar{\theta}}_{\text{x-I2U}}+\varphi_{1}\epsilon_{\text{x-B2U}}+\varphi_{{2}}\epsilon_{\text{y-B2U}},$
(32)
$\displaystyle\bar{\theta}_{\text{y-I2U}}=\hat{\bar{\theta}}_{\text{y-I2U}}+\varphi_{2}\epsilon_{\text{x-B2U}}+\varphi_{3}\epsilon_{\text{y-B2U}},$
(33)

with

$\displaystyle\varphi_{1}=Ra\left\\{1-\frac{\hat{\bar{\theta}}_{\text{x-I2U}}^{2}}{\pi^{2}}+\frac{\hat{\bar{\theta}}_{\text{x-I2U}}^{2}\hat{\bar{\theta}}_{\text{z-I2U}}}{\pi^{3}}\right\\},$
(34)
$\displaystyle\varphi_{2}=Ra\left\\{-\frac{\hat{\bar{\theta}}_{\text{x-I2U}}\hat{\bar{\theta}}_{\text{y-I2U}}}{\pi^{2}}+\frac{\hat{\bar{\theta}}_{\text{x-I2U}}\hat{\bar{\theta}}_{\text{y-I2U}}\hat{\bar{\theta}}_{\text{z-I2U}}}{\pi^{3}}\right\\},$
(35)
$\displaystyle\varphi_{3}=Ra\left\\{1-\frac{\hat{\bar{\theta}}_{\text{y-I2U}}^{2}}{\pi^{2}}+\frac{\hat{\bar{\theta}}_{\text{y-I2U}}^{2}\hat{\bar{\theta}}_{\text{z-I2U}}}{\pi^{3}}\right\\},$
(36)

where $Ra\triangleq\frac{d_{\text{B2U}}}{\hat{d}_{\text{I2U}}}$ and
$\hat{\bar{\theta}}_{\text{z-I2U}}\triangleq\frac{\left({z}_{\text{I}}-\hat{z}_{\text{U}}\right)\pi}{\hat{d}_{\text{I2U}}}$.

###### Proof:

See Appendix C. ∎

###### Remark 3

Theorem 2 implies that in addition to the estimation error of
$\hat{\bar{\theta}}_{\text{x-B2U}}$ and $\hat{\bar{\theta}}_{\text{y-B2U}}$,
the accuracy of $\hat{\bar{\theta}}_{\text{x-I2U}}$ and
$\hat{\bar{\theta}}_{\text{y-I2U}}$ is also significantly influenced by the
distances of the IRS and the BS to the user. Specifically, the estimation
error increases linearly with the ratio
$Ra\triangleq\frac{d_{\text{B2U}}}{\hat{d}_{\text{I2U}}}$, implying that it is
best to place the IRS close to the BS in terms of angle estimation accuracy.
222 It is worth noting that, assuming perfect CSI, it is desirable to place
the IRS close to the BS or the user [10, 15]. However, in this paper,
imperfect CSI is considered, as such placing the IRS close to the user would
not necessarily improve the achievable due to the increased angle estimation
error.

##  IV Joint optimization of BS beamforming and IRS beamforming

Using the estimated angles, in this section we aim to maximize the average
received signal power:

$\displaystyle P_{\text{r}}=\mathbb{E}\left\\{{\left|\left({\bf
h}_{\text{B2U}}^{T}+{\bf h}_{\text{I2U}}^{T}{\mbox{\boldmath$\Theta$}}{\bf
H}_{\text{B2I}}\right){\bf w}\right|}^{2}\right\\},$ (37)

by jointly optimizing BS beamforming and IRS beamforming.

We first give the expression of the average received signal power.

###### Proposition 2

The average received signal power is given by

$\displaystyle P_{\text{r}}={\bf w}^{H}{\bf T}{\bf w},$ (38)

with

$\displaystyle{\bf
T}\triangleq{\beta}_{\text{B2I2U}}{\left({\mbox{\boldmath$\Theta$}}\bar{\bf
H}_{\text{B2I}}\right)}^{H}{\bf B}{\mbox{\boldmath$\Theta$}}\bar{\bf
H}_{\text{B2I}}+\sqrt{{\beta}_{\text{B2I2U}}{\beta}_{\text{B2U}}}\left({\left({\mbox{\boldmath$\Theta$}}\bar{\bf
H}_{\text{B2I}}\right)}^{H}{\bf C}+{\bf
C}^{H}{\mbox{\boldmath$\Theta$}}\bar{\bf H}_{\text{B2I}}\right)$ (39)
$\displaystyle+{\beta}_{\text{B2U}}{\bf A}+\sigma_{\text{NLOS}}^{2}{\bf
I}_{N},$

where

$\displaystyle\bar{\bf H}_{\text{B2I}}\triangleq{\bf
b}\left(\bar{\theta}_{\text{x-B2Ia}},\bar{\theta}_{\text{y-B2Ia}}\right){\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2I}},\bar{\theta}_{\text{y-B2I}}\right)$
(40)
$\displaystyle{\beta}_{\text{B2I2U}}\triangleq\frac{\alpha_{\text{I2U}}\alpha_{\text{B2I}}v_{\text{B2I}}v_{\text{I2U}}}{\left(v_{\text{B2I}}+1\right)\left(v_{\text{I2U}}+1\right)},$
(41)
$\displaystyle{\beta}_{\text{B2U}}\triangleq\frac{v_{\text{B2U}}\alpha_{\text{B2U}}}{v_{\text{B2U}}+1},$
(42) $\displaystyle\sigma_{\text{NLOS}}^{2}\triangleq
M\frac{\alpha_{\text{I2U}}\alpha_{\text{B2I}}}{v_{\text{B2I}}+1}\left(1+\frac{v_{\text{B2I}}}{v_{\text{I2U}}+1}\right)+\frac{\alpha_{\text{B2U}}}{v_{\text{B2U}}+1}.$
(43)

The elements of ${\bf A}\in\mathbb{C}^{N\times N}$, ${\bf
B}\in\mathbb{C}^{M\times M}$ and ${\bf C}\in\mathbb{C}^{M\times N}$ are given
by

$\displaystyle{\left[{\bf
A}\right]}_{mn}={\left[{\bf\hat{A}}\right]}_{mn}\exp\left(-\frac{1}{2}\sigma_{\text{est}}^{2}\left\\{i_{N,mn}^{2}+j_{N,mn}^{2}\right\\}\right),$
(44) $\displaystyle{\left[{\bf
B}\right]}_{mn}={\left[{\bf\hat{B}}\right]}_{mn}\exp\left(-\frac{1}{2}\sigma_{\text{est}}^{2}\left\\{{\left(i_{M,mn}\varphi_{1}+j_{M,mn}\varphi_{2}\right)}^{2}+{\left(j_{M,mn}\varphi_{2}+j_{M,mn}\varphi_{3}\right)}^{2}\right\\}\right),$
(45) $\displaystyle{\left[{\bf
C}\right]}_{mn}\\!=\\!{\left[{\bf\hat{C}}\right]}_{mn}\exp\\!\left(\\!-\\!\frac{1}{2}\sigma_{\text{est}}^{2}\left\\{{\left(i_{M,m}\varphi_{1}\\!+\\!j_{M,m}\varphi_{2}\\!-\\!i_{N,n}\right)}^{2}\\!+\\!{\left(i_{M,m}\varphi_{2}\\!+\\!j_{M,m}\varphi_{3}\\!-\\!j_{N,n}\right)}^{2}\right\\}\\!\right),$
(46)

where $i_{M,mn}\triangleq\left(i_{M,n}-i_{M,m}\right)$,
$j_{M,mn}\triangleq\left(j_{M,n}-j_{M,m}\right)$, ${\bf\hat{A}}\triangleq{\bf
a}^{*}\left(\hat{\bar{\theta}}_{\text{x-B2U}},\hat{\bar{\theta}}_{\text{y-B2U}}\right){\bf
a}^{T}\left(\hat{\bar{\theta}}_{\text{x-B2U}},\hat{\bar{\theta}}_{\text{y-B2U}}\right)$,
${\bf\hat{B}}\triangleq{\bf
b}^{*}\left(\hat{\bar{\theta}}_{\text{x-I2U}},\hat{\bar{\theta}}_{\text{y-I2U}}\right){\bf
b}^{T}\left(\hat{\bar{\theta}}_{\text{x-I2U}},\hat{\bar{\theta}}_{\text{y-I2U}}\right)$
and ${\bf\hat{C}}\triangleq{\bf
b}^{*}\left(\hat{\bar{\theta}}_{\text{x-I2U}},\hat{\bar{\theta}}_{\text{y-I2U}}\right){\bf
a}^{T}\left(\hat{\bar{\theta}}_{\text{x-B2U}},\hat{\bar{\theta}}_{\text{y-B2U}}\right)$.

###### Proof:

See Appendix D. ∎

Then the optimization problem can be formulated as:

$\displaystyle{}\begin{array}[]{ll}\max\limits_{\left\\{\mbox{\boldmath$\Theta$},{\bf
w}\right\\}}&P_{r}={\bf w}^{H}{\bf T}{\bf w},\\\
\operatorname{s.t.}&\begin{array}[t]{lll}{\left\|\bf w\right\|}^{2}\leq
P_{BS},\\\
\left|{\left[\bf\Theta\right]}_{ii}\right|=1,i=1,...,M,\end{array}\end{array}$
(51)

where $P_{\text{BS}}$ is the maximum transmit power at the BS.

Since the phase shift matrix $\Theta$ and the BS beam ${\bf w}$ are coupled,
the above optimization problem (51) is difficult to solve. Responding to this,
we will first optimize ${\bf w}$ by fixing $\Theta$ and then update $\Theta$
by fixing ${\bf w}$ respectively. As such, we can obtain sub-optimal solutions
for both ${\bf w}$ and $\Theta$ by performing this successive refinement
process iteratively.

###  IV-A BS beamforming

By fixing the phase shift matrix $\Theta$, we can simplify (51) to

$\displaystyle\begin{array}[]{ll}\max\limits_{\left\\{{\bf
w}\right\\}}&P\left({\bf w}\right)={\bf w}^{H}{\bf T}{\bf w},\\\
\operatorname{s.t.}&\begin{array}[t]{lll}{\left\|\bf w\right\|}^{2}\leq
P_{\text{BS}}\end{array}.\end{array}$ (55)

The above problem is a convex problem equivalent to

$\displaystyle\begin{array}[]{ll}\min\limits_{\left\\{{\bf
w}\right\\}}&L\left({\bf w},\mu\right)=-{\bf w}^{H}{\bf T}{\bf
w}+\mu\left({\left|\bf w\right|}^{2}-P_{\text{BS}}\right),\\\
\operatorname{s.t.}&\begin{array}[t]{lll}\mu>0,\end{array}\end{array}$ (59)

where $\mu>0$ is the Lagrangian multiplier.

The Karush-Kuhn-Tucker (KKT) conditions are

$\displaystyle\nabla_{{\bf w}}L\left({\bf w},\mu\right)=-2{\bf Tw}+2\mu{\bf
w}=0,$ (60) $\displaystyle\nabla_{{\mu}}L\left({\bf w},\mu\right)={\left|\bf
w\right|}^{2}-P_{\text{BS}}=0,$ (61)

based on which, we have

$\displaystyle{\bf w}=\sqrt{P_{\text{BS}}}{\bf t}_{\text{max}},$ (62)

where ${\bf t}_{\text{max}}$ is the eigenvector of ${\bf T}$ corresponding to
the largest eigenvalue.

###  IV-B IRS beamforming

For a given ${\bf w}$, the optimization problem (51) can be rewritten as

$\displaystyle\begin{array}[]{ll}\max\limits_{\left\\{\mbox{\boldmath$\Theta$}\right\\}}P{\left(\mbox{\boldmath$\Theta$}\right)}&\triangleq\beta_{\text{B2I2U}}{\bf
w}^{H}\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}{\left({\mbox{\boldmath$\Theta$}}\bar{\bf
H}_{\text{B2I}}\right)}^{H}{\bf B}{\mbox{\boldmath$\Theta$}}\bar{\bf
H}_{\text{B2I}}{\bf w}\\\
&+\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}\left({\bf
w}^{H}{\left({\mbox{\boldmath$\Theta$}}\bar{\bf
H}_{\text{B2I}}\right)}^{H}{\bf C}{\bf w}+{\bf w}^{H}{\bf
C}^{H}{\mbox{\boldmath$\Theta$}}\bar{\bf H}_{\text{B2I}}{\bf w}\right)\\\
&+{\beta}_{\text{B2U}}{\bf w}^{H}{\bf A}{\bf w}+\sigma_{\text{NLOS}}^{2}{\bf
w}^{H}{\bf w}\\\
\operatorname{s.t.}&\begin{array}[t]{lll}\left|{\left[\bf\Theta\right]}_{ii}\right|=1,i=1,...,M.\end{array}\end{array}$
(68)

According to the rule that ${\bf E}^{H}{\bf X}^{H}{\bf F}={\bf
x}^{H}\left({\bf E}^{*}\odot{\bf F}\right)$ with ${\bf
X}={\text{diag}}\left({\bf x}\right)$, the objective function can be rewritten
as

$\displaystyle P{\left(\mbox{\boldmath$\Theta$}\right)}$
$\displaystyle=\beta_{\text{B2I2U}}{\text{tr}}\left({\bf\Theta}^{H}{\bf
B}{\bf\Theta}\bar{\bf H}_{\text{B2I}}{\bf w}{\bf w}^{H}\bar{\bf
H}_{\text{B2I}}^{H}\right)$ (69)
$\displaystyle+\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}{\mbox{\boldmath$\xi$}}^{H}\left(\bar{\bf
H}_{\text{B2I}}^{*}{\bf w}^{*}\odot{\bf
Cw}\right)+\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}\left(\bar{\bf
H}_{\text{B2I}}^{T}{\bf w}^{T}\odot{\bf w}^{H}{\bf
C}^{H}\right){\mbox{\boldmath$\xi$}}$ $\displaystyle+{\beta}_{\text{B2U}}{\bf
w}^{H}{\bf A}{\bf w}+\sigma_{\text{NLOS}}^{2}{\bf w}^{H}{\bf w}.$

Using the property that ${\bf X}^{H}{\bf E}{\bf Y}{\bf F}={\bf
x}^{H}\left({\bf E}\odot{\bf F}^{T}\right){\bf y}$ with ${\bf
X}={\text{diag}}\left({\bf x}\right)$ and ${\bf Y}={\text{diag}}\left({\bf
y}\right)$, the above equation can be further expressed as

$\displaystyle P{\left(\mbox{\boldmath$\xi$}\right)}$
$\displaystyle=\beta_{\text{B2I2U}}{\mbox{\boldmath$\xi$}}^{H}\left({\bf
B}\odot{\left(\bar{\bf H}_{\text{B2I}}{\bf w}{\bf w}^{H}\bar{\bf
H}_{\text{B2I}}^{H}\right)}^{T}\right){\mbox{\boldmath$\xi$}}$ (70)
$\displaystyle+\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}{\mbox{\boldmath$\xi$}}^{H}\left(\bar{\bf
H}_{\text{B2I}}^{*}{\bf w}^{*}\odot{\bf
Cw}\right)+\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}\left(\bar{\bf
H}_{\text{B2I}}^{T}{\bf w}^{T}\odot{\bf w}^{H}{\bf
C}^{H}\right){\mbox{\boldmath$\xi$}}$ $\displaystyle+{\beta}_{\text{B2U}}{\bf
w}^{H}{\bf A}{\bf w}+\sigma_{\text{NLOS}}^{2}{\bf w}^{H}{\bf w},$

based on which, the optimization problem can be reformulated as

$\displaystyle{}\begin{array}[]{ll}\max\limits_{\left\\{\mbox{\boldmath$\xi$}\right\\}}P{\left(\mbox{\boldmath$\xi$}\right)}&=\beta_{\text{B2I2U}}{\mbox{\boldmath$\xi$}}^{H}\left({\bf
B}\odot{\left(\bar{\bf H}_{\text{B2I}}{\bf w}{\bf w}^{H}\bar{\bf
H}_{\text{B2I}}^{H}\right)}^{T}\right){\mbox{\boldmath$\xi$}}\\\
&+\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}{\mbox{\boldmath$\xi$}}^{H}\left(\bar{\bf
H}_{\text{B2I}}^{*}{\bf w}^{*}\odot{\bf
Cw}\right)+\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}\left(\bar{\bf
H}_{\text{B2I}}^{T}{\bf w}^{T}\odot{\bf w}^{H}{\bf
C}^{H}\right){\mbox{\boldmath$\xi$}}\\\ &+{\beta}_{\text{B2U}}{\bf w}^{H}{\bf
A}{\bf w}+\sigma_{\text{NLOS}}^{2}{\bf w}^{H}{\bf w}\\\
\operatorname{s.t.}&\begin{array}[t]{lll}\left|{\xi}_{i}\right|=1,i=1,...,M.\end{array}\end{array}$
(76)

Since $\left|{\xi}_{i}\right|=1$, we have
${\text{tr}}\left({\mbox{\boldmath$\xi$}}{\mbox{\boldmath$\xi$}}^{H}\right)=M$.
In order to deal with the non-convex constraint of $\left|{\xi}_{i}\right|=1$,
we relax the problem (76) into the following optimization problem with a
convex $\ell_{\infty}$ constraint:

$\displaystyle\begin{array}[]{lll}\max\limits_{\left\\{\mbox{\boldmath$\xi$}\right\\}}&P{\left(\mbox{\boldmath$\xi$}\right)}\\\
\operatorname{s.t.}&\begin{array}[t]{lll}{\text{tr}}\left({\mbox{\boldmath$\xi$}}{\mbox{\boldmath$\xi$}}^{H}\right)=M,\\\
{\left\|\mbox{\boldmath$\xi$}\right\|}_{\infty}\leq 1.\end{array}\end{array}$
(81)

Since the $\ell_{\infty}$ constraint is non-differentiable, we instead use the
$\ell_{p}$ with a large $p$ to approximate $\ell_{\infty}$,
$\underset{p\to\infty}{\lim}\ell_{p}=\ell_{\infty}$. To solve (81), we
incorporate the second constraint by exploiting the barrier method with the
logarithmic barrier function $F\left(x\right)$ to approximate the penalty of
violating the $\ell_{p}$ constraint,

$F(x)=\left\\{\begin{aligned} -\frac{1}{\kappa}\ln\left(x\right),x>0\\\
\infty,x\leq 0\end{aligned}\right.,$

where $\kappa$ is used to scale the barrier function penalty. As such, the
optimization problem can be rewritten as:

$\displaystyle\begin{array}[]{ll}\min\limits_{\left\\{\mbox{\boldmath$\xi$}\right\\}}G{\left(\mbox{\boldmath$\xi$}\right)}&=F\left(1-{\left\|\mbox{\boldmath$\xi$}\right\|}_{p}\right)-\beta_{\text{B2I2U}}{\mbox{\boldmath$\xi$}}^{H}\left({\bf
B}\odot{\left(\bar{\bf H}_{\text{B2I}}{\bf w}{\bf w}^{H}\bar{\bf
H}_{\text{B2I}}^{H}\right)}^{T}\right){\mbox{\boldmath$\xi$}}\\\
&-\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}{\mbox{\boldmath$\xi$}}^{H}\left(\bar{\bf
H}_{\text{B2I}}^{*}{\bf w}^{*}\odot{\bf
Cw}\right)-\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}\left(\bar{\bf
H}_{\text{B2I}}^{T}{\bf w}^{T}\odot{\bf w}^{H}{\bf
C}^{H}\right){\mbox{\boldmath$\xi$}}\\\
\operatorname{s.t.}&\begin{array}[t]{lll}{\text{tr}}\left({\mbox{\boldmath$\xi$}}{\mbox{\boldmath$\xi$}}^{H}\right)=M.\end{array}\end{array}$
(86)

Due to the non-convex constraint
$\text{tr}({\mbox{\boldmath$\xi$}}{\mbox{\boldmath$\xi$}}^{H})=M$, the
optimization problem (86) is non-convex. Next, we try to solve the above
optimization problem by exploiting a gradient method. As such, sub-optimal
solutions can be obtained. The gradient of the objective function
$G{\left(\mbox{\boldmath$\xi$}\right)}$ can be calculated as

$\displaystyle\nabla_{{\mbox{\boldmath$\xi$}}}G{\left(\mbox{\boldmath$\xi$}\right)}=\frac{{\left\|\mbox{\boldmath$\xi$}\right\|}_{p}^{1-p}{\mbox{\boldmath$\zeta$}}}{2\kappa\left(1-{\left\|\mbox{\boldmath$\xi$}\right\|}_{p}\right)}-\nabla_{{\mbox{\boldmath$\xi$}}}P{\left(\mbox{\boldmath$\xi$}\right)},$
(87)

where

$\displaystyle{\mbox{\boldmath$\zeta$}}={\left[\xi_{1}{\left|\xi_{1}\right|}^{p-2},\xi_{2}{\left|\xi_{2}\right|}^{p-2},...,\xi_{M}{\left|\xi_{M}\right|}^{p-2}\right]}^{T}.$
(88)

And the gradient
$\nabla_{{\mbox{\boldmath$\xi$}}}P{\left(\mbox{\boldmath$\xi$}\right)}$ can be
computed as

$\displaystyle\nabla_{{\mbox{\boldmath$\xi$}}}P{\left(\mbox{\boldmath$\xi$}\right)}\\!=\\!2\beta_{\text{B2I2U}}\left({\bf
B}\odot{\left(\bar{\bf H}_{\text{B2I}}{\bf w}{\bf w}^{H}\bar{\bf
H}_{\text{B2I}}^{H}\right)}^{T}\right){\mbox{\boldmath$\xi$}}\\!+\\!2\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}{\text{Re}}\left(\left(\bar{\bf
H}_{\text{B2I}}^{*}{\bf w}^{*}\odot{\bf Cw}\right){\bf 1}_{N}\right),$ (89)

where ${\bf 1}_{N}$ is a $N\times 1$ vector whose elements all equal to 1.

Thus, $\nabla_{{\mbox{\boldmath$\xi$}}}G{\left(\mbox{\boldmath$\xi$}\right)}$
can be rewritten as

$\displaystyle\nabla_{{\mbox{\boldmath$\xi$}}}G{\left(\mbox{\boldmath$\xi$}\right)}$
$\displaystyle=-2\beta_{\text{B2I2U}}\left({\bf B}\odot{\left(\bar{\bf
H}_{\text{B2I}}{\bf w}{\bf w}^{H}\bar{\bf
H}_{\text{B2I}}^{H}\right)}^{T}\right){\mbox{\boldmath$\xi$}}$ (90)
$\displaystyle-2\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}{\text{Re}}\left(\left(\bar{\bf
H}_{\text{B2I}}^{*}{\bf w}^{*}\odot{\bf Cw}\right){\bf
1}_{N}\right)+\frac{{\left\|\mbox{\boldmath$\xi$}\right\|}_{p}^{1-p}{\mbox{\boldmath$\zeta$}}}{2\kappa\left(1-{\left\|\mbox{\boldmath$\xi$}\right\|}_{p}\right)}.$

Due to the constraint
$\text{tr}\left({\mbox{\boldmath$\xi$}}{\mbox{\boldmath$\xi$}}^{H}\right)=M$,
we project ${\bf
g}_{\text{gd}}=-\nabla_{{\mbox{\boldmath$\xi$}}}G{\left(\mbox{\boldmath$\xi$}\right)}$
into the tangent plane of
$\text{tr}\left({\mbox{\boldmath$\xi$}}{\mbox{\boldmath$\xi$}}^{H}\right)=M$:

$\displaystyle{\bf g}_{\text{p}}={\bf g}_{\text{gd}}-\frac{{\bf
g}_{\text{gd}}^{T}{\mbox{\boldmath$\xi$}}^{*}{\mbox{\boldmath$\xi$}}}{{\left\|{\mbox{\boldmath$\xi$}}\right\|}^{2}}.$
(91)

Then we use ${\bf g}_{\text{p}}$ as the search direction. Algorithm 1 provides
the pseudo-code for the process. For convenience, we collect the principal and
important parameters and variables in Table I.

###### Proposition 3

The constant-modulus constraint $|\xi_{i}|=1,i=1,\dots,M$ is satisfied.

###### Proof:

See Appendix E. ∎

Algorithm 1 IRS Beamforming Algorithm

1:$\mathbf{Initialization:}$ Given a feasible phase shift vector
${\mbox{\boldmath$\xi$}}_{1}$, a large $p>0$, the iteration index $i=0$, the
maximum iterations $N_{\text{iter}}>0$, halting criterion $\varepsilon>0$ and
the barrier coefficient $\kappa>0$.

2:repeat

3: $i\leftarrow i+1$.

4: Compute the gradient as per (90).

5: Compute the search direction ${\bf g}_{\text{p}}$ as per (91).

6: For $0\leq\varpi\leq 1$, searching for it by
$\displaystyle\varpi^{\star}=\underset{\varpi}{\arg\max}\
P\left(\left(1-\varpi\right){\mbox{\boldmath$\xi$}}_{i}+\varpi\sqrt{M}\frac{{\bf
g}_{\text{p}}}{{\left\|{\bf g}_{\text{p}}\right\|}^{2}}\right).$ (92)

7: Update:
$\displaystyle{\mbox{\boldmath$\xi$}}_{i+1}=\left(1-\varpi^{\star}\right){\mbox{\boldmath$\xi$}}_{i}+\varpi^{\star}\sqrt{M}\frac{{\bf
g}_{\text{p}}}{{\left\|{\bf g}_{\text{p}}\right\|}^{2}}.$ (93)

8:until
${\left|P\left({\mbox{\boldmath$\xi$}}_{i+1}\right)-P\left({\mbox{\boldmath$\xi$}}_{i}\right)\right|}\leq\varepsilon$
or $i\geq N_{\text{iter}}$.

9:$\mathbf{Output:}$
${\mbox{\boldmath$\xi$}}^{\star}=\exp\left[j\text{angle}({\mbox{\boldmath$\xi$}_{i}})\right]$.

Parameter | Definition
---|---
Variable ${\bf w}$ | Transmit beamforming vector.
Variable $\xi$ | Phase shift vector.
Variable $\Theta$ | Phase shift matrix ${\mbox{\boldmath$\Theta$}}=\text{diag}({\mbox{\boldmath$\xi$}})$
${\beta}_{\text{B2I2U}}$,${\beta}_{\text{B2U}}$ | Defined by (41) and (42),respectively.
${\bf B}$,${\bf C}$ | Defined by (45) and (46), respectively.
$\bar{\bf H}_{\text{B2I}}$ | Defined by (40).
TABLE I:  Parameter Table.

###  IV-C Joint optimization of BS beamforming and IRS beamforming

According to IV-A and IV-B, a joint optimization scheme is developed in
Algorithm 2, where the BS beam and phase shift beam are iteratively optimized.

Algorithm 2 Joint Optimization Algorithm

1:$\mathbf{Initialization:}$ Given feasible initial solutions
${\mbox{\boldmath$\xi$}}_{0}$, ${\bf w}_{0}$ and the iteration index $i=0$.

2:repeat

3: Perform BS beamforming: According to ${\mbox{\boldmath$\xi$}}_{0}$,
optimize the BS beam by invoking the result (62) in IV-A, which yields ${\bf
w}_{i+1}$.

4: Perform IRS beamforming: Based on ${\bf w}_{i+1}$, optimize the transmit
beamformer via Algorithm 1, which yields ${\mbox{\boldmath$\xi$}}_{i+1}$.

5: $i\leftarrow i+1$.

6:until ${\mbox{\boldmath$\xi$}}_{i}$ and ${\bf w}_{i}$ are converged.

7:$\mathbf{Output:}$
${\mbox{\boldmath$\xi$}}^{\star}={\mbox{\boldmath$\xi$}}_{i}$ and ${\bf
w}^{\star}={\bf w}_{i}$.

###### Proposition 4

The joint optimization algorithm always guarantees $P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)\geq P\left({\bf
w}_{i},{\mbox{\boldmath$\xi$}}_{i}\right)$.

###### Proof:

1) Proof of $P\left({\bf w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)\geq
P\left({\bf w}_{i},{\mbox{\boldmath$\xi$}}_{i+1}\right)$

By fixing $\xi$, the optimization of ${\bf w}$ is a convex problem. And, ${\bf
w}_{i+1}$ is the optimal solution corresponding to the phase shift beam
${\mbox{\boldmath$\xi$}}_{i+1}$. Thus, we have

$\displaystyle P\left({\bf w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)\geq
P\left({\bf w}_{i},{\mbox{\boldmath$\xi$}}_{i+1}\right).$ (94)

2) Proof of $P\left({\bf w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)\geq
P\left({\bf w}_{i+1},{\mbox{\boldmath$\xi$}}_{i}\right)$

Fixing ${\bf w}_{i+1}$, the Taylor expansion of $P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)$ can be expressed as

$\displaystyle P\left({\bf w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)$
$\displaystyle=P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i}\right)+{\left(\nabla_{{\mbox{\boldmath$\xi$}}_{i}}P\right)}^{H}\left\\{P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)-P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i}\right)\right\\}$ (95)
$\displaystyle+o\left\\{{\left(P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)-P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i}\right)\right)}^{2}\right\\}.$

Based on (93) in Algorithm 1, for any $\varpi\to 0$, the above equation can be
written as

$\displaystyle P\left({\bf w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)$
$\displaystyle=P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i}\right)+{\left(\nabla_{{\mbox{\boldmath$\xi$}}_{i}}P\right)}^{H}\sqrt{M}\frac{{\bf
g}_{\text{p}}}{{\left\|{\bf
g}_{\text{p}}\right\|}^{2}}\varpi^{\star}+o\left\\{{\varpi^{\star}}^{2}\right\\}$
(96) $\displaystyle\approx P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i}\right)+{\left(\nabla_{{\mbox{\boldmath$\xi$}}_{i}}P\right)}^{H}{\bf
g}_{\text{p}}\frac{\sqrt{M}}{{\left\|{\bf
g}_{\text{p}}\right\|}^{2}}\varpi^{\star}.$

Next, we focus on the calculation of
${\left(\nabla_{{\mbox{\boldmath$\xi$}}_{i}}P\right)}^{H}{\bf g}_{\text{p}}$.

$\displaystyle{\left(\nabla_{{\mbox{\boldmath$\xi$}}_{i}}P\right)}^{H}{\bf
g}_{\text{p}}={\left({\bf
g}_{\text{gd}}+\nabla_{{\mbox{\boldmath$\xi$}}_{i}}F\left(1-{\left\|{\mbox{\boldmath$\xi$}}_{i}\right\|}^{2}\right)\right)}^{H}{\bf
g}_{\text{p}}.$ (97)

Recall that
$\nabla_{{\mbox{\boldmath$\xi$}}_{i}}F\left(1-{\left\|{\mbox{\boldmath$\xi$}}_{i}\right\|}^{2}\right)=\frac{{\left\|\mbox{\boldmath$\xi$}_{i}\right\|}_{p}^{1-p}{\mbox{\boldmath$\Omega$}\mbox{\boldmath$\xi$}_{i}}}{2\kappa\left(1-{\left\|\mbox{\boldmath$\xi$}_{i}\right\|}_{p}\right)}$
with
${\mbox{\boldmath$\Omega$}}=\text{diag}\left({\left|\xi_{1}\right|}^{p-2},{\left|\xi_{2}\right|}^{p-2},...,{\left|\xi_{M}\right|}^{p-2}\right)$,
and ${\bf g}_{\text{p}}={\bf g}_{\text{gd}}-\frac{{\bf
g}_{\text{gd}}^{T}{\mbox{\boldmath$\xi$}_{i}}^{*}{\mbox{\boldmath$\xi$}_{i}}}{{\left\|{\mbox{\boldmath$\xi$}_{i}}\right\|}^{2}}$.
We have
${\left(\nabla_{{\mbox{\boldmath$\xi$}}_{i}}F\left(1-{\left\|{\mbox{\boldmath$\xi$}}_{i}\right\|}^{2}\right)\right)}^{H}{\bf
g}_{\text{p}}=0$, and thus the above equation can be calculated as

$\displaystyle{\left(\nabla_{{\mbox{\boldmath$\xi$}}_{i}}P\right)}^{H}{\bf
g}_{\text{p}}={\bf g}_{\text{gd}}^{H}{\bf g}_{\text{p}}={\left\|{\bf
g}_{\text{gd}}\right\|}^{2}\left(1-{\left(\cos\varrho\right)}^{2}\right)\geq
0,$ (98)

where $\varrho=\text{arcos}\left(\frac{{\bf
g}_{\text{gd}}^{H}{\mbox{\boldmath$\xi$}}_{i}}{\left\|{\bf
g}_{\text{gd}}\right\|\left\|{\mbox{\boldmath$\xi$}}_{i}\right\|}\right)$ is
the angle between vectors ${\bf g}_{\text{gd}}$ and
${\mbox{\boldmath$\xi$}}_{i}$.

Substituting (98) into (96), we obtain

$\displaystyle P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)-P\left({\bf
w}_{i+1},{\mbox{\boldmath$\xi$}}_{i}\right)={\left(\nabla_{{\mbox{\boldmath$\xi$}}_{i}}P\right)}^{H}{\bf
g}_{\text{p}}\frac{\sqrt{M}}{{\left\|{\bf
g}_{\text{p}}\right\|}^{2}}\varpi^{\star}\geq 0.$ (99)

To this end, combining 1) and 2), we have

$\displaystyle P\left({\bf w}_{i+1},{\mbox{\boldmath$\xi$}}_{i+1}\right)\geq
P\left({\bf w}_{i},{\mbox{\boldmath$\xi$}}_{i+1}\right)\geq P\left({\bf
w}_{i},{\mbox{\boldmath$\xi$}}_{i}\right).$ (100)

∎

###### Remark 4

Our method of iteratively optimizing the transmit beam and the phase shift
beam can provide an efficient way to gradually increase the average received
signal power, although only a sub-optimal solution can be ensured due to the
non-convexity of the problem.

###### Remark 5

For the BS beamforming scheme, the complexity is consumed by the eigenvector
calculation. Therefore, the complexity order of BS beamforming is
$\mathcal{O}\left(N^{3}\right)$.

For the IRS beamforming algorithm , the computational complexity is mainly
determined by the calculation of the gradient (90), involving computing the
$\ell_{p}$ norm and the matrix multiplication $\left({\bf
B}\odot{\left(\bar{\bf H}_{\text{B2I}}{\bf w}{\bf w}^{H}\bar{\bf
H}_{\text{B2I}}^{H}\right)}^{T}\right){\mbox{\boldmath$\xi$}}$. Hence, the
complexity order of Algorithm 1 for each iteration is
$\mathcal{O}\left(M^{2}+pM\right)$.

Finally, the overall complexity order of the joint optimization algorithm for
each iteration is given by
$\mathcal{O}\left(N_{\text{iter}}\left(M^{2}+pM\right)+N^{3}\right),$ where
$N_{\text{iter}}$ is specified in Algorithm 1.

##  V Achievable Rate analysis

In this section, we will present detailed analysis of the achievable rate.

###### Theorem 3

The achievable rate is given by

$\displaystyle R=\log_{2}\left(1+\frac{\tilde{\bf w}^{H}{\bf T}\tilde{\bf
w}}{\sigma_{0}^{2}}\right),$ (101)

where $\tilde{\bf w}\triangleq\sqrt{P_{\text{BS}}}{\bf t}_{\text{max}}$.

###### Proof:

Starting from Proposition 2, the result is readily obtained. ∎

Theorem 3 presents an expression for the achievable rate which quantifies the
impact of key system parameters, such as the number of BS antennas and
reflecting elements, as well as the impact of estimation error on the
achievable rate. For instance, it can be seen that the SNR is related to $\bf
T$. From the expression of $\bf T$ which is defined in Proposition 2, we can
conclude that the SNR drops nearly exponentially with the variance of the
angle estimation error. This is because inaccurate estimated angles makes it
difficult to generate highly directional beams, thereby causing severe power
loss.

###### Corollary 2

Assuming a large Rician K-factor and that the IRS and the user are in the
similar direction, the achievable rate can be approximated as

$\displaystyle
R_{\text{approx}}=\log_{2}\left(1+\frac{P_{\text{BS}}\Omega}{\sigma_{0}^{2}}\right),$
(102)

where

$\displaystyle\Omega$ $\displaystyle\triangleq
N\beta_{\text{B2I2U}}\sum\limits_{m=1}^{M}\sum\limits_{n=1}^{M}{\xi}_{m}^{*}{\xi}_{n}{\left[\bf
B\right]}_{mn}b_{\text{B2Ia},m}^{*}b_{\text{B2Ia},n}$ (103)
$\displaystyle+2\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}\text{Re}\left\\{\sum\limits_{m=1}^{M}{\xi}_{m}^{*}b_{\text{B2Ia},m}^{*}\left(\sum\limits_{i=1}^{N}{\left[\bf
C\right]}_{mi}a_{\text{B2I},i}^{*}\right)\right\\}+N\beta_{\text{B2U}}+N\sigma_{\text{NLOS}}^{2},$

where $a_{\text{B2I},m}$ and $b_{\text{B2Ia},m}$ are the $m$-th elements of
${\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2I}},\bar{\theta}_{\text{y-B2I}}\right)$
and ${\bf
b}^{T}\left(\bar{\theta}_{\text{x-B2Ia}},\bar{\theta}_{\text{y-B2Ia}}\right)$,
respectively.

###### Proof:

See Appendix F. ∎

Corollary 2 implies that increasing the number of BS antennas can greatly
improve the achievable rate. In particular, both the BS-user link and BS-IRS-
user link SNRs grow linearly with $N$. To get more insights, we derive an
upper bound for the achievable rate.

###### Proposition 5

An upper bound for the achievable rate is given by

$\displaystyle
R_{\text{upper}}=\log_{2}\left(1+\frac{P_{\text{BS}}N\left(\beta_{\text{B2I2U}}M^{2}+2\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}M+\beta_{\text{B2U}}+\sigma^{2}_{\text{NLOS}}\right)}{\sigma_{0}^{2}}\right).$
(104)

###### Proof:

Starting from Corollary 2 and using the fact that
$\sum\limits_{m=1}^{M}a_{m}\leq\sum\limits_{m=1}^{M}\left|a_{m}\right|$, we
have

$\displaystyle\Omega\leq
N\beta_{\text{B2I2U}}\sum\limits_{m=1}^{M}\sum\limits_{n=1}^{M}\left|{\left[\bf
B\right]}_{mn}\right|+2\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}\sum\limits_{m=1}^{M}\sum\limits_{i=1}^{N}\left|{\left[\bf
C\right]}_{mi}\right|+N\beta_{\text{B2U}}+N\sigma_{\text{NLOS}}^{2}.$ (105)

Noticing that $\left|{\left[\bf B\right]}_{mn}\right|\leq 1$ and
$\left|{\left[\bf C\right]}_{mi}\right|\leq 1$, (104) can be proved. ∎

Proposition 5 indicates that with fixed transmit power, the achievable rate is
mainly determined by the numbers of reflecting elements and BS antennas.
Specifically, the effective SNR is proportional to the number of BS antennas.
Moreover, there is a gain $M^{2}$ corresponding to the BS-IRS-user link. This
is reasonable because the IRS not only achieves the phase shift beamforming
gain of order $M$ in the IRS-user link, but also captures an inherent aperture
gain of order $M$ by collecting more signal power in the BS-IRS link. It is
worth noting that this $M^{2}$ gain only holds when $\sqrt{MA_{p}}\ll
d_{\text{B2I}}$ with $A_{p}$ being the effective aperture/area of each
reflecting element, due to the law of energy conservation [41].

###### Remark 6

This paper mainly focuses on a single user scenario. However, the proposed
angle domain design framework can be easily extended to the multi-user case.
For instance, with orthogonal pilot sequences, the proposed angle-domain
estimation method can be directly applied to separately estimate the effective
angles of each user. Also, the alternating optimization method can be
similarly applied to reduce the complexity of beamforming algorithms. The key
difference is that, in a multi-user scenario, the co-channel interference
should be taken into account. In addition, since all users share the same BS
and IRS beamforming vectors, the resultant optimization problem becomes much
more complicated.

##  VI numerical results

In this section, we provide numerical results to illustrate the performance of
the angle-domain IRS-aided system, as well as to verify the performance of the
proposed ML estimator and the joint optimization scheme. The considered system
operates at $2.45$ GHz. The large-scale fading coefficient is modeled as
$\alpha=L_{\text{d}}^{-\chi}$, where $\chi$ is the path loss exponent, and
$L_{\text{d}}$ is the transmission distance. We assume the BS is located at
the origin. The locations of the user and the IRS are denoted by
$(d_{\text{B2U}},\theta_{\text{B2U}},\phi_{\text{B2U}})$ and
$(d_{\text{B2I}},\theta_{\text{B2I}},\phi_{\text{B2I}})$, respectively. For
all simulations, unless otherwise specified, the following setup is used:
$N=16,M=256,P_{\text{BS}}=10\ \text{dBm},\sigma_{0}^{2}=-60\
\text{dBm},v_{\text{B2U}}=v_{\text{I2U}}=v_{\text{B2I}}=5,\chi_{\text{B2U}}=\chi_{\text{I2U}}=\chi_{\text{B2I}}=2.5$,
IRS location $(42\text{m},63^{\circ},-16^{\circ})$ and user location
$(41\text{m},47^{\circ},-16^{\circ})$.

Fig. 2 illustrates the performance of the proposed ML estimator given by
Theorem 1, where the analytical results are generated by (24) in Corollary 1.
For comparison, the conventional angle-domain estimation method, i.e., the
MUSIC method [42], is presented as the benchmark. Note that
$\text{MSE}_{\text{x-B2U}}$ and $\text{MSE}_{\text{y-B2U}}$ are defined by
$\mathbb{E}\\{{(\hat{\bar{\theta}}_{\text{x-B2U}}-\bar{\theta}_{\text{x-B2U}})}^{2}\\}$
and
$\mathbb{E}\\{{(\hat{\bar{\theta}}_{\text{y-B2U}}-\bar{\theta}_{\text{y-B2U}})}^{2}\\}$,
respectively. As can be readily observed, the numerical results match exactly
with the analytical results, thereby validating the correctness of the
analytical expressions. Although the MUSIC method is slightly better than the
proposed method, it requires more training time and has higher computational
complexity than the proposed method. Moreover, as expected in Corollary 1,
increasing the number of BS antennas can greatly reduce the mean square error
(MSE). This is because with a large number of BS antennas, more angle-related
data can be obtained, based on which we can estimate the angles more
accurately. In addition, we can see that the MSE is a decreasing function with
respect to the Rician K-factor, because a larger Rician K-factor means less
uncertainty arising from NLOS paths. Also, as the received SNR becomes larger,
the MSE gradually decreases due to less uncertainty caused by noise.

Figure 2:  Performance of the proposed ML estimator.

Fig. 3 illustrates the MSE for the calculated effective angles from the IRS to
the user given by Lemma 1, where the analytical results are generated by
Theorem 2. Note that $\text{MSE}_{\text{x-I2U}}$ and
$\text{MSE}_{\text{y-I2U}}$ are defined by
$\mathbb{E}\\{{(\hat{\bar{\theta}}_{\text{x-I2U}}-\bar{\theta}_{\text{x-I2U}})}^{2}\\}$
and
$\mathbb{E}\\{{(\hat{\bar{\theta}}_{\text{y-I2U}}-\bar{\theta}_{\text{y-I2U}})}^{2}\\}$,
respectively. We can see that the numerical curves match the analytical curves
well. Besides, the MSE decreases with the received SNR at the BS. This is
intuitive because the calculation of effective angles from IRS to the user
relies on the estimated angles from the BS to the user. Moreover, increasing
the ratio $Ra$ would severely degrade the accuracy of estimated effective
angles. The reason is that a larger $Ra$ means that the user is closer to the
IRS, making the calculated angles more sensitive to the estimation error of
angles from the BS to the user .

Figure 3:  The MSE for the calculated effective angles from the IRS to the
user with IRS location $(57.8\text{m},63^{\circ},-16^{\circ})$ .

Fig. 4 illustrates the convergence of the proposed joint beamforming method
given by Algorithm 2. As expected in Proposition 4, the proposed algorithm can
gradually increase the average received SNR. Moreover, the algorithm converges
after only several iterations, making it a low-complexity method. Besides, the
received SNR increases as the number of reflecting elements becomes larger,
which indicates the benefit of applying a large number of reflecting elements.

Figure 4:  The convergence of the proposed joint optimization algorithm.

Fig. 5 shows the performance of the proposed angle-based beamforming
algorithm. For comparison, the algorithm in [15] which assumes full CSI is
presented as “Benchmark 1”, while a beamforming algorithm based on angles
estimated by the MUSIC method is presented as “Benchmark 2”. As can be seen,
our proposed angle-based algorithm achieves nearly the same performance as
both benchmark algorithms. The beamforming algorithm corresponding to
“Benchmark 1 ” achieves the best performance, but requires full CSI. Although
the angle-based beamforming algorithm corresponding to “Benchmark 2 ” is
slightly better than the proposed algorithm, it adopts the MUSIC method to
estimate angle information and thus has higher training overhead and
computational complexity than the proposed angle-domain estimation method.

Figure 5: Performance of the proposed beamforming scheme with $N=4$ and
$M=36$.

Fig. 6 depicts the impact of the number of reflecting elements on the beam
pattern of the optimized BS beam. As can be observed, with $400$ reflecting
elements, the main lobe is in the user direction. As the number of reflecting
elements increases, the lobe in the user direction gradually becomes smaller
and the main lobe appears in the IRS direction, because increasing the number
of reflecting elements can enhance the BS-IRS-user link.

Figure 6:  The impact of the number of reflecting elements on the transmit
beam pattern with $N=36$, user location $(41\text{m},133^{\circ},-16^{\circ})$
and IRS location $(42\text{m},63^{\circ},-16^{\circ})$.

Fig. 7 shows the achievable rate of the considered system with different
configurations, where the curves associated with “Approximate rate” and
“Limit” are plotted according to Corollary 2 and Proposition 5, respectively.
As can be readily observed, the three curves corresponding to
“Limit”,“Approximate rate” and “With IRS and direct link” have the similar
trend, which verifies the effectiveness of our analysis in Corollary 2 and
Proposition 5. Moreover, we can see that the achievable rate with IRS is much
larger than that without IRS, which indicates the great benefit of IRS.
Besides, when there is no direct link, the achievable rate becomes extremely
low. This is because the acquisition of angle information corresponding to
both the BS-IRS and IRS-user links relies on the BS-user direct link. Without
the direct link, the BS is not able to obtain any channel information.

Figure 7:  Achievable rate performance with
$N=4,\chi_{\text{B2I}}=\chi_{\text{I2U}}=2.3$ and $\chi_{\text{B2U}}=2.8$.

##  VII conclusion

This paper considers an IRS-aided system from an angle-domain aspect. The ML
estimators for the effective angles from the BS to the user are provided,
based on which the effective angles from the IRS to the user are calculated.
It has been shown that increasing the number of BS antennas can significantly
reduce the estimation error. Also, placing the IRS closer to the BS would lead
to a smaller estimation error of the estimated angles from the IRS to the
user. Then, exploiting the estimated angles, a joint optimization algorithm of
BS beamforming and IRS beamforming has been proposed, which achieves similar
performance to two benchmark algorithms based on full CSI and the MUSIC method
respectively. Beam patterns of the optimized BS beam indicate that as the
number of reflecting elements becomes larger, the beam becomes more focused
towards the IRS direction, as should be expected. Analysis of the achievable
rate quantifies the benefit of deploying a large number of BS antennas or
reflecting elements. In particular, the BS-user link and the BS-IRS-user link
can obtain power gains of order $N$ and $NM^{2}$, respectively.

##  Appendix A Proof of Proposition 1

The received signal at the $n$-th antenna can be decomposed into the LOS
component and the uncertainty component, i.e.,

$\displaystyle
r_{n}=A_{\text{ob},n}e^{j\vartheta_{n}}=A_{\text{LOS},n}e^{j\left(\theta_{\text{q}}+i_{N,n}\bar{\theta}_{\text{x-B2I}}+j_{N,n}\bar{\theta}_{\text{y-B2I}}\right)}+A_{\text{unct},n}e^{j\vartheta_{\text{unct},n}},$
(106)

where

$\displaystyle
A_{\text{LOS},n}e^{j\left(\theta_{\text{q}}+i_{N,n}\bar{\theta}_{\text{x-B2I}}+j_{N,n}\bar{\theta}_{\text{y-B2I}}\right)}\triangleq\sqrt{\frac{\alpha_{\text{U}}v_{\text{B2U}}}{v_{\text{B2U}}+1}}e^{\left(i_{N,n}\bar{\theta}_{\text{x-B2I}}+j_{N,n}\bar{\theta}_{\text{y-B2I}}\right)}q,$
(107) $\displaystyle
A_{\text{unct},n}e^{j\vartheta_{\text{unct},n}}\triangleq\sqrt{\frac{\alpha_{\text{U}}}{v_{\text{B2U}}+1}}\tilde{h}_{\text{B2U},n}q+n_{\text{BS},n},$
(108)

with $A_{\text{ob},n},A_{\text{LOS},n}$ and $A_{\text{unct},n}$ denoting the
corresponding amplitudes and $\vartheta_{\text{unct},n}$ denoting the angle of
the uncertainty component.

Furthermore, denote $r_{n}$, its LOS component and uncertainty component in a
vector form by $\overrightarrow{\bf a}$, $\overrightarrow{\bf b}$ and
$\overrightarrow{\bf c}$ respectively. As such, we have $\overrightarrow{\bf
a}=\overrightarrow{\bf b}+\overrightarrow{\bf c}$, yielding a triangle.
According to the property of triangles and noticing that $e_{n}$ is
approximately the angle between $\overrightarrow{\bf a}$ and
$\overrightarrow{\bf b}$, we have $\sin
e_{n}=\frac{A_{\text{unct},n}}{A_{\text{ob},n}}\sin\theta_{\text{ob},n}$,
where
$\theta_{\text{ob},n}\triangleq\theta_{\text{q},n}+i_{N,n}\bar{\theta}_{\text{x-B2I}}+j_{N,n}\bar{\theta}_{\text{y-B2I}}-\vartheta_{\text{unct},n}$.

Using Taylor expansion, we obtain
$e_{n}=\frac{A_{\text{unct},n}}{A_{\text{ob},n}}\sin\theta_{\text{ob},n}$,
where we follow the fact $\underset{x\to 0}{\lim}\sin x=x$.

Due to a large Rician K-factor and a high received SNR at the BS,
$A_{\text{unct},n}$ is much smaller than $A_{\text{LOS},n}$. Hence, we have

$\displaystyle
e_{n}\approx\frac{A_{\text{unct},n}}{A_{\text{LOS},n}}\sin\theta_{\text{ob},n}=\frac{A_{\text{unct},n}}{\sqrt{\frac{\alpha_{\text{B2U}}v_{\text{B2U}}P_{q}}{v_{\text{B2U}}+1}}}\sin\theta_{\text{ob},n}.$
(109)

Since $A_{\text{unct},n}$ and $\vartheta_{\text{unct},n}$ are the amplitude
and the angle of a complex Gaussian random variable respectively,
$A_{\text{unct},n}$ follows Rayleigh distribution and $\theta_{\text{ob},n}$
is uniformly distributed. Therefore, $e_{n}$ is circularly symmetric Gaussian
with the variance given by

$\displaystyle\sigma_{e}^{2}=\frac{1}{A_{\text{LOS},n}^{2}}\mathbb{E}\left\\{{\left|A_{\text{unct},n}\right|}^{2}\right\\}\mathbb{E}\left\\{{\left|\sin\theta_{\text{ob},n}\right|}^{2}\right\\}\overset{(a)}{=}\frac{\left(4-\pi\right)\left(v_{\text{B2U}}+1\right)}{8\alpha_{\text{B2U}}P_{q}v_{\text{B2U}}}\left(\frac{\alpha_{\text{B2U}}P_{q}}{v_{\text{B2U}}+1}+\sigma_{\text{BS},0}^{2}\right),$
(110)

where $(a)$ is derived according to
$\mathbb{E}\left\\{{\left|A_{\text{unct},n}\right|}^{2}\right\\}=\frac{4-\pi}{4}\left(\frac{\alpha_{\text{B2U}}P_{q}}{v_{\text{B2U}}+1}+\sigma_{\text{BS},0}^{2}\right)$
and
$\mathbb{E}\left\\{{\left|\sin\theta_{\text{ob},n}\right|}^{2}\right\\}=\frac{1}{2}$.

After some algebraic manipulations, we can obtained the desired result.

##  Appendix B Proof of Theorem 1

Define
${\mbox{\boldmath$\Delta\vartheta$}}\triangleq{\left[\Delta\bar{\theta}_{1,m_{1}},...,\Delta\bar{\theta}_{n,m_{n}},...,\Delta\bar{\theta}_{\frac{N}{2},m_{\frac{N}{2}}}\right]}^{T}$,
and
$\mbox{\boldmath$\bar{\theta}$}\triangleq{[\bar{\theta}_{\text{x-B2U}},\bar{\theta}_{\text{y-B2U}}]}^{T}$.
The conditional probability density function (PDF) of $\Delta\vartheta$ is
given by

$\displaystyle
p({\mbox{\boldmath$\Delta\vartheta$}};\mbox{\boldmath$\bar{\theta}$})=\prod_{n=1}^{\frac{N}{2}}\frac{1}{\sqrt{2\pi\sigma_{\text{pd}}^{2}}}\exp\left({-\frac{1}{2\sigma_{\text{pd}}^{2}}{\left(\Delta\bar{\theta}_{n,m_{n}}+\left(i_{N,n}-i_{N,m_{n}}\right)\bar{\theta}_{\text{x-B2U}}+\left(j_{N,n}-j_{N,m_{n}}\right)\bar{\theta}_{\text{y-B2U}}\right)}^{2}}\right).$
(111)

According to the Neyman-Fisher Factorization theorem, we factor the above PDF
as

$\displaystyle
p({\mbox{\boldmath$\Delta\vartheta$}};\mbox{\boldmath$\bar{\theta}$})=f_{1}\left({\mbox{\boldmath$\Delta\vartheta$}}\right)f_{2}\left(\bf{T}\left(\mbox{\boldmath$\Delta\vartheta$}\right),\mbox{\boldmath$\bar{\theta}$}\right),$
(112)

where

$\displaystyle
f_{1}\left({\mbox{\boldmath$\Delta\vartheta$}}\right)=\frac{1}{{\left(\sqrt{2\pi\sigma_{\text{pd}}}\right)}^{\frac{N}{2}}}\exp\left(-\frac{1}{2\sigma_{\text{pd}}^{2}}\sum\limits_{n=1}^{\frac{N}{2}}\Delta\bar{\theta}_{n,m_{n}}^{2}\right),$
(113) $\displaystyle
f_{2}\left(\bf{T}\left(\mbox{\boldmath$\Delta\vartheta$}\right),\mbox{\boldmath$\bar{\theta}$}\right)\\!=\\!\exp\left(\\!-\frac{1}{2\sigma_{\text{pd}}^{2}}\sum\limits_{n=1}^{\frac{N}{2}}{\left(\left(i_{N,n}-i_{N,m_{n}}\right)\bar{\vartheta}_{\text{x-B2U}}\\!+\\!\left(j_{N,n}-j_{N,m_{n}}\right)\bar{\vartheta}_{\text{y-B2U}}\right)}^{2}\right)$
(114)
$\displaystyle\times\exp\left(\\!\\!-\frac{1}{\sigma_{\text{pd}}^{2}}\left(\bar{\vartheta}_{\text{x-B2U}}T_{1}\\!+\\!\bar{\vartheta}_{\text{y-B2U}}T_{2}\right)\right),$
$\displaystyle{\bf{T}}\left(\mbox{\boldmath$\Delta\vartheta$}\right)=[T_{1},T_{2}]^{T}.$
(115)

where
$T_{1}=\sum\limits_{n=1}^{\frac{N}{2}}\left(i_{N,n}-i_{N,m_{n}}\right)\Delta\bar{\theta}_{n,m_{n}}$
and
$T_{2}=\sum\limits_{n=1}^{\frac{N}{2}}\left(j_{N,n}-j_{N,m_{n}}\right)\Delta\bar{\theta}_{n,m_{n}}$.

As such, we obtain a sufficient statistic
${\bf{T}}\left(\mbox{\boldmath$\Delta\vartheta$}\right)$ for $\bar{\theta}$.
Thus, $\hat{\bar{\mbox{\boldmath$\theta$}}}$ should be a function with respect
to ${\bf{T}}\left(\mbox{\boldmath$\Delta\vartheta$}\right)$. Also, noticing
that $\hat{\bar{\mbox{\boldmath$\theta$}}}$ is unbiased, we obtain
$\hat{\bar{\theta}}_{\text{x-B2U}}=-\frac{T_{1}}{Q_{1}}$ and
$\hat{\bar{\theta}}_{\text{y-B2U}}=-\frac{T_{2}}{Q_{1}}$, where
$Q_{1}\triangleq\sum\limits_{n=1}^{N/2}{\left(i_{N,n}-i_{N,m_{n}}\right)}^{2}=\frac{1}{6}N\left(N-1\right)$.

##  Appendix C Proof of Theorem 2

We first focus on the derivation of (32). Acording to Lemma 1, we can express
the effective angle from the IRS to the user along $x$ axis as

$\displaystyle\bar{\theta}_{\text{x-I2U}}=\frac{\hat{d}_{\text{I2U}}}{d_{\text{I2U}}}\hat{\bar{\theta}}_{\text{x-I2U}}+\frac{d_{\text{B2U}}}{d_{\text{I2U}}}\epsilon_{\text{x-B2U}},$
(116)

where

$\displaystyle
d_{\text{I2U}}\\!=\\!\sqrt{{\\!\left(\\!x_{\text{I}}\\!-\\!\hat{x}_{\text{U}}\\!-\\!\frac{d_{\text{B2U}}}{\pi}\epsilon_{\text{x-B2U}}\\!\right)\\!}^{2}\\!+\\!{\\!\left(\\!y_{\text{I}}\\!-\\!\hat{y}_{\text{U}}\\!-\\!\frac{d_{\text{B2U}}}{\pi}\epsilon_{\text{y-B2U}}\\!\right)\\!}^{2}\\!+\\!{\left(z_{\text{I}}-z_{\text{U}}\right)}^{2}}.$
(117)

Recall
${z}_{\text{U}}=-\frac{d_{\text{B2U}}\sqrt{\pi^{2}-{\bar{\theta}}_{\text{x-B2U}}^{2}-{\bar{\theta}}_{\text{y-B2U}}^{2}}}{\pi}$.
Using the Taylor expansion of $(1+x)^{\frac{1}{2}}$ at $x=0$, we have

$\displaystyle{z}_{\text{U}}\\!\approx\\!d_{\text{B2U}}\left(\\!-1\\!+\\!\frac{{\bar{\theta}}_{\text{x-B2U}}^{2}\\!+\\!{\bar{\theta}}_{\text{y-B2U}}^{2}}{2\pi^{2}}\right)\\!=\\!\hat{z}_{\text{U}}\\!+\\!\frac{d_{\text{B2U}}\left(\epsilon_{\text{x-B2U}}^{2}+\epsilon_{\text{y-B2U}}^{2}\\!+\\!2\epsilon_{\text{x-B2U}}{\bar{\theta}}_{\text{x-B2U}}\\!+\\!2\epsilon_{\text{y-B2U}}{\bar{\theta}}_{\text{y-B2U}}\right)}{2\pi^{2}}.$
(118)

Then, we write $\frac{\hat{d}_{\text{I2U}}}{d_{\text{I2U}}}$ as

$\displaystyle\frac{\hat{d}_{\text{I2U}}}{d_{\text{I2U}}}=1/\sqrt{1+Q_{2}},$
(119)

with

$\displaystyle Q_{2}\approx
2\frac{\frac{d_{\text{B2U}}}{\pi}\left({x}_{\text{I}}-\hat{x}_{\text{U}}\right)\epsilon_{\text{x-B2U}}+\frac{d_{\text{B2U}}}{\pi}\left({y}_{\text{I}}-\hat{y}_{\text{U}}\right)\epsilon_{\text{y-B2U}}-\frac{d_{\text{B2U}}}{\pi^{2}}\left(z_{\text{I}}-\hat{z}_{\text{U}}\right)\left(\hat{\bar{\theta}}_{\text{x-I2U}}\epsilon_{\text{x-B2U}}+\hat{\bar{\theta}}_{\text{y-I2U}}\epsilon_{\text{y-B2U}}\right)}{\hat{d}_{\text{I2U}}^{2}}.$

Recall that
$\hat{\bar{\theta}}_{\text{x-I2U}}=\frac{\left({x}_{\text{I}}-\hat{x}_{\text{U}}\right)\pi}{\hat{d}_{\text{I2U}}}$
and
$\hat{\bar{\theta}}_{\text{y-I2U}}=\frac{\left({y}_{\text{I}}-\hat{y}_{\text{U}}\right)\pi}{\hat{d}_{\text{I2U}}}$.
We can rewrite $Q_{2}$ as

$\displaystyle
Q_{2}=\frac{2d_{\text{B2U}}}{\pi^{2}\hat{d}_{\text{I2U}}}\left\\{\left(\hat{\bar{\theta}}_{\text{x-I2U}}-\frac{\hat{\bar{\theta}}_{\text{x-I2U}}\hat{\bar{\theta}}_{\text{z-I2U}}}{\pi}\right)\epsilon_{\text{x-B2U}}+\left(\hat{\bar{\theta}}_{\text{y-I2U}}-\frac{\hat{\bar{\theta}}_{\text{y-I2U}}\hat{\bar{\theta}}_{\text{z-I2U}}}{\pi}\right)\epsilon_{\text{y-B2U}}\right\\},$
(120)

where
$\hat{\bar{\theta}}_{\text{z-I2U}}\triangleq\frac{\left({z}_{\text{I}}-\hat{z}_{\text{U}}\right)\pi}{\hat{d}_{\text{I2U}}}$.

Using the Taylor expansion of ${\left(1+Q_{2}\right)}^{-\frac{1}{2}}$ at
$Q_{2}=0$, (119) can be approximated as

$\displaystyle\frac{\hat{d}_{\text{I2U}}}{d_{\text{I2U}}}=1-\frac{1}{2}Q_{2}+{o}\left(Q_{2}\right){\approx}1-\frac{1}{2}Q_{2}.$
(121)

Similarly, we can express $\frac{d_{\text{B2U}}}{d_{\text{I2U}}}$ as

$\displaystyle\frac{d_{\text{B2U}}}{d_{\text{I2U}}}=\frac{d_{\text{B2U}}}{\hat{d}_{\text{I2U}}}\left(1-\frac{1}{2}Q_{2}\right).$
(122)

Substituting (121) and (122) into (116), we have

$\displaystyle\bar{\theta}_{\text{x-I2U}}=\left(1-\frac{1}{2}Q_{2}\right)\hat{\bar{\theta}}_{\text{x-I2U}}+\frac{d_{\text{B2U}}}{\hat{d}_{\text{I2U}}}\left(1-\frac{1}{2}Q_{2}\right)\epsilon_{\text{x-B2U}}$
(123)
$\displaystyle\overset{(a)}{\approx}\left(1-\frac{1}{2}Q_{2}\right)\hat{\bar{\theta}}_{\text{x-I2U}}+\frac{d_{\text{B2U}}}{\hat{d}_{\text{I2U}}}\epsilon_{\text{x-B2U}}.$

After some algebraic manipulations, we complete the proof of (32). Following
the similar process, we can obtain (33).

##  Appendix D Proof of Proposition 2

The average received power is given by

$\displaystyle P_{\text{r}}=\mathbb{E}\left\\{{\left|{\bf g}^{T}{\bf
w}\right|}^{2}\right\\}=\mathbb{E}\left\\{{\left|{\bf g}_{\text{LOS}}^{T}{\bf
w}\right|}^{2}\right\\}+\mathbb{E}\left\\{{\left|{\bf g}_{\text{NLOS}}^{T}{\bf
w}\right|}^{2}\right\\},$ (124)

where the effective channel is defined as ${\bf g}^{T}={\bf
h}_{\text{B2U}}^{T}+{\bf h}_{\text{I2U}}^{T}{\mbox{\boldmath$\Theta$}}{\bf
H}_{\text{B2I}}$ and decomposed as ${\bf g}_{\text{LOS}}^{T}+{\bf
g}_{\text{NLOS}}^{T}$ with

$\displaystyle{\bf
g}_{\text{LOS}}^{T}=\sqrt{\frac{\alpha_{\text{I2U}}\alpha_{\text{B2I}}v_{\text{B2I}}v_{\text{I2U}}}{\left(v_{\text{B2I}}+1\right)\left(v_{\text{I2U}}+1\right)}}{\bf
b}^{T}\left(\bar{\theta}_{\text{x-I2U}},\bar{\theta}_{\text{y-I2U}}\right){\bf\Theta}{\bf\bar{H}}_{\text{B2I}}+\sqrt{\frac{\alpha_{\text{B2U}}v_{\text{B2U}}}{v_{\text{B2U}}+1}}{\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2U}},\bar{\theta}_{\text{y-B2U}}\right),$
(125) $\displaystyle{\bf
g}_{\text{NLOS}}^{T}=\sqrt{\frac{\alpha_{\text{B2I}}\alpha_{\text{I2U}}}{v_{\text{B2I}}+1}}{\bf
h}_{\text{I2U}}^{T}{\bf\Theta}{\bf\tilde{H}}_{\text{B2I}}+\sqrt{\frac{\alpha_{\text{B2I}}\alpha_{\text{I2U}}v_{\text{B2I}}}{\left(v_{\text{B2I}}+1\right)\left(v_{\text{I2U}}+1\right)}}\tilde{\bf
h}_{\text{I2U}}^{T}{\bf\Theta}{\bf\bar{H}}_{\text{B2I}}+\sqrt{\frac{\alpha_{\text{B2U}}}{v_{\text{B2U}}+1}}{\bf\tilde{h}}_{\text{B2U}}^{T},$
(126)

where $\bar{\bf H}_{\text{B2I}}\triangleq{\bf
b}\left(\bar{\theta}_{\text{x-B2Ia}},\bar{\theta}_{\text{y-B2Ia}}\right){\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2I}},\bar{\theta}_{\text{y-B2I}}\right)$.

We start with the calculation of the second term:

$\displaystyle\mathbb{E}\left\\{{\left|{\bf g}_{\text{NLOS}}^{T}{\bf
w}\right|}^{2}\right\\}=\text{tr}\left({\bf w}{\bf
w}^{H}\mathbb{E}\left\\{{\bf g}_{\text{NLOS}}^{*}{\bf
g}_{\text{NLOS}}^{T}\right\\}\right)=\sigma_{\text{NLOS}}^{2}{\bf w}^{H}{\bf
w},$ (127)

where

$\displaystyle\sigma_{\text{NLOS}}^{2}=M\frac{\alpha_{\text{I2U}}\alpha_{\text{B2I}}}{v_{\text{B2I}}+1}\left(1+\frac{v_{\text{B2I}}}{v_{\text{I2U}}+1}\right)+\frac{\alpha_{\text{B2U}}}{v_{\text{B2U}}+1}.$
(128)

Then, we calculate the first term:

$\displaystyle\mathbb{E}\left\\{{\left|{\bf g}_{\text{LOS}}^{T}{\bf
w}\right|}^{2}\right\\}=T_{1}+T_{2}+2\text{Re}\left(T_{3}\right),$ (129)

where

$\displaystyle T_{1}=\mathbb{E}\left\\{{\bf
b}^{T}\left(\bar{\theta}_{\text{x-I2U}},\bar{\theta}_{\text{y-I2U}}\right){\mbox{\boldmath$\phi$}}_{b}{\mbox{\boldmath$\phi$}}_{b}^{H}{\bf
b}^{*}\left(\bar{\theta}_{\text{x-I2U}},\bar{\theta}_{\text{y-I2U}}\right)\right\\},$
(130) $\displaystyle T_{2}=\mathbb{E}\left\\{{\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2U}},\bar{\theta}_{\text{y-B2U}}\right){\mbox{\boldmath$\phi$}}_{a}{\mbox{\boldmath$\phi$}}_{a}^{H}{\bf
a}^{*}\left(\bar{\theta}_{\text{x-B2U}},\bar{\theta}_{\text{y-B2U}}\right)\right\\},$
(131) $\displaystyle T_{3}=\mathbb{E}\left\\{{\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2U}},\bar{\theta}_{\text{y-B2U}}\right){\mbox{\boldmath$\phi$}}_{a}{\mbox{\boldmath$\phi$}}_{b}^{H}{\bf
b}^{*}\left(\bar{\theta}_{\text{x-I2U}},\bar{\theta}_{\text{y-I2U}}\right)\right\\},$
(132)

with

$\displaystyle{\mbox{\boldmath$\phi$}}_{a}\triangleq\sqrt{\frac{v_{\text{B2U}}\alpha_{\text{B2U}}}{v_{\text{B2U}}+1}}{\bf
w},\
{\mbox{\boldmath$\phi$}}_{b}\triangleq\sqrt{\frac{v_{\text{B2I}}\alpha_{\text{B2I}}\alpha_{\text{I2U}}}{v_{\text{B2I}}+1}}{\bf\Theta}\bar{\bf
H}_{\text{B2I}}{\bf w}.$ (133)

1) Calculate $T_{1}$

$\displaystyle
T_{1}=\text{tr}\left({\mbox{\boldmath$\phi$}}_{b}{\mbox{\boldmath$\phi$}}_{b}^{H}{\bf
B}\right)={\mbox{\boldmath$\phi$}}_{b}^{H}{\bf
B}{\mbox{\boldmath$\phi$}}_{b},$ (134)

where ${\bf B}\triangleq\mathbb{E}\left\\{{\bf
b}^{*}\left(\bar{\theta}_{\text{x-I2U}},\bar{\theta}_{\text{y-I2U}}\right){\bf
b}^{T}\left(\bar{\theta}_{\text{x-I2U}},\bar{\theta}_{\text{y-I2U}}\right)\right\\}$
with elements given by

$\displaystyle{\left[{\bf
B}\right]}_{mn}=\mathbb{E}\left\\{\exp\left(j\left(i_{M,n}-i_{M,m}\right)\bar{\theta}_{\text{x-I2U}}+j\left(j_{M,n}-j_{M,m}\right)\bar{\theta}_{\text{y-I2U}}\right)\right\\}.$
(135)

Substituting (32) and (33) into (135), we have

$\displaystyle{\left[{\bf
B}\right]}_{mn}={\left[{\bf\hat{B}}\right]}_{mn}\mathbb{E}\left\\{\exp\left(j\left(i_{M,mn}\varphi_{1}+j_{M,mn}\varphi_{2}\right)\epsilon_{\text{x-B2U}}+j\left(i_{M,mn}\varphi_{2}+j_{M,mn}\varphi_{\text{3}}\right)\epsilon_{\text{y-B2U}}\right)\right\\},$
(136)

where ${\bf\hat{B}}\triangleq{\bf
b}^{*}\left(\hat{\bar{\theta}}_{\text{x-I2U}},\hat{\bar{\theta}}_{\text{y-I2U}}\right){\bf
b}^{T}\left(\hat{\bar{\theta}}_{\text{x-I2U}},\hat{\bar{\theta}}_{\text{y-I2U}}\right)$,
$i_{M,mn}\triangleq\left(i_{M,n}-i_{M,m}\right)$,
$j_{M,mn}\triangleq\left(j_{M,n}-j_{M,m}\right)$.

Noticing that $\epsilon_{\text{x-B2U}}$ and $\epsilon_{\text{y-B2U}}$ follow
complex Gaussian distribution
$\mathcal{CN}\left(0,\sigma_{\text{est}}^{2}\right)$, (136) can be calculated
as

$\displaystyle{\left[{\bf
B}\right]}_{mn}={\left[{\bf\hat{B}}\right]}_{mn}\exp\left(-\frac{1}{2}\sigma_{\text{est}}^{2}\left\\{{\left(i_{M,mn}\varphi_{1}+j_{M,mn}\varphi_{2}\right)}^{2}+{\left(i_{M,mn}\varphi_{2}+j_{M,mn}\varphi_{3}\right)}^{2}\right\\}\right).$
(137)

2) Calculate $T_{2}$

$\displaystyle
T_{2}=\text{tr}\left({\mbox{\boldmath$\phi$}}_{a}{\mbox{\boldmath$\phi$}}_{a}^{H}{\bf
A}\right)={\mbox{\boldmath$\phi$}}_{a}^{H}{\bf
A}{\mbox{\boldmath$\phi$}}_{a},$ (138)

where ${\bf A}\triangleq\mathbb{E}\left\\{{\bf
a}^{*}\left(\bar{\theta}_{\text{x-B2U}},\bar{\theta}_{\text{y-B2U}}\right){\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2U}},\bar{\theta}_{\text{y-B2U}}\right)\right\\}$
with elements given by

$\displaystyle{\left[{\bf
A}\right]}_{mn}=\mathbb{E}\left\\{\exp\left(ji_{N,mn}\bar{\theta}_{\text{x-B2U}}+jj_{N,mn}\bar{\theta}_{\text{y-B2U}}\right)\right\\}.$
(139)

Invoking the results given by Theorem 2, we have

$\displaystyle{\left[{\bf
A}\right]}_{mn}={\left[{\bf\hat{A}}\right]}_{mn}\mathbb{E}\left\\{\exp\left(ji_{N,mn}\epsilon_{\text{x-B2U}}+jj_{N,mn}\epsilon_{\text{y-B2U}}\right)\right\\},$
(140)

where ${\bf\hat{A}}\triangleq{\bf
a}^{*}\left(\hat{\bar{\theta}}_{\text{x-B2U}},\hat{\bar{\theta}}_{\text{y-B2U}}\right){\bf
a}^{T}\left(\hat{\bar{\theta}}_{\text{x-B2U}},\hat{\bar{\theta}}_{\text{y-B2U}}\right)$.

Due to the fact that $\epsilon_{\text{x-B2U}}$ and $\epsilon_{\text{y-B2U}}$
follow complex Gaussian distribution
$\mathcal{CN}\left(0,\sigma_{\text{est}}^{2}\right)$, ${\left[{\bf
A}\right]}_{mn}$ can be computed as

$\displaystyle{\left[{\bf
A}\right]}_{mn}={\left[{\bf\hat{A}}\right]}_{mn}\exp\left(-\frac{1}{2}\sigma_{\text{est}}^{2}\left\\{i_{N,mn}^{2}+j_{N,mn}^{2}\right\\}\right).$
(141)

3) Calculate $T_{3}$

$\displaystyle T_{3}=\mathbb{E}\left\\{{\bf
a}^{T}{\mbox{\boldmath$\phi$}}_{a}{\mbox{\boldmath$\phi$}}_{b}^{H}{\bf
b}^{*}\right\\}=\text{tr}\left({\mbox{\boldmath$\phi$}}_{a}{\mbox{\boldmath$\phi$}}_{b}^{H}{\bf
C}\right)={\mbox{\boldmath$\phi$}}_{b}^{H}{\bf
C}{\mbox{\boldmath$\phi$}}_{a},$ (142)

where ${\bf C}\triangleq\mathbb{E}\left\\{{\bf
b}^{*}\left(\bar{\theta}_{\text{x-I2U}},\bar{\theta}_{\text{y-I2U}}\right){\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2U}},\bar{\theta}_{\text{y-B2U}}\right)\right\\}$
with elements ${\left[{\bf C}\right]}_{mn}$ given by

$\displaystyle{\left[{\bf
C}\right]}_{mn}=\mathbb{E}\left\\{\exp\left(j\left\\{i_{M,m}\bar{\theta}_{\text{x-I2U}}+j_{M,m}\bar{\theta}_{\text{y-I2U}}-i_{N,n}\bar{\theta}_{\text{x-B2U}}-j_{N,n}\bar{\theta}_{\text{y-B2U}}\right\\}\right)\right\\}.$
(143)

Invoking the results in Theorem 2, we have

$\displaystyle{\left[{\bf C}\right]}_{mn}={\left[{\bf\hat{C}}\right]}_{mn}$
(144)
$\displaystyle\times\mathbb{E}\left\\{\exp\left(j\left(i_{M,m}\varphi_{1}+j_{M,m}\varphi_{2}-i_{N,n}\right)\epsilon_{\text{x-B2U}}+j\left(i_{M,m}\varphi_{2}+j_{M,m}\varphi_{3}-j_{N,n}\right)\epsilon_{\text{y-B2U}}\right)\right\\},$

where ${\bf\hat{C}}\triangleq{\bf
b}^{*}\left(\hat{\bar{\theta}}_{\text{x-I2U}},\hat{\bar{\theta}}_{\text{y-I2U}}\right){\bf
a}^{T}\left(\hat{\bar{\theta}}_{\text{x-B2U}},\hat{\bar{\theta}}_{\text{y-B2U}}\right)$.

According to the fact that $\epsilon_{\text{x-B2U}}$ and
$\epsilon_{\text{y-B2U}}$ follow complex Gaussian distribution
$\mathcal{CN}\left(0,\sigma_{\text{est}}^{2}\right)$, we have

$\displaystyle{\left[{\bf
C}\right]}_{mn}={\left[{\bf\hat{C}}\right]}_{mn}\exp\left(-\frac{1}{2}\sigma_{\text{est}}^{2}\left\\{{\left(i_{M,m}\varphi_{1}+j_{M,m}\varphi_{2}-i_{N,n}\right)}^{2}+{\left(i_{M,m}\varphi_{2}+j_{M,m}\varphi_{3}-j_{N,n}\right)}^{2}\right\\}\right).$
(145)

Combining 1), 2) and 3), we have

$\displaystyle\mathbb{E}\left\\{{\left|{\bf g}_{\text{LOS}}^{T}{\bf
w}\right|}^{2}\right\\}={\mbox{\boldmath$\phi$}}_{b}^{H}{\bf
B}{\mbox{\boldmath$\phi$}}_{b}+{\mbox{\boldmath$\phi$}}_{a}^{H}{\bf
A}{\mbox{\boldmath$\phi$}}_{a}+2\text{Re}\left({\mbox{\boldmath$\phi$}}_{b}^{H}{\bf
C}{\mbox{\boldmath$\phi$}}_{a}\right),$ (146)

Combining (146) and (127) yields the desired result.

##  Appendix E Proof of Proposition 3

The constant-modulus constraint $|\xi_{i}|=1,i=1,\dots,M$ is equivalent to the
following two constraints:

$\displaystyle\text{tr}\left({\mbox{\boldmath$\xi$}}\right)=M,$ (147)
$\displaystyle\|{\mbox{\boldmath$\xi$}}_{\infty}\|\leq 1.$ (148)

Since we project ${\bf
g}_{\text{gd}}=-\nabla_{{\mbox{\boldmath$\xi$}}}G{\left(\mbox{\boldmath$\xi$}\right)}$
into the tangent plane of
$\text{tr}\left({\mbox{\boldmath$\xi$}}{\mbox{\boldmath$\xi$}}^{H}\right)=M$:
${\bf g}_{\text{p}}={\bf g}_{\text{gd}}-\frac{{\bf
g}_{\text{gd}}^{T}{\mbox{\boldmath$\xi$}}^{*}{\mbox{\boldmath$\xi$}}}{{\left\|{\mbox{\boldmath$\xi$}}\right\|}^{2}},$
and use ${\bf g}_{\text{p}}$ as the search direction, the first constraint
$\text{tr}\left({\mbox{\boldmath$\xi$}}\right)=M$ holds. Noticing that
$\underset{p\to\infty}{\lim}\ell_{p}=\ell_{\infty}$, the constraint
$\|{\mbox{\boldmath$\xi$}}_{\infty}\|\leq 1$ is approximately equivalent to
$\|{\mbox{\boldmath$\xi$}}_{p}\|\leq 1$ with a large $p$. Then a barrier
method is exploited to make $\|{\mbox{\boldmath$\xi$}}_{p}\|\leq 1$ satisfied.
To this end, we complete our proof.

##  Appendix F Proof of Corollary 2

Recall that the optimal ${\bf w}$ is $\sqrt{P_{\text{BS}}}{\bf
t}_{\text{max}}$ with ${\bf t}_{\text{max}}$ being the eigenvector of ${\bf
T}$ corresponding to the largest eigenvalue $\lambda_{\text{max}}$. Thus, the
average received signal power is given by
$P_{\text{r}}=P_{\text{BS}}\lambda_{\text{max}}.$

Due to the fact that the trace of a matrix is the sum of all eigenvalues, the
following equation holds $\text{tr}\left({\bf
T}\right)=\sum\limits_{n=1}^{N}\lambda_{T,n}.$ Since the channel is sparse,
the largest eigenvalue $\lambda_{\text{max}}$ dominates the trace
$\text{tr}\left({\bf T}\right)$. As such, we have
$\lambda_{\text{max}}\approx\text{tr}\left({\bf T}\right)$.

Thus, the achievable rate can be approximated as

$\displaystyle
R_{\text{approx}}=\log_{2}\left(1+\frac{P_{\text{BS}}\text{tr}\left({\bf
T}\right)}{\sigma_{0}^{2}}\right).$ (149)

Starting from Theorem 3, $\text{tr}\left({\bf T}\right)$ can be expressed as

$\displaystyle\text{tr}\left({\bf T}\right)$
$\displaystyle=\beta_{\text{B2I2U}}\sum\limits_{m=1}^{M}\sum\limits_{n=1}^{M}{\xi}_{m}^{*}{\xi}_{n}{\left[\bf
B\right]}_{mn}\left(\sum\limits_{i=1}^{N}{\left[\bar{\bf
H}_{\text{B2I}}^{*}\right]}_{mi}{\left[\bar{\bf
H}_{\text{B2I}}\right]}_{ni}\right)$ (150)
$\displaystyle+2\sqrt{\beta_{\text{B2I2U}}\beta_{\text{B2U}}}\text{Re}\left\\{\sum\limits_{m=1}^{M}{\xi}_{m}^{*}\left(\sum\limits_{i=1}^{N}{\left[\bf
C\right]}_{mi}{\left[\bar{\bf
H}_{\text{B2I}}^{*}\right]}_{mi}\right)\right\\}+N\beta_{\text{B2U}}+N\sigma_{\text{NLOS}}^{2}.$

Recall that $\bar{\bf H}_{\text{B2I}}={\bf
b}\left(\bar{\theta}_{\text{x-B2Ia}},\bar{\theta}_{\text{y-B2Ia}}\right){\bf
a}^{T}\left(\bar{\theta}_{\text{x-B2I}},\bar{\theta}_{\text{y-B2I}}\right)$.
We can obtain the desired result.

## References

  * [1] C. V. N. Index, “Global mobile data traffic forecast update, 2017–2022 white paper,” _Cisco: San Jose, CA, USA_ , 2019.
  * [2] C. Huang, A. Zappone, G. C. Alexandropoulos, M. Debbah, and C. Yuen, “Reconfigurable intelligent surfaces for energy efficiency in wireless communication,” _IEEE Transactions on Wireless Communications_ , vol. 18, no. 8, pp. 4157–4170, 2019.
  * [3] X. Hu, C. Zhong, Y. Zhu, X. Chen, and Z. Zhang, “Programmable metasurface based multicast systems: Design and analysis,” _IEEE Journal on Selected Areas in Communications_ , vol. 38, no. 8, pp. 1763–1776, 2020.
  * [4] X. Hu, C. Zhong, Y. Zhang, X. Chen, and Z. Zhang, “Location information aided multiple intelligent reflecting surface systems,” _IEEE Transactions on Communications_ , vol. 68, no. 12, pp. 7948–7962, 2020.
  * [5] X. Hu, J. Wang, and C. Zhong, “Statistical csi based design for intelligent reflecting surface assisted miso systems,” _Science China: Information Science_ , vol. 63, no. 12, p. 222303, 2020.
  * [6] J. Zhang, Y. Zhang, C. Zhong, and Z. Zhang, “Robust design for intelligent reflecting surfaces assisted miso systems,” _IEEE Communications Letters_ , vol. 24, no. 10, pp. 2353–2357, 2020.
  * [7] Q. Wu and R. Zhang, “Weighted sum power maximization for intelligent reflecting surface aided SWIPT,” _IEEE Wireless Communications Letters_ , vol. 9, no. 5, pp. 586–590, 2020.
  * [8] E. Björnson, Ö. Özdogan, and E. G. Larsson, “Intelligent reflecting surface vs. decode-and-forward: How large surfaces are needed to beat relaying?” _arXiv preprint arXiv:1906.03949_ , 2019.
  * [9] Y. Han, W. Tang, S. Jin, C.-K. Wen, and X. Ma, “Large intelligent surface-assisted wireless communication exploiting statistical CSI,” _IEEE Transactions on Vehicular Technology_ , vol. 68, no. 8, pp. 8238–8242, 2019.
  * [10] Q. Wu and R. Zhang, “Towards smart and reconfigurable environment: Intelligent reflecting surface aided wireless network,” _IEEE Communications Magazine_ , vol. 58, no. 1, pp. 106–112, 2020.
  * [11] T. J. Cui, M. Q. Qi, X. Wan, J. Zhao, and Q. Cheng, “Coding metamaterials, digital metamaterials and programmable metamaterials,” _Light: Science & Applications_, vol. 3, no. 10, p. e218, 2014.
  * [12] C. Liaskos, S. Nie, A. Tsioliaridou, A. Pitsillides, S. Ioannidis, and I. Akyildiz, “A new wireless communication paradigm through software-controlled metasurfaces,” _IEEE Communications Magazine_ , vol. 56, no. 9, pp. 162–169, 2018.
  * [13] J. Chen, Y.-C. Liang, Y. Pei, and H. Guo, “Intelligent reflecting surface: A programmable wireless environment for physical layer security,” _EEE Access_ , vol. 7, pp. 82 599–82 612, 2019.
  * [14] C. Huang, G. C. Alexandropoulos, A. Zappone, M. Debbah, and C. Yuen, “Energy efficient multi-user MISO communication using low resolution large intelligent surfaces,” in _2018 IEEE Globecom Workshops (GC Wkshps)_. IEEE, 2018, pp. 1–6.
  * [15] Q. Wu and R. Zhang, “Intelligent reflecting surface enhanced wireless network via joint active and passive beamforming,” _IEEE Transactions on Wireless Communications_ , vol. 18, no. 11, pp. 5394–5409, 2019.
  * [16] ——, “Intelligent reflecting surface enhanced wireless network: Joint active and passive beamforming design,” in _2018 IEEE Global Communications Conference (GLOBECOM)_. IEEE, 2018, pp. 1–6.
  * [17] J. Ye, S. Guo, and M.-S. Alouini, “Joint reflecting and precoding designs for SER minimization in reconfigurable intelligent surfaces assisted MIMO systems,” _IEEE Transactions on Wireless Communications,_ , vol. 19, no. 8, pp. 5561–5574, 2020.
  * [18] H. Guo, Y.-C. Liang, J. Chen, and E. G. Larsson, “Weighted sum-rate optimization for intelligent reflecting surface enhanced wireless networks,” in _2019 IEEE Global Communications Conference (GLOBECOM)_. IEEE, 2019, pp. 1–6.
  * [19] G. Yang, X. Xu, and Y.-C. Liang, “Intelligent reflecting surface assisted non-orthogonal multiple access,” in _2020 IEEE Wireless Communications and Networking Conference (WCNC)_. IEEE, 2020, pp. 1–6.
  * [20] P. Wang, J. Fang, X. Yuan, Z. Chen, H. Duan, and H. Li, “Intelligent reflecting surface-assisted millimeter wave communications: Joint active and passive precoding design,” _IEEE Transactions on Vehicular Technology (Early Access)_ , 2020.
  * [21] C. Pan, H. Ren, K. Wang, M. Elkashlan, A. Nallanathan, J. Wang, and L. Hanzo, “Intelligent reflecting surface enhanced MIMO broadcasting for simultaneous wireless information and power transfer,” _IEEE Journal on Selected Areas in Communications_ , vol. 38, no. 8, pp. 1719–1734, 2020.
  * [22] Z. Chu, W. Hao, P. Xiao, and J. Shi, “Intelligent reflecting surface aided multi-antenna secure transmission,” _IEEE Wireless Communications Letters_ , vol. 9, no. 1, pp. 108–112, 2020.
  * [23] Q. Wu and R. Zhang, “Beamforming optimization for intelligent reflecting surface with discrete phase shifts,” in _ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)_. IEEE, 2019, pp. 7830–7833.
  * [24] S. Abeywickrama, R. Zhang, and C. Yuen, “Intelligent reflecting surface: Practical phase shift model and beamforming optimization,” _IEEE Transactions on Communications_ , vol. 68, no. 9, pp. 5849–5863, 2020.
  * [25] X. Yu, D. Xu, D. W. K. Ng, and R. Schober, “IRS-assisted green communication systems: Provable convergence and robust optimization,” _arXiv preprint arXiv:2011.06484_ , 2020.
  * [26] D. Xu, X. Yu, Y. Sun, D. W. K. Ng, and R. Schober, “Resource allocation for IRS-assisted full-duplex cognitive radio systems,” _arXiv preprint arXiv:2003.07467_ , 2020.
  * [27] Y. Zhang, C. Zhong, Z. Zhang, and W. Lu, “Sum rate optimization for two way communications with intelligent reflecting surface,” _IEEE Communications Letters_ , vol. 25, no. 5, pp. 1090–1094, 2020.
  * [28] H. Shen, W. Xu, S. Gong, Z. He, and C. Zhao, “Secrecy rate maximization for intelligent reflecting surface assisted multi-antenna communications,” _IEEE Communications Letters_ , vol. 23, no. 9, pp. 1488–1492, 2019.
  * [29] Q.-U.-A. Nadeem, A. Kammoun, A. Chaaban, M. Debbah, and M.-S. Alouini, “Intelligent reflecting surface assisted multi-user MISO communication,” _arXiv preprint arXiv:1906.02360_ , 2019.
  * [30] B. Zheng and R. Zhang, “Intelligent reflecting surface-enhanced OFDM: Channel estimation and reflection optimization,” _IEEE Wireless Communications Letters_ , vol. 9, no. 4, pp. 518–522, 2020.
  * [31] Z.-Q. He and X. Yuan, “Cascaded channel estimation for large intelligent metasurface assisted massive MIMO,” _IEEE Wireless Communications Letters_ , vol. 9, no. 2, pp. 210–214, 2020.
  * [32] D. Mishra and H. Johansson, “Channel estimation and low-complexity beamforming design for passive intelligent surface assisted MISO wireless energy transfer,” in _ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)_. IEEE, 2019, pp. 4659–4663.
  * [33] L. Subrt and P. Pechac, “Intelligent walls as autonomous parts of smart indoor environments,” _IET communications_ , vol. 6, no. 8, pp. 1004–1010, 2012\.
  * [34] T. Abdelrahman, A. Muhammad, and A. Ahmed, “Energy efficient multi-user MISO communication using low resolution large intelligent surfaces,” in _2019 IEEE Global Communications Conference (GLOBECOM)_. IEEE, 2019, pp. 1–6.
  * [35] T. Abdelrahman, M. Alrabeiah, and A. Ahmed, “Enabling large intelligent surfaces with compressive sensing and deep learning,” _arXiv preprint arXiv:1904.10136_ , 2019.
  * [36] D. Xu, X. Yu, V. Jamali, D. W. K. Ng, and R. Schober, “Resource allocation for large IRS-assisted SWIPT systems with non-linear energy harvesting model,” _arXiv preprint arXiv:2010.00846_ , 2020.
  * [37] M. Jian, F. Gao, Z. Tian, S. Jin, and S. Ma, “Angle-domain aided UL/DL channel estimation for wideband mmwave massive MIMO systems with beam squint,” _IEEE Transactions on Wireless Communications_ , vol. 18, no. 7, pp. 3515–3527, 2019.
  * [38] W. Shao, S. Zhang, H. Li, N. Zhao, and O. A. Dobre, “Angle-domain NOMA over multicell millimeter wave massive MIMO networks,” _IEEE Transactions on Communications_ , vol. 68, no. 4, pp. 2277–2292, 2020.
  * [39] F. Dong, W. Wang, Z. Huang, and P. Huang, “High-resolution angle-of-arrival and channel estimation for mmwave massive MIMO systems with lens antenna array,” _IEEE Transactions on Vehicular Technology_ , vol. 69, no. 11, pp. 12 963–12 973, 2020.
  * [40] M. Simic and P. Pejovic, “Positioning in cellular networks,” in _Cellular Networks—Positioning, Performance Analysis, Reliability_. InTech, 2011, p. 51.
  * [41] E. Björnson and L. Sanguinetti, “Demystifying the power scaling law of intelligent reflecting surfaces and metasurfaces,” in _2019 IEEE 8th International Workshop on Computational Advances in Multi-Sensor Adaptive Processing (CAMSAP)_. IEEE, 2019, pp. 549–553.
  * [42] H. L. V. Trees, _Optimum Array Processing, Part IV of Detection, Estimation, and Modulation Theory_. New York: Wiley, 2002.