Member, IEEE Peng Xu

Senior Member, IEEE Gaojie Chen
email: gaojie.chen@leicester.ac.uk

Member, IEEE Zheng Yang

Fellow, IEEE Marco Di Renzo
email: marco.direnzo@centralesupelec.fr

Reconfigurable Intelligent Surfaces Assisted Communications with Discrete Phase Shifts: How Many Quantization Levels are Required to Achieve Full Diversity?

Keywords: Reconfigurable intelligent surface, discrete phase shifts, phase errors, outage probability, diversity order

Due to hardware limitations, the phase shifts of the reflecting elements of reconfigurable intelligent surfaces (RISs) need to be quantized into discrete values. This letter aims to unveil the minimum required number of phase quantization levels L in order to achieve the full diversity order in RISassisted wireless communication systems. With the aid of an upper bound of the outage probability, we first prove that the full diversity order is achievable provided that L is not less than three. If L = 2, on the other hand, we prove that the achievable diversity order cannot exceed (N + 1)/2, where N is the number of reflecting elements. This is obtained with the aid of a lower bound of the outage probability. Therefore, we prove that the minimum required value of L to achieve the full diversity order is L = 3. Simulation results verify the theoretical analysis and the impact of phase quantization levels on RISassisted communication systems.

I. INTRODUCTION

Reconfigurable intelligent surfaces (RISs) have recently received significant attention due to their ability to intelligently reconfigure the wireless environment by integrating passive reflectors on flat surfaces [1]- [START_REF] Huang | Holographic MIMO surfaces for 6G wireless networks: opportunities, challenges, and trends[END_REF]. Precisely, each element of the RIS can control the amplitude and phase of the reflected signal, such that multiple reflected signals can be co-phased through passive beamforming. Compared with other technologies, such as relaying, RISs do not need to use radio-frequency chains and enjoys a convenient and low-cost deployment [START_REF] Wu | Towards smart and reconfigurable environment: Intelligent reflecting surface aided wireless network[END_REF], [START_REF] Di Renzo | Reconfigurable intelligent surfaces vs. relaying: Differences, similarities, and performance comparison[END_REF].

Due to their potential benefits in the context of wireless communications, RISs have recently been employed for several applications, which include beamforming [START_REF] Wu | Intelligent reflecting surface enhanced wireless network via joint active and passive beamforming[END_REF], [START_REF]Beamforming optimization for wireless network aided by intelligent reflecting surface with discrete phase shifts[END_REF], nonorthogonal multiple access [START_REF] Ding | On the impact of phase shifting designs on IRS-NOMA[END_REF], [START_REF] Zheng | Intelligent reflecting surface-assisted multiple access with user pairing: NOMA or OMA?[END_REF], physical layer security [START_REF] Chu | Intelligent reflecting surface aided multi-antenna secure transmission[END_REF], relaying [START_REF] Di Renzo | Reconfigurable intelligent surfaces vs. relaying: Differences, similarities, and performance comparison[END_REF], [START_REF] Abdullah | A hybrid relay and intelligent reflecting surface network and its ergodic performance analysis[END_REF], etc. These existing works have demonstrated that a suitable design of the phase shifts of the reflecting elements is necessary to reap the advantages of RIS-aided transmission. However, most of these existing works assume that the phase shifts of the reflectors are continuous variables, which is difficult to implement in practice due to hardware limitations. Motivated by these considerations, recent works have investigated the performance of RIS-assisted systems in the presence of quantization phase errors (e.g., [START_REF]Beamforming optimization for wireless network aided by intelligent reflecting surface with discrete phase shifts[END_REF], [START_REF] Zheng | Intelligent reflecting surface-assisted multiple access with user pairing: NOMA or OMA?[END_REF], [START_REF] Badiu | Communication through a large reflecting surface with phase errors[END_REF]- [START_REF] Qian | Beamforming through reconfigurable intelligent surfaces in single-user MIMO systems: SNR distribution and scaling laws in the presence of channel fading and phase noise[END_REF]). The works in [START_REF]Beamforming optimization for wireless network aided by intelligent reflecting surface with discrete phase shifts[END_REF] and [START_REF] Zheng | Intelligent reflecting surface-assisted multiple access with user pairing: NOMA or OMA?[END_REF] solved optimization problems with respect to the discrete phase shifts. The works in [START_REF] Badiu | Communication through a large reflecting surface with phase errors[END_REF]- [START_REF] Qian | Beamforming through reconfigurable intelligent surfaces in single-user MIMO systems: SNR distribution and scaling laws in the presence of channel fading and phase noise[END_REF] analyzed the average signal-to-noise-ratio (SNR) and the achievable data rate. The works in [START_REF] Badiu | Communication through a large reflecting surface with phase errors[END_REF]- [START_REF] Qian | Beamforming through reconfigurable intelligent surfaces in single-user MIMO systems: SNR distribution and scaling laws in the presence of channel fading and phase noise[END_REF] demonstrated that the average SNR scales with N 2 for large values of N , where N denotes the number of reflecting elements. However, the exact relation between the diversity order and the number of phase quantization levels L for arbitrary N ≥ 2 was not revealed. Motivated by these considerations, we investigate the diversity order of RIS-assisted transmission in the presence of quantization phase errors for any N ≥ 2.

More specifically, the main contribution of this letter consists of unveiling the minimum number of required phase quantization levels to achieve the full diversity order N . To obtain this goal, the full diversity order of N is first proved to be achievable if L ≥ 3, by using mathematical induction based on an upper bound of the outage probability. Then, the achievable diversity order is proved not to exceed N +1 2 if L = 2, with the aid of a lower bound of the outage probability conditioned on the event that each phase quantization error is close to the quantization boundary. Numerical results also demonstrate that the loss of the outage performance is negligible if L ≥ 3, which provides important insights for the design of phase quantization in RIS-assisted systems.

II. SYSTEM MODEL AND PRELIMINARIES

We consider an RIS-aided transmission system, which consists of a single-antenna source (S), a single-antenna destination (D) and an RIS with N reflecting elements. The direct link between S and D is assumed to be weak and it is not considered 1 . The channel coefficients from S to the RIS and from the RIS to D are denoted by the column-vectors h SI and h ID , respectively. The nth elements of h SI and h ID are [h SI ] n ∼ CN (0, Ω S ) and [h ID ] n ∼ CN (0, Ω I ), respectively, ∀n ∈ {1, . . . , N }, where CN represents the complex Gaussian distributions and Ω S and Ω I are the variances of [h SI ] n and [h ID ] n , respectively. All channel coefficients are assumed to be mutually independent. For each transmission, the received signal at D can be written as follows

yD = √ P ηh T SI ΦhIDxS + wD, (1)
where x S is the transmitted signal from S, E(|x S |2 ) = 1, P is the transmit power, w D ∼ CN (0, δ 2 ) is the additive white Gaussian noise at D, Φ = diag(e jφ1 , e jφ2 , . . . , e jφN ), η ∈ (0, 1] is the amplitude reflection coefficient 2 and φ n ∈ [0, 2π] is the phase shift introduced by the nth reflecting element. The optimal value of φ n is φ

* n = -arg([h SI ] n [h ID ] n )
, n ∈ {1, . . . , N }. Without considering the impact of phase errors, the full diversity order of N can be achieved with this optimal setting [START_REF] Ding | On the impact of phase shifting designs on IRS-NOMA[END_REF]. However, only a finite number of quantized values can be considered in practice. Therefore, we consider a finite number of quantization levels L ≥ 2, where L is a positive integer. Accordingly, the number of quantization bits is log 2 L. The phase shift range is uniformly quantized into L levels, i.e., F 0, 2π L , . . . , (L-1)2π

L

, and the phase shift of each reflecting element is designed by mapping its optimal value to the nearest point in F , i.e., φ n = φl l , where

|φ * n -φl l | ≤ |φ * n - φlu |, φl l , φlu ∈ F . Then, the phase error Θ n = φl l -φ * n for the nth reflecting element is a uniformly distributed random variable in [-π L , π L ] [12]
. Thus, the received SNR at D can be written as follows

γD = ρη 2 N n=1 |[hSI ]n[hID]n| e jΘn 2 = ρη 2 ΩSΩI N n=1 gn 2 , (2)
where ρ P δ 2 denotes the transmit SNR and g n

|[hSI ]n[hID]n|e jΘn √ ΩS ΩI
is the normalized channel coefficient. From [START_REF] Ding | On the impact of phase shifting designs on IRS-NOMA[END_REF], the cumulative distribution function (CDF) of |g n | 2 can be expressed as

F |gn| 2 (x) = 1 -2 √ xK 1 (2 √ x) ≈ -x ln x, as x ≈ 0, (3)
where K 1 (•) denotes the modified Bessel function of the second kind.

The outage probability between S and D can be expressed as follows

P out N (ρ) = Pr log 2 1 + ρη 2 Ω S Ω I |G N | 2 < R 0 = Pr |G N | 2 < ǫ 0 ρ -1 , (4)
where G N N n=1 g n and R 0 denotes the target data rate in bits per channel use (bpcu) and ǫ 0 2 R 0 -1 η 2 ΩS ΩI . The diversity order is defined, as a function of L, as follows:

d N (L) = lim ρ→∞ -log P out N (ρ) log ρ . ( 5
)
Remark 1: Although the central limit theorem (CLT) is widely adopted to analyze the averaged SNR of RIS-assisted systems for large values of N , it is not suitable to analyze the diversity order. In particular, the CLT-based approximation has an error floor, i.e., the outage probability becomes a constant when ρ → ∞ as shown in [START_REF] Ding | On the impact of phase shifting designs on IRS-NOMA[END_REF].

Remark 2: The CDF of G N is difficult to obtain, since its real part and imaginary part are correlated. Therefore, an exact analytical expression for the outage probability P out N cannot be obtained, in general. Motivated by these considerations, in the following sections, we derive lower and upper bounds for P out N in order to study the achievable diversity order for different values of L.

III. DIVERSITY ORDER FOR L = 3

In this section, we introduce an upper bound for the outage probability in (4) and prove that the maximum diversity order N can be achieved in this case. When L = 3, we have

Θ n ∈ [-π 3 , π 3
], ∀n ∈ {1, . . . , N }. Before proceeding with the analytical derivation, we introduce two lemmas.

Lemma 1:

For ∀C 1 , C 2 ∈ C (C denotes the complex domain), arg(C 1 +C 2 ) ∈ [ϕ 1 , ϕ 2 ] holds if arg(C 1 ), arg(C 2 ) ∈ [ϕ 1 , ϕ 2 ] and -π 2 ≤ ϕ 1 ≤ ϕ 2 ≤ π 2 .
Proof 1: This lemma can be easily obtained based on geometrical relationships among gi , gj and gi +g j in a complex plane, whose details are omitted for brevity.

Lemma 2: For ∀b, c ∈ R + (R + denotes the positive real domain), and ∀n ∈ {1, . . . , N }, we have 3(a)

Pr (|g n | -a) 2 < bρ -1 ≤ρ -1 , if 0 < a < cρ -1 2 ; (b) Pr{(|g n | -a) 2 < bρ -1 } . = ρ -1 2
, if a > 0 being independent of ρ, i.e., a . = ρ 0 . where " . =" denotes exponential equality [START_REF] Zheng | Diversity and multiplexing : A fundamental tradeoff in multiple antenna channels[END_REF], i.e., f

(ρ) . = ρ d is defined as lim ρ→∞ log f (ρ) log ρ = d, and d ∈ R is the expo- nential order of f (ρ). Similarly, f (ρ) ≤ρ d ( ≥ρ d ) is defined as lim ρ→∞ log f (ρ) log ρ ≤ d (≥ d). Proof 2: See Appendix A.
In the following two subsections, we derive the outage probability for N = 2 and N ≥ 2, respectively.

A. N = 2 When N = 2, G 2 = g 1 + g 2 . Since |Θ 1 -Θ 2 | ≤ 2π 3 and G 2 decreases with |Θ 1 -Θ 2 |, |G 2 | 2 can be lower bounded |G 2 | 2 = |g 2 | 2 + |g 1 | 2 + 2|g 2 ||g 1 | cos (|Θ 2 -Θ 1 |) ≥ |g 2 | 2 + |g 1 | 2 + 2|g 2 ||g 1 | cos 2π 3 = |g 2 | - 1 2 |g 1 | 2 + 3 4 |g 1 | 2 . ( 6
)
Thus, the outage probability can be upper bounded

P out 2 (ρ) ≤ Pr |g 2 | - 1 2 |g 1 | 2 + 3 4 |g 1 | 2 < ǫ 0 ρ -1 (a) < Pr |g 2 | - 1 2 |g 1 | 2 < ǫ 0 ρ -1 , 3 4 |g 1 | 2 < ǫ 0 ρ -1 = Pr |g 1 | 2 < ω 1 ρ -1 • Pr |g 2 | - 1 2 |g 1 | 2 < ǫ 0 ρ -1 |g 1 | < √ ω 1 ρ -1 2 , (7)
where ω 1 4 3 ǫ 0 and (a) follows from max(x, y) < x + y for x, y > 0. From (3), as ρ → ∞, we obtain

Pr |g 1 | 2 < ω 1 ρ -1 ≈ -ω 1 ρ -1 ln (ω 1 ρ) . = ρ -1 . (8)
Furthermore, by setting

g n = g 2 , a = 1 2 |g 1 |, b = ǫ 0 and c = 1 2 √ ω 1 in Lemma 2-(a), we have Pr |g 2 |- 1 2 |g 1 | 2 < ǫ 0 ρ -1 |g 1 | < √ ω 1 ρ -1 2 ≤ρ -1 . (9)
Substituting ( 8) and ( 9) into [START_REF]Beamforming optimization for wireless network aided by intelligent reflecting surface with discrete phase shifts[END_REF], we obtain P out 2 (ρ) ≤ρ -2 . Therefore, we evince that d 2 (3) ≥ 2. Since the maximum diversity order is 2 when N = 2, we conclude that d 2 (3) = 2.

B. N ≥ 2

The result for N = 2 can be generalized to the case N ≥ 2, as stated in the following proposition.

Proposition 1: For ∀λ ∈ R + and ∀N ≥ 2, we have

Pr |G N | 2 < λρ -1 ≤ρ -N . ( 10
)
Proof 3: This proposition can be proved using mathematical induction. We consider the following induction steps.

1) N = 2: This case is considered in Section III-A, and (10) holds by replacing ǫ 0 with λ.

2)

N = k -1: When N = k -1, k ≥ 3,
we assume that (10) holds true, i.e.,

Pr |G k-1 | 2 < λρ -1 ≤ρ -(k-1) , ∀λ ∈ R + , (11)
where

G k-1 = k-1 n=1
g n . This is the induction hypothesis in our problem formulation.

3) N = k: Based on the induction hypothesis corresponding to N = k -1, we proceed as follows. Based on Lemma 1, we have arg(G k-1 ) ∈ -π 3 , π 3 , and hence

|G k | 2 = |g k + G k-1 | 2 can be bounded as follows |G k | 2 ≥ |g k | - 1 2 |G k-1 | 2 + 3 4 |G k-1 | 2 , (12)
with the aid of steps similar to [START_REF] Wu | Intelligent reflecting surface enhanced wireless network via joint active and passive beamforming[END_REF]. In addition, similar to [START_REF]Beamforming optimization for wireless network aided by intelligent reflecting surface with discrete phase shifts[END_REF], for ∀λ ∈ R + , we can obtain

Pr |G k | 2 < λρ -1 ≤ Pr |G k-1 | 2 < 4 3 λρ -1 • Pr |g k |- 1 2 |G k-1 | 2 < λρ -1 |G k-1 | < 4 3 λ 1 2 ρ -1 2 . (13)
Finally, by applying Lemma 2-(a) and ( 11) to [START_REF] Zhang | Reconfigurable intelligent surfaces assisted communications with limited phase shifts: How many phase shifts are enough?[END_REF], we obtain Pr |G k | 2 < λρ -1 ≤ρ -k for ∀λ ∈ R + . This completes the proof.

Based on Proposition 1, P out N (ρ) ≤ρ -N , i.e., d N (3) ≥ N holds for ∀N ≥ 2. Since the achievable diversity order cannot exceed N , we have the following theorem.

Theorem 1: If the number of quantization levels is L ≥ 3, the full diversity order of N can be achieved, i.e., d

N (L) = N , ∀L ≥ 3, N ≥ 2.
Now, one may wonder whether L = 3 is the minimum required number of phase quantization levels for achieving the full diversity order. To answer this question, we analyze the setup for L = 2 in the next section.

IV. DIVERSITY ORDER FOR L = 2

This section aims to prove that the full diversity of N cannot be achieved if only two quantization levels are used. If L = 2, in particular, we have F = {0, π} and

Θ n ∈ [-π 2 , π 2
], ∀n ∈ {1, . . . , N }. To prove this result, we first compute a lower bound for the outage probability, and prove that the corresponding exponential order is -N+1

2 . Based on this result, we conclude that the diversity order cannot exceed N+1 2 .

A. N = 2

As mentioned, we need to identify a lower bound for the outage probability. For fixed |g 1 | and |g 2 |, |G 2 | attains its minimum value if |Θ 1 -Θ 2 | = π. Therefore, we are interested in computing the outage probability conditioned on the event that |Θ 1 -Θ 2 | is close to π. This is provided in the following proposition.

Proposition 2: At high SNR, define the event ε 1 as follows

ε 1 Θ i ∈ - π 2 , - π 2 + θ , Θ j ∈ π 2 -θ, π 2 , (i, j) = (1, 2) or (2, 1) , (14)
where θ ρ -1 2 . Conditioned on the event ε 1 , we have

Pr |G 2 | 2 < ǫ 0 ρ -1 |ε 1 ≥ρ -1 2 . ( 15
)
Proof 4: Without loss of generality for the event ε 1 , we assume

Θ 1 ∈ -π 2 , -π 2 + θ , Θ 2 ∈ π 2 -θ, π 2 . Hence π -2θ ≤ Θ 2 -Θ 1 ≤ π and |G 2 | 2 can be upper bounded as follows |G 2 | 2 = |g 1 | 2 + |g 2 | 2 + 2|g 1 ||g 2 | cos (Θ 2 -Θ 1 ) ≤ |g 1 | 2 + |g 2 | 2 -2 cos(2θ)|g 1 ||g 2 | = (|g 1 | -cos(2θ)|g 2 |) 2 + sin 2 (2θ)|g 2 | 2 < (|g 1 | -cos(2θ)|g 2 |) 2 + 4ρ -1 |g 2 | 2 Λ |g 1 | 2 , |g 2 | 2 , (16)
where the last step is based on the definition θ = ρ -1 2 and the fact that sin(θ) < θ. Furthermore, we have

Pr |G 2 | 2 < ǫ 0 ρ -1 |ε 1 > Pr Λ |g 1 | 2 , |g 2 | 2 < ǫ 0 ρ -1 (a) > Pr Λ |g 1 | 2 , |g 2 | 2 < ǫ 0 ρ -1 , ω 2 ≤ |g 2 | 2 ≤ 2ω 2 = Pr ω 2 ≤ |g 2 | 2 ≤ 2ω 2 • Pr Λ |g 1 | 2 , |g 2 | 2 < ǫ 0 ρ -1 √ ω 2 ≤ |g 2 | ≤ √ 2ω 2 (b) > F |g2| 2 (2ω 2 ) -F |g2| 2 (ω 2 ) • Pr |g 1 | -cos(2θ)|g 2 |) 2 < ǫ 0 ρ -1 2 √ ω 2 ≤ |g 2 | ≤ √ 2ω 2 . = ρ -1 2 , ( 17
)
where ω 2 ǫ0 16 ; (a) holds since Pr{A} > Pr{A, B} for all events A and B satisfying B A, and is used to limit the range of Remark 3: The motivation for setting θ = ρ -1 2 is to make sure that the term 4θ

|g 2 | to [ √ ω 2 , √ 2ω 2 ] so that |g 2 | . = ρ 0 holds for ∀|g 2 | ∈ [ √ ω 2 , √ 2ω
2 |g 2 | 2 in (16) satisfies 4θ 2 |g 2 | 2 < ǫ 0 ρ -1 even if |g 2 | 2 . = ρ 0 . In this case, |g 2 | 2 can take any values in the range [ω 2 , 2ω 2 ], so that |g 2 | 2 .
= ρ 0 is satisfied and the conditional outage probability Pr |G 2 | 2 < ǫ 0 ρ -1 |ε 1 can be exponentially lower bounded by ρ -1 2 as stated in [START_REF] Gradshteyn | Table of Integrals, Series and Products[END_REF] .

Moreover, the probability of the event ε 1 can be computed as

Pr{ε 1 } = 2 θ π 2 . = ρ -1 , since Pr Θ i ∈ - π 2 , - π 2 +θ = Pr Θ i ∈ π 2 , π 2 -θ = θ π , (18)
where i = 1, 2. Therefore, based on Proposition 2, the outage probability can be exponentially lower bounded as follows

P out 2 (ρ) ≥ Pr{ε 1 } • Pr |G 2 | 2 < ǫ 0 ρ -1 |ε 1 ≥ρ -3 2 . ( 19
)
Thus, d N (2) ≤ 3 2 , which is smaller than the theoretical full diversity order of N = 2.

B. N ≥ 2

Proposition 2 can be generalized to the case N ≥ 2, as shown in the following corollary.

Corollary 1: At high SNR, define the event ε 2 as follows

ε 2 Θ i ∈ - π 2 , - π 2 + θ , {Θ j } j∈{1,...,N },j =i ∈ π 2 -θ, π 2 , ∀i ∈ {1, . . . , N } . (20) Conditioned on the event ε 2 , we have Pr |G N | 2 < ǫ 0 ρ -1 |ε 2 ≥ρ -1 2 . Proof 5: For the event ε 2 , assume Θ 1 ∈ -π 2 , -π 2 + θ and {Θ j } j∈{2,...,N } ∈ π 2 -θ, π 2
without loss of generality. Moreover, define GN-1 N j=2 g j , and hence

G N = g 1 + GN-1 . According to Lemma 1, we obtain arg( GN-1 ) ∈ π 2 - θ, π
2 . Therefore, by using a similar analytical derivation as for Proposition 2, the corollary can be proved by replacing g 2 with GN-1 in ( 16) and [START_REF] Gradshteyn | Table of Integrals, Series and Products[END_REF].

In addition, from (18), the probability of the event ε 2 is

Pr{ε 2 } = N θ π N . = ρ -N 2 .
Therefore, we obtain

P out N (ρ) ≥ Pr{ε 2 } • Pr |G N | 2 < ǫ 0 ρ -1 |ε 2 ≥ρ -N +1 2 . ( 21
)
From (21), the upper bound of the diversity order for L = 2 can be summarized in the following theorem.

Theorem 2: If the number of quantization levels is L = 2, the diversity order is upper bounded by

d N (2) ≤ N +1 2 , ∀N ≥ 2.
Remark 4: Combing Theorem 1 and Theorem 2, the minimum required number of phase quantization levels to achieve the full diversity order of N is equal to L = 3.

V. IMPACT OF DIRECT LINK

If the direct link between S and D cannot be ignored, Theorem 1 and Theorem 2 can be modified as follows.

Let h SD denote the channel of the direct link. The optimal value of φ n in Section II is φ

* n = arg(h SD ) - arg([h SI ] n [h ID ] n ), n ∈ {1, . . . , N }. Moreover, the SNR is γ D = ρ |h SD | + η √ Ω S Ω I G N 2 . Based on Lemma 1, | arg(G N )| cannot exceed π 2 even if L = 2, so γ D ≥ ρ(|h SD | 2 + η 2 Ω S Ω I |G N | 2 )

VI. NUMERICAL RESULTS

In this section, Monte Carlo simulations are provided to verify the accuracy of the analytical results about the diversity order. The direct link between S and D does not exist, and we set [h SI ] n ∼ CN (0, 1) and [h ID ] n ∼ CN (0, 0.5), ∀n ∈ {1, . . . , N }, i.e., Ω S = 1 and Ω I = 0.5. We also set η = 0.8.

The effect of phase quantization on the diversity order of RIS-aided transmission is illustrated in Fig. 1. For ease of interpretation, we reports the lines with slopes N +1 2 and N as well. When L = 2, for N = 2, N = 4 and N = 8, we can observe that the slope of the outage probability curves is not smaller than -1.5, -2.5 and -4.5 (i.e., the diversity order does not exceed 1.5, 2.5 and 4.5) at high SNRs, respectively. This observation is consistent with Theorem 2. The main reason is that the phase error is uniformly distributed over [-π 2 , π 2 ], and there exists a probability that each phase error is close to the boundary of -π 2 or π 2 . In this case, the amplitudes of the channel coefficients mutually cancel out, which results in a loss of the diversity order. When L ≥ 3, on the other hand, we observe that the corresponding curves are parallel to the curves obtained in the absence of phase errors. We conclude that the full diversity order can be achieved as long as L ≥ 3, which is consistent with Theorem 1.

In Fig. 2, the outage probability as a function of the phase quantization level L is shown. We note that the outage performance is a decreasing function of L. As L increases, the outage probability approaches the lower bound with perfect phase shifts. For both setups N = 2 and N = 5, the outage probability has the largest values if L = 2. When N = 2, the outage probability approaches the lower bound with perfect phase shifts provided that L ≥ 3. When N = 5, the gap between the curve with phase errors and the curve with perfect phase shifts is larger. However, the gap reduces as L increases. Therefore, the quantization errors for phase shifts of the RIS do not lead to significant outage performance loss, which is a promising finding for the deployment of RISs in wireless systems.

VII. CONCLUSION This letter investigated the diversity order of RIS-aided communication systems with discrete phase shifts. The main contribution of this letter was to unveil the minimum number of phase quantization levels to achieve full diversity. In particular, the full diversity order is proved to be achievable, if and only if at least three quantization levels are used. Simulation results verified the theoretical finding and showed that the outage performance loss is negligible even for moderate values of the quantization levels.

APPENDIX A PROOF OF LEMMA 2 We consider different values of a as follows. 1) For 0 < a < cρ -

≤ Pr |g n | 2 < √ bρ -1 2 + cρ -1 2 2 = 1 -2 √ b + c ρ -1 2 K 1 2 √ b + c ρ -1 2 ≈ - √ b + c 2 ρ -1 ln √ b + c 2 ρ -1 , (23)
as ρ → ∞, where the last step is based on (3). Thus, Pr{(|g n |a) 2 < bρ -1 } ≤ρ -1 .

2) For a > 0 and a . = ρ 0 : Based on (22), we have

Pr{(|g n | -a) 2 < bρ -1 } = Pr - √ bρ -1 2 + a 2 < |g n | 2 < √ bρ -1 2 + a 2 = K1 (2a -z) -K1 (2a + z) , (24)
where K1 (x) xK 1 (x), z 2 √ bρ -1 2 and 2a ≫ z holds as ρ → ∞. From [17, Eq. 8.446], the function K1 (x) has the following series representation:

K1 (x) = 1 - ∞ k=0 x 2 2k+2 A(k) -ln x 2 k!(k + 1)! , (25)
where A(k) 1 2 ψ(k + 1) + 1 2 ψ(k + 2), and the function ψ(•) is defined in [START_REF] Gradshteyn | Table of Integrals, Series and Products[END_REF]Eq. 8.365.3]. Therefore, by using the Taylor expansion at the point 2a, we have

K1 (2a -z) = K1 (2a) -K′ 1 (2a)z + o(z), (26)
where o(•) denotes higher order terms and K′ 1 (2a) can be expressed as follows

Inserting ( 26) and ( 28) into (24), we have

Pr{(|g n | -a) 2 < bρ -1 } ≈ -4 √ bρ -1 2 K′ 1 (2a) . = ρ -1 2 . (29)

2 ] 2 if |g 2 | < √ 2ω 2 ;

 222 and Lemma 2-(b) can be applied in the last step; (b) is due to the fact that 4ρ -1 |g 2 | 2 < ǫ0ρ -1 and the last step is based on Lemma 2-(b) (setting a = cos(2θ)|g 2 | and b = ǫ 0 /2).

Fig. 1 .

 1 Fig. 1. The outage probability versus the SNR, for different values of L and N , where R0 = 1 bpcu.

Fig. 2 .

 2 Fig. 2. The outage probability versus L, for different values of the transmit SNR and N , where R0 = 2 bpcu.

1 2 :

 2 We havePr{(|g n |a) 2 < bρ -1 } = Pr -√ bρ -1 2 + a < |g n | < √ bρ -1 2 + a(22)

K′ 1 ( 2 k

 12 2a) = -∞ k=0 a 2k+1 (k + 1)(A(k)ln a) + 1 !(k + 1)! .(27)Similarly, K1 (2a + z) can be expressed asK1 (2a + z) = K1 (2a) + K′ 1 (2a)z + o(z).

  for ∀L ≥ 2. Based on this lower bound on γ D , Theorem 1 still holds by replacing the diversity order N with N + 1.Furthermore, γ D can be upper bounded asγ D ≤ ρ(|h SD | + η √ Ω S Ω I |G N |) 2 .Therefore, Theorem 2 holds by replacing the upper bound N +1

	2	with N +3 2 . The details are omitted due to
	space limitations.

We consider the direct link between S and D in Section V.

For simplicity, this letter assumes that all elements have the same amplitude reflection coefficient.

Throughout this letter, each parameter is acquiescently not a function of ρ, i.e., its value does not change with ρ, unless otherwise stated.


Ali Reza Heidarpour

Masoud Ardakani
email: ardakani@ualberta.ca

Fellow, IEEE Chintha Tellambura

Fellow, IEEE Marco Di Renzo
email: marco.direnzo@centralesupelec.fr

Fellow, IEEE Murat Uysal
email: mu-rat.uysal@ozyegin.edu.tr

Student Member, IEEE Ali Reza Heidarpour
email: alirezaheidarpour@ualberta.ca

Network-Coded Cooperative Systems With Generalized User-Relay Selection

Keywords: Generalized user-relay selection (GURS), networkcoded cooperative, outage analysis, diversity order

come

I. INTRODUCTION

T HE next generation of wireless communication systems are expected to offer high data rate, ultra-reliable low latency, and improved energy efficiency. Fifth generation (5G) wireless technologies are under development. 5G can handle billions of heterogeneous devices while providing very high data rates at very low latency. International telecommunication union (ITU) has specified a roadmap for 5G in term of 'IMT-2020'. IMT-2020 vision aims to deliver up to 10-Gbps peak data rates, 1 ms over-the-air latency, and 100× energy efficiency improvement [START_REF] Series | IMT vision-framework and overall objectives of the future development of IMT for 2020 and beyond[END_REF].

Cooperative communication, also called cooperative diversity (CD), is a promising candidate to fulfill the requirements for wireless technology 2020 and beyond. CD exploits spatial diversity by forming a virtual antenna array through the spatially distributed relay nodes [START_REF] Laneman | Cooperative diversity in wireless networks: Efficient protocols and outage behavior[END_REF]. Cooperative relay networks have been thus adopted by several wireless system standards [START_REF] Li | Cooperative communications for wireless networks: techniques and applications in LTE-advanced systems[END_REF] and are also considered as a key enabler technology for future wireless communications [START_REF] Boccardi | Five disruptive technology directions for 5G[END_REF].

The traditional repetition-based CD protocols, however, entail the loss of system throughput since each relay transmits sources' packets to the destination over orthogonal channels. This spectral inefficiency is prohibitive, especially in cooperative networks with a large number of sources.

Network-coded cooperation (NCC), a new class of CD protocols, is a solution to this inefficiency in CD systems [START_REF] Bas ¸aran | A tutorial on network coded cooperation[END_REF]. Thus, NCC avoids separately re-transmitting each source packet; instead, each relay employs network coding (NC) [START_REF] Ahlswede | Network information flow[END_REF] to combine packets received from multiple sources; generates a new network-coded packet; and then transmits it to the destination. This process decreases the number of channel uses required by the relays and thus increases the system throughput.

A. Related Literature

The design and analysis of NCC, in general, build upon two error propagation models: i) the erasure channel model; and ii) error channel model. In the former, the erroneous sources' packets are discarded at the relays and thus no error propagation occurs 1 . In the latter, however, the erroneous packets are allowed to propagate through the network, but error propagation is counteracted at the destination with the aid of appropriate "error-aware" demodulators. In what follows, we will provide a summary of research works under these two channel models.

The performance analysis of NCC under the erasure channel model has been studied in [START_REF] Xiao | Design of network codes for multiple-user multiple-relay wireless networks[END_REF]- [START_REF] Heidarpour | Network-coded cooperation with outdated CSI[END_REF]. In particular, the network code design for generic multisource multirelay networks with a single destination was studied in [START_REF] Xiao | Design of network codes for multiple-user multiple-relay wireless networks[END_REF]. It is shown that binary NC is not diversity optimal, while a non-binary qary Galois field NC based on maximum distance separable (MDS) codes provides the full diversity order irrespective of the number of sources and relays. The outage probability (OP) and diversity-multiplexing tradeoff (DMT) of NCC have been also studied in [START_REF] Topakkaya | Wireless network code design and performance analysis using diversity-multiplexing tradeoff[END_REF]- [START_REF] Pereira | Generalized network-coded cooperation in OFDMA communications[END_REF], demonstrating that NCC provides a better DMT compared to the traditional CD protocols. The effect of outdated channel state information (CSI) on the performance of relay selection (RS) based NCC has been further investigated in [START_REF] Heidarpour | Network-coded cooperation with outdated CSI[END_REF].

Several other seminal works have also studied the performance of NCC under error channel model. For instance, [START_REF] Renzo | On diversity order and coding gain of multisource multirelay cooperative wireless networks with binary network coding[END_REF], [START_REF]Error performance and diversity analysis of multi-source multirelay wireless networks with binary network coding and cooperative MRC[END_REF] investigated the performance of NCC with binary modulation and binary NC. In particular, the average bit error probability (ABEP) was computed for two types of demodulaters; a hard decision based demodulator [START_REF] Renzo | On diversity order and coding gain of multisource multirelay cooperative wireless networks with binary network coding[END_REF] and a NCC maximal ratio combining (MRC) demodulator [START_REF]Error performance and diversity analysis of multi-source multirelay wireless networks with binary network coding and cooperative MRC[END_REF]. Furthermore, guidelines for network code design were developed and the impact of error propagation on the diversity order and coding gain was quantified. Later, the performance of repetition-based and RS-based NCC protocols were investigated in [START_REF] Renzo | On the achievable diversity of repetition-based and relay selection network-coded cooperation[END_REF], assuming NCC-MRC demodulator and arbitrary modulation order and arbitrary Galois field size. Following [START_REF] Renzo | On the achievable diversity of repetition-based and relay selection network-coded cooperation[END_REF], the exact and asymptotic expressions of the OP for single RS and multiple RS protocols were further derived in [START_REF] Vu | On the diversity of networkcoded cooperation with decode-and-forward relay selection[END_REF]. The diversity analysis in [START_REF] Renzo | On the achievable diversity of repetition-based and relay selection network-coded cooperation[END_REF], [START_REF] Vu | On the diversity of networkcoded cooperation with decode-and-forward relay selection[END_REF] reveals that RS-based NCC achieves full diversity order under a restrictive condition where the number of selected relays must be at least equal to the number of sources. It is further shown that the design of full diversity-achieving network codes is identical to that of linear block codes based on MDS codes [START_REF] Renzo | On the achievable diversity of repetition-based and relay selection network-coded cooperation[END_REF]. Finally, in [START_REF] Heidarpour | Relay selection in network-coded cooperative MIMO systems[END_REF], the authors extended the results in [START_REF] Renzo | On the achievable diversity of repetition-based and relay selection network-coded cooperation[END_REF], [START_REF] Vu | On the diversity of networkcoded cooperation with decode-and-forward relay selection[END_REF] by studying the performance of RS in multiple-input multiple-output (MIMO) NCC systems.

B. Motivation and Contributions

Multiuser diversity (MUD) is inherent in a network of spatially separated users and thus provides a form of diversity against fading. The basic premise of MUD is to exploit channel variations among those users by allocating resources to the best users experiencing good channel qualities. The application of MUD to conventional CD has been studied [START_REF] Ding | A new efficient lowcomplexity scheme for multi-source multi-relay cooperative networks[END_REF]- [START_REF] Chen | Performance analysis of multiuser diversity in cooperative multi-relay networks under Rayleigh-fading channels[END_REF], demonstrating that MUD-based CD with RS exploits both MUD and CD gains and thus offers substantial performance improvement.

The application of MUD to NCC has tremendous potential to further improve the the performance of NCC systems. However, so far the performance analysis of such a system has been only investigated in [START_REF] Heidarpour | Multiuser diversity in network-coded cooperation: Outage and diversity analysis[END_REF]. In particular, [START_REF] Heidarpour | Multiuser diversity in network-coded cooperation: Outage and diversity analysis[END_REF] is the first paper that studies the performance of MUD-based NCC under the erasure channel model2 . One of the main contributions of this work is to add to this literature and study the performance of MUD-based NCC, assuming the error channel model. Therefore, our analytical expressions are new and different from those presented in [START_REF] Heidarpour | Multiuser diversity in network-coded cooperation: Outage and diversity analysis[END_REF].

Effective resource allocation strategies are key design considerations in 5G and future cellular networks. From a spectral efficiency perspective, the best solution is to allocate a resource block to the best user experiencing the highest SNR, which maximizes the cell throughput. Scheduling based on max-SNR, however, does not account other important factors such as fairness, cell-edge coverage, and energy efficiency. This necessitates a flexible resource allocation mechanism that provides a good trade-off among different performance objectives (e.g. throughput, delay, or energy). On the other hand, traffic load disparity, inherited from scheduling schemes based on the max-SNR criterion, inevitably leads to suboptimal resource allocations across the network, particularly in Long Term Evolution-Advanced (LTE-Advanced) heterogeneous networks (HetNets) with diverse quality of service (QoS) requirements. Under these circumstances, user/relay selection may be based on factors other than SNR. Furthermore, there are several practical scenarios that selecting the best-SNR users/relays might be inefficient or even infeasible. For instance, the scheduler may fail to select the best users/relays in the presence of imperfect CSI; the best-SNR users may not have any data packet to transmit; and the best-SNR users/relays might run out of the battery at the time of transmission. These observations suggest that the ability to select an arbitrary set of users and/or relays is beneficial. Thus, the performance of generalized user selection [START_REF] Fan | Outage probability analysis and power allocation for two-way relay networks with user selection and outdated channel state information[END_REF]- [START_REF] Salhab | Multiuser cognitive networks with N th-best user selection and imperfect channel estimation[END_REF] and generalized RS [START_REF] Ikki | On the performance of cooperativediversity networks with the N th best-relay selection scheme[END_REF]- [START_REF] Chu | SER and PER performance of packet decode-and-forward relaying with generalized order selection combining[END_REF] have been separately and extensively studied recently. However, the performance analysis of generalized user-relay selection (GURS) has not been investigated in the literature. The objective of this paper is to remedy this gap. We propose the most GURS scheme that selects any arbitrary subsets of users and any arbitrary subsets of relays subject to any practical constraints. Our analysis evaluates the performance loss incurred when suboptimal user-relay selection is performed and thus provides the basis for better scheduling and efficient resource management algorithms in 5G and future cellular networks.

In particular, we consider a dual-hop multiuser multirelay cooperative network that consists of N ≥ 2 sources, M ≥ 1 relays, and a single destination. The relays use decode-andforward (DF) relaying and apply NC on received sources' symbols, that are either correctly or incorrectly demodulated, using the weighting coefficients forming an MDS code. The proposed user-relay selection mechanism selects any arbitrary subsets of K (out of N ) users and any arbitrary subsets of L (out of M ) relays subject to any practical constraints such as load balancing conditions, scheduling policy, and other factors.

The main contributions of the present paper are summarized as follows:

• New closed-form OP expression is derived, assuming non-identically and independently distributed (n.i.i.d.)

Rayleigh fading over all the wireless links3 . • We derive a concise high signal-to-noise ratio (SNR) OP expression, based on which, the achievable diversity order and coding gain are quantified; two system-design parameters that govern the OP in the high-SNR regime. • We show that our performance analysis and design guidelines are applicable to a large set of situations and generalize and subsume all existing results in the literature as special cases. • We further confirm our theoretical findings through extensive Monte-Carlo simulations.

C. Organization and Notations

The rest of this paper is organized as follows: Section II describes the system and channel models. Section III presents the detailed analysis of outage performance of GURS NCC. Asymptotic analysis is provided in Section IV. Numerical results are presented in Section V. Finally, we conclude in Section VI.

Notations: Throughout this paper, the following notations are used: Pr{A} and n k = n!

(n-k)!k! denote the probability of an event A and the binomial coefficient, respectively. F q denotes Galois field with size q. Addition and multiplication in F q are denoted by ⊕ and ⊗, respectively.

II. SYSTEM MODEL AND TRANSMISSION SCHEME

In this section, we first explain the system and channel models and thereafter describe the signal model and transmission protocol in detail. . The direct links between sources and the destination are available, and the relays assist the sources to deliver the information packets to the destination. Each node is equipped with a single antenna, transmits with power ρ, and operates in the half-duplex fashion. The transmissions occur in different orthogonal time-slots and the cooperation takes place in two phases, namely i) the broadcasting phase; and ii) the relaying phase. Fig. 1 depicts the timing diagram for GURS NCC system. In the broadcasting phase, the i th 1 , i th 2 , ..., i th K best sources {S (i k ) } K k=1 (amongst N sources) are selected to transmit their messages to the destination in a round-robin fashion. The source selection might include a set of K highest-SNR sources or any other possible selection. This phase lasts K time-slots. Thanks to the broadcast nature of the wireless medium, the M relays also overhear the transmissions. In the relaying phase, any arbitrary subset of relays of size L (out of M available relays), the j th 1 , j th 2 , ..., j th L best relays {R (j l ) } L l=1 , can be selected. More specifically, the selected L relays employ NC to linearly combine K received packets and then are assigned orthogonal channels to sequentially forward the resulting network-coded packets to the destination. This phase thus takes place in L time-slots.

A. System and Channel Models

The network subchannels are subjected to independent slow and frequency non-selective Rayleigh fading. We consider independent but non-identically distributed (i.e., asymmetric) Rayleigh fading channels. In particular, the channel coefficient of link i → j is denoted by h ij and follows h ij ∼ CN (0, σ 2 ij ); a circularly-symmetric complex Gaussian random variable (RV) whose mean is zero and whose variance is equal to σ 2 ij . Furthermore, the additive white Gaussian noise (AWGN) term of link i → j is denoted by w ij and has mean zero and unit variance i.e., w ij ∼ CN (0, 1). We remark that although the transmit power and the noise variance are set to be symmetric throughout the network, asymmetry cases can be lumped into the fading variances.

In GURS NCC, N K M L different source-relay selections are possible. It is customary to assume a centralized selection method where the source-relay selection process is performed by a central unit (this could also be the destination). This entity requires instantaneous CSI of the source-to-destination links for source selection, while it requires the CSI of source-torelay and relay-to-destination links for RS process 4 . The CSI of the indirect source-to-relay links are estimated by the relays using pilot sequences sent by selected K sources and then are forwarded to the destination. The selection depends on load balancing conditions, scheduling policy, and other factors.

B. Signal Model and Transmission Scheme

1) Broadcasting Phase: In this phase, the destination selects sources {S (i k ) } K k=1 for data transmission. The source selection criterion is based on the instantaneous SNR of the direct source-to-destination links. We define γ (n) as the n th largest SNR of the source-to-destination SNRs. Specifically, γ (n) can be written as

γ (n) = n th max 1≤n≤N {γ SnD } . (1)
Let {γ (i k ) } K k=1 denote the ordered SNRs of any arbitrary subset of {γ (n) } N n=1 and I = {i k } K k=1 being the set of indexes of the elements in {γ (i k ) } K k=1 where i 1 < i 2 < ... < i K . For the special case when the source selection includes the K highest-SNR sources, we have I = {1, 2, ..., K}.

Denoting S (k) ∈ F q as the symbol transmitted by the selected source S (k) , k ∈ I, the received signal at relay R m (∀m) and D can be expressed as

y S (k) D = √ ρh S (k) D x S (k) + w S (k) D , (2)
y S (k) Rm = √ ρh S (k) Rm x S (k) + w S (k) Rm , (3)
where x S (k) is the modulated version of S (k) .

2) Relaying Phase: This phase is based on the RS policy, which minimizes the possible error of network-coded symbols [START_REF] Renzo | On the achievable diversity of repetition-based and relay selection network-coded cooperation[END_REF]. Under this selection strategy, the equivalent channel for relay R m is determined by the worst channel in the two-hop source-relay-destination links. Let A denote the set of indexes of the selected sources. The cardinality of A is K and the number of all possible A's is N K . The "equivalent SNR" of the channels between K selected sources, relay R m , and the destination can then be expressed as

γ min m|A = min γ S (i 1 ) Rm , γ S (i 2 ) Rm , ..., γ S (i K ) Rm , γ RmD .
(4) Define g (m) as the m th largest equivalent SNRs of relays. Mathematically, this can be expressed as

g (m) = m th max 1≤m≤M {γ min m|A }. (5)
In the relaying phase, relays {R (j l ) } L l=1 take part in cooperation. Let {g (j l ) } L l=1 denote the ordered SNRs of any arbitrary subset of {g (m) } M m=1 , where j 1 < j 2 < ... < j L . As an example, assume that the number of relays M = 10 and J = {j l } L l=1 = {1, 3, 7, 9}. This implies that four relays out of ten relays are selected whose SNRs are the first, third, seventh, and ninth largest SNRs in {g (m) } M m=1 . The selected relays R (l) , l ∈ J , first decode the data received from the K selected sources using the maximum likelihood (ML) detector as follows

ˆ S (k) R (l) = arg min S (k) ∈Fq y S (k) R (l) - √ ρh S (k) R (l) x S (k) 2 , (6)
and then sequentially transmit their network-coded symbols to the destination. The NC operation is applied to all correct or incorrect received symbols [START_REF] Renzo | On the achievable diversity of repetition-based and relay selection network-coded cooperation[END_REF]. In particular, relay R (l) linearly combines estimated symbols in F q using the weighting coefficients α S (k) R (l) forming an MDS code. MDS codes always exist if the field size is sufficiently large and are proven to be maximal-diversity-achievable in the uplink multiple-source, multiple-relay cooperative systems. Such network codes satisfy the Singleton bound and minimize the total number of packets required at the destination to decode the sources' packets. The network-coded symbol generated by relay R (l) can then be written as

ˆ R (l) = k∈I α S (k) R (l) ˆ S (k) R (l) . (7)
Modulating ˆ R (l) to xR (l) , the received signal from relay R (l) , l ∈ J , at D can be expressed as

y R (l) D = √ ρh R (l) D xR (l) + w R (l) D . (8)
Fig. 2 shows an example of GURS NCC scheme when

N = 5, K = 3, M = 3, L = 2, γ S5D > γ S2D > γ S1D > γ S3D > γ S4D , I = {1, 4, 5}, γ min 2|{3,5,4} > γ min 3|{3,5,4} > γ min 1|{3,5,4}
, and J = {1, 3}.

III. OUTAGE PROBABILITY

In this section, we derive closed-form expression for the OP of GURS NCC system, assuming n.i.i.d. Rayleigh fading channels over all wireless channels.

The following lemma is of important when it provides the closed-form expression of the OP. Lemma 1. Let X 1 , X 2 , ..., X n be n independent and nonidentical RVs with probability density function (PDF) f Xi (x i ) = λ i e -λixi . Then,

Pr{X 1 > X 2 > ... > X n } = n v=2 λ v λ 1 + v i=2 λ i . (9) Fig. 2. System model for GURS NCC scheme. Example with N = 5, K = 3, M = 3, L = 2, γ S 5 D > γ S 2 D > γ S 1 D > γ S 3 D > γ S 4 D , I = {1, 4, 5}, γ min 2|{3,5,4} > γ min 3|{3,5,4} > γ min 1|{3,5,4}
, and J = {1, 3}.

Proof. The proof is by induction.

• Base Case: The probability in ( 9) can be written in the integral form as

Pr{X 1 > X 2 > ... > X n } = ∞ 0 x1 0 x2 0 ... xn-1 0 n n i=1 [f Xi (x i )] dx n dx n-1 ...dx 1 . (10)
We begin by verifying equation [START_REF] Heidarpour | Finite-SNR diversitymultiplexing tradeoff for network coded cooperative OFDMA systems[END_REF] for n = 2. For n = 2, (10) can be obtaied as

Pr{X 1 > X 2 } = ∞ 0 x1 0 λ 1 e -λ1x1 λ 2 e -λ2x2 dx 2 dx 1 = ∞ 0 λ 1 e -λ1x1 1 -e -λ2x1 dx 1 = λ 2 λ 1 + λ 2 , (11)
which verifies that ( 9) is true for n = 2. • Induction Hypothesis: Assume that (9) holds when n = k i.e.,

Pr{X 1 > X 2 > ... > X k } = k v=2 λ v λ 1 + v i=2 λ i . ( 12
)
• Inductive Step: Now, we need to prove that (9) holds when n = k + 1 using the assumption in [START_REF] Renzo | On diversity order and coding gain of multisource multirelay cooperative wireless networks with binary network coding[END_REF]:

Pr{X 1 > X 2 > ... > X k+1 } = Pr{X 1 > X 2 > ... > X k } Pr{X k+1 < X 1 , X 2 , ..., X k } B . ( 13
)
The probability B in ( 13) can be derived as follows

B = ∞ 0 ∞ x k+1 ∞ x k+1 ... ∞ x k+1 k+1 k+1 i=1 [f Xi (x i )] dx 1 ...dx k+1 =λ k+1 ∞ 0 e -(λ1+λ2+....+λ k+1 )x k+1 dx k+1 = λ k+1 λ 1 + λ 2 + .... + λ k+1 . (14)
Substituting ( 14) into (13), we have

Pr{X 1 > X 2 > ... > X k+1 } = k v=2 λ v λ 1 + v i=2 λ i λ k+1 λ 1 + λ 2 + .... + λ k+1 = k+1 v=2 λ v λ 1 + v i=2 λ i . ( 15
)
Thus, (9) holds for n = k + 1, and the proof of the induction step is complete. By the principle of induction, ( 9) is true for all n ≥ 2 which concludes the proof 5 .

Special Case 1. For the special case of i.i.d. RVs i.e., λ i = λ, ∀i, (9) is simplified to

Pr{X 1 > X 2 > ... > X n } = 1 n! . ( 16
)
Theorem 1. Consider a cooperative network that consists of N users, M relays, and one destination. Assume the relays use DF protocol and apply NC on the received users' symbols. If the destination selects the i th 1 , i th 2 , ..., i th K best users and the j th 1 , j th 2 ,..., j th L best relays, the OP of the system when K > L can be formulated as

P out1 = K-L-1 η=0 Pr{E η } + L η=1 Pr{E K-η } η-1 =0 Pr{V } . (17)
On the other hand, the OP when K ≤ L is given by

P out2 = K η=1 Pr{E K-η } η-1 =0 Pr{V } , (18)
where Pr{E η } and Pr{V } are, respectively, given by ( 19) and ( 20), as shown on the top of the next page, in which

Pr {O SnD } = 1 -e -λ Sn D γ th , (21)
with 5 We note that the result in Lemma 1 can be directly obtained using nfold integrals given by [START_REF] Pereira | Generalized network-coded cooperation in OFDMA communications[END_REF]. The direct proof of the obtained result, however, requires lengthy mathematical manipulations that do not bring much insight. In the interest of space, we chose to provide the shorter proof based on induction. In doing so, we first derived the results for small values of n using [START_REF] Pereira | Generalized network-coded cooperation in OFDMA communications[END_REF]. We noted that with mathematical manipulations they can be represented in the simple form of ( 9), where we proved (9) by induction.

λ ij = 1 ρσ 2 ij . Furthermore, Pr{O m |A} is given by Pr{O m |A} = 1 -e -λ m|A γ th , (22)
with λ m|A being

λ m|A = λ S (i 1 ) Rm + ... + λ S (i K ) Rm + λ RmD . (23)
Proof. In GURS NCC, the destination receives K +L packets; K packets from selected users and L network-coded packets from selected relays. Due to the severe channel fading some of the links might be in outage and thereby only a subset of packets can be successfully recovered by the destination. If the destination receives at least K error-free packets, either from the selected users or from the selected relays, it is capable of recovering K original packets; otherwise, an outage occurs 6 . The overall OP of GURS NCC thus depends upon the outage events of direct user-to-destination links and dualhop indirect user-to-relay-to-destination links. Let E η and V denote the set of non-outage selected users and relays with cardinality η and , respectively. Mathematically, E η and V can be written, respectively, as

E η S (k) ∈ S : γ S (k) D > γ th , (24)
V |A R (l) ∈ R : γ min (l)|A > γ th . ( 25
)
where γ th is the threshold SNR.

The overall outage events of GURS NCC can then be expressed as

O = O O , (26)
where O corresponds to the outage events when K > L and there are not enough non-outage selected users, η, such that even if = L, the destination is still in outage i.e., η < K -L.

On the other hand, O stands for the outage events where η ≥ K -L, but the sum of non-outage selected users and relays is less than K i.e., η + < K. Now, we proceed to obtain Pr{E η } and Pr{V }, based on which, Pr{O } and Pr{O } can be derived.

An outage event occurs in a given link when its corresponding instantaneous SNR falls below γ th . The threshold SNR γ th can be written in terms of the transmission rate R 0 (in bits per channel use) as γ th = 2 R0 -1. Let O ij denote the outage event of link i → j. The OP of i → j link can be then written as

Pr {O ij } = Pr{γ ij < γ th }, (27)
where

γ ij = ρ|h ij | 2 is the instantaneous SNR of link i → j.
Noting that γ ij is exponentially distributed, ( 27) is readily solved as

Pr {O ij } = 1 - ∞ γ th λ ij e -λij y dy = 1 -e -λij γ th , (28)
Applying order statistics properties and using [START_REF] Heidarpour | Generalized user-relay selection in network-coded cooperation systems[END_REF], Pr{E η } can be written as [START_REF] Chen | Performance analysis of multiuser diversity in cooperative multi-relay networks under Rayleigh-fading channels[END_REF].

On the other hand, Pr{V } can be formulated using total probability theorem as

Pr{V } = A Pr{V |A}Pr{A}, (29)
Pr{E η } = N -iη v=N -iη+1+1     a1,••• ,av∈{1,...,N } a1 =••• =av     av n=a1 Pr {O SnD } N n =1 n ={a1,...,av} 1 -Pr O S n D         . (19) Pr{V } = A       M -j v=M -j +1 +1     a1,••• ,av∈{1,...,M } a1 =... =av     av m=a1 Pr {O m |A} M m =1 m ={a1,...,av} (1 -Pr {O m |A})         × z1,...,z N ∈{1,..,N } z1 =... =z N zi 1 ,...,zi K ∈A N n=2 λ Sz n D λ Sz 1 D + n i=2 λ Sz i D        . ( 20
)
Pr{V |A} = M -j v=M -j +1 +1     a1,••• ,av∈{1,...,M } a1 =... =av     av m=a1 Pr {O m |A} M m =1 m ={a1,...,av} (1 -Pr {O m |A})         . ( 30
)
where the sum spans over all N K possible A's from the set of N candidate users and Pr{V |A} is given by (30), as shown on the top of this page. Further, Pr{A} can be derived as (31) using Lemma 1. Note that the sum in (31) spans over (N -K)!K! possibilities. For the special case of λ SnD ≈ λ SD , ∀n, we have Pr{A} ≈ 1 ( N K )

.

Pr{A} = z1,...,z N ∈{1,...,N } z1 =... =z N zi 1 ,...,zi K ∈A N n=2 λ Sz n D λ Sz 1 D + n i=2 λ Sz i D .
(31) Now, plugging (30) and (31) into (29), the closed-form expression of Pr{V } can be obtained as [START_REF] Heidarpour | Multiuser diversity in network-coded cooperation: Outage and diversity analysis[END_REF].

Finally, using [START_REF] Chen | Performance analysis of multiuser diversity in cooperative multi-relay networks under Rayleigh-fading channels[END_REF], [START_REF] Heidarpour | Multiuser diversity in network-coded cooperation: Outage and diversity analysis[END_REF], and (26) one can obtain the closedform expression for the OP as given by ( 17) and [START_REF] Sun | On the combination of cooperative diversity and multiuser diversity in multi-source multi-relay wireless networks[END_REF]. Thus, we complete the proof. Special Case 2. The derived OP expression in [START_REF] Ding | A new efficient lowcomplexity scheme for multi-source multi-relay cooperative networks[END_REF] and ( 18) is based on the assumption of asymmetric n.i.i.d. Rayleigh fading channels over all wireless links and can be treated as the generalized versions of semi-symmetric n.i.i.d. channels or symmetric i.i.d. channels 7 . Furthermore, it subsumes all existing results in the literature as special cases. In particular, for K = N and L = M (NCC without user-relay selection) and asymmetric n.i.i.d. channels, it reduces to (34) in [START_REF] Vu | On the diversity of networkcoded cooperation with decode-and-forward relay selection[END_REF]. When K = N and L highest-SNR relays are selected, it reduces to [START_REF] Fan | Outage probability analysis and power allocation for two-way relay networks with user selection and outdated channel state information[END_REF] and [START_REF] Sharma | Performance analysis of cooperative spectrum sharing with multiuser two-way relaying over fading channels[END_REF] in [START_REF] Vu | On the diversity of networkcoded cooperation with decode-and-forward relay selection[END_REF]. For i.i.d. channels with 7 Semi-symmetric n.i.i.d. subchannels refers to the case when λ SnD ≈ λ SD , ∀n, and λ RmD ≈ λ RD , ∀m. This assumption can be applicable to cooperative uplink cellular systems [START_REF] Heidarpour | Multiuser diversity in network-coded cooperation: Outage and diversity analysis[END_REF], [START_REF] Heidarpour | Generalized user-relay selection in network-coded cooperation systems[END_REF] where the mobile users and relays are formed as clusters. On the other hand, the channels are said symmetric i.i.d. when λ SnD = λ RmD = λ SnRm , ∀n, m. K = N and any arbitrary relay selection, it coincides to ( 4) and ( 7) in [START_REF] Heidarpour | Generalized relay selection for network-coded cooperation systems[END_REF].

IV. ASYMPTOTIC ANALYSIS

In this section, we first derive the asymptotic outage expression at the high SNR regime to quantify the achievable diversity order and coding gain. Then, we provide some insights and guidelines that can be drawn from our diversity analysis.

A. Asymptotic Outage Probability

In the previous section, closed-form expression of the OP has been derived, which is still too complicated to learn the relationship between OP and different system parameters. To gain deeper insights about how the system parameters impact on the outage performance, we now characterize the asymptotic behavior of the OP in the high-SNR regime. From the asymptotic expression, we extract two important system design parameters, namely the diversity order and the coding gain.

Theorem 2. Consider a cooperative network that consists of N users, M relays, and one destination. Assume the relays use DF protocol and apply NC on the received users' symbols. If the destination selects the i th 1 , i th 2 , ..., i th K best users and the j th 1 , j th 2 ,..., j th L best relays, the achievable diversity order when K > L can be obtained as

G d1 =          N -i K-L + 1, ψ max L < M + i K-L + 1 N + M -ψ max L + 2, ψ max L > M + i K-L + 1 (32)
and the the coding gain is given by

G c1 =                                  Ψ 1 - 1 N -i K-L +1 γ th , ψ max L < M + i K-L + 1 Ψ 1 - 1 N +M -ψ max L +2 γ th , ψ max L > M + i K-L + 1 (Ψ 1 + Ψ 1 ) - 1 N -i K-L +1 γ th , ψ max L = M + i K-L + 1 (33)
where

ψ max δ = max{ψ η } δ η=1 with ψ η = i K-η+1 +j η . Further, Ψ 1 = a1,••• ,a N -i K-L +1 a1 =••• =a N -i K-L +1   a N -i K-L +1 n=a1 1 σ 2 SnD   , (34)
and

Ψ 1 = η:ψη=ψ max L Q η , (35)
where Q q is given by (36) on the top of the next page and

1 σ 2 m|A = 1 σ 2 S (i 1 ) Rm + ... + 1 σ 2 S (i K ) Rm + 1 σ 2 RmD .
On the other hand, the achievable diversity order and the coding gain when K ≤ L can be obtained as

G d2 = N + M -ψ max K + 2, (37)
and

G c2 = Ψ 2 - 1 N +M -ψ max K +2 γ th , (38)
where

Ψ 2 = η:ψη=ψ max K Q η . (39)
Proof. In asymptotically high-SNR regime, the OP can be written as

lim ρ→∞ P out ρ→∞ ≈ (G c .ρ) -G d , (40)
where the variable G d in (40) denotes the diversity order and determines the slope of the OP curve. This is given by

G d = -lim ρ→∞ log (P out ) log(ρ) . ( 41
)
On the other hand, G c represents the coding gain and quantify the SNR advantage of the asymptotic OP with respect to the reference curve ρ -G d .

To find the asymptotic expressions in the high SNR regime, we use Taylor series expansion of the exponential function given by e -x = ∞ k=0 (-x) k k! . Plugging this expression in [START_REF] Fan | Outage probability analysis and power allocation for two-way relay networks with user selection and outdated channel state information[END_REF], we have

Pr ∞ {O SnD } = λ SnD γ th . (42)
Similarly, ( 22) can be approximated as

Pr ∞ {O m |A} = λ m|A γ th . (43)
Substituting ( 42) and ( 43) into ( 19) and ( 20), and then keeping dominant terms, we respectively have

Pr ∞ {E η } = a1,••• ,a N -i η+1 +1 a1 =••• =a N -i η+1 +1   a N -i η+1 +1 n=a1 λ SnD γ th   , (44)
and

Pr ∞ {V } = A      a1,••• ,a M -j +1 +1 a1 =... =a M -j +1 +1 a M -j +1 +1 m=a1 λ m|A γ th × z1,...,z N z1 =... =z N zi 1 ,...,zi K ∈A N n=2 λ Sz n D λ Sz 1 D + n i=2 λ Sz i D       . ( 45
)
By plugging (44), ( 45) into ( 17) and then retaining the dominant terms, (17) can be approximated as

P ∞ out1 = Pr ∞ {E K-L-1 } + η:η=η max L Pr ∞ {E K-η }Pr ∞ {V η-1 }.
(46) Now, based on the relationship between ψ max L and M +i K-L + 1, (46) in high SNRs can be derived as follows:

• Case 1:

ψ max L < M + i K-L + 1. In this case, P ∞
out1 is determined by the first term in (46) and is given by

P ∞ out1 = Ψ 1 γ th ρ N -i K-L +1 . ( 47
)
• Case 2:

ψ max L > M + i K-L + 1.
In this case, P ∞ out1 is determined by the second term in (46) and can be expressed as

P ∞ out1 = Ψ 1 γ th ρ N +M -ψ max L +2 . (48)
• Case 3:

ψ max L = M + i K-L + 1. In this case, P ∞ out1
is determined by the first and second terms in (46). The asymptotic outage expression can then be written as

P ∞ out1 = (Ψ 1 + Ψ 1 ) γ th ρ N -i K-L +1 . (49)
Finally, using (40), the diversity order and coding gain of GURS NCC system when K > L are, respectively, given by (32) and (33). Now, we proceed to obtain the asymptotic outage expression for K ≤ L. Substituting (44), (45) into [START_REF] Sun | On the combination of cooperative diversity and multiuser diversity in multi-source multi-relay wireless networks[END_REF] and then retaining the dominant terms, [START_REF] Sun | On the combination of cooperative diversity and multiuser diversity in multi-source multi-relay wireless networks[END_REF] in high SNRs can be written as

P ∞ out2 = Ψ 2 γ th ρ N +M -ψ max K +2 . ( 50
)
Based on ( 40) and ( 50), the achievable diversity order and the coding gain when K ≤ L are, respectively, given by ( 37) and (38). This concludes the proof. Special Case 3. The derived diversity order in (32) and ( 37) is the most generic expression in the literature and includes all

Q η = a1,••• ,a N -i K-η+1 +1 a1 =••• =a N -i K-η+1 +1 a N -i K-η+1 +1 n=a1 1 σ 2 SnD A     a1,••• ,a M -jη +1 a1 =... =a M -jη +1 a M -jη +1 m=a1 1 σ 2 m|A × z1,...,z N ∈{1,...,N } z1 =... =z N zi 1 ,...,zi K ∈A N n=2 λ Sz n D λ Sz 1 D + n i=2 λ Sz i D        . (36)
existing results as special cases. More specifically, for K = N and L = M , it reduces to G d = M + 1 [START_REF] Xiao | Design of network codes for multiple-user multiple-relay wireless networks[END_REF], [START_REF] Topakkaya | Wireless network code design and performance analysis using diversity-multiplexing tradeoff[END_REF], [START_REF] Renzo | On the achievable diversity of repetition-based and relay selection network-coded cooperation[END_REF], [START_REF] Vu | On the diversity of networkcoded cooperation with decode-and-forward relay selection[END_REF]. When K = N and L highest-SNR relays are selected, the diversity order for K > L and K ≤ L reduces to G d1 = L+1 and G d2 = M + 1. This coincides with the diversity order reported in [START_REF] Renzo | On the achievable diversity of repetition-based and relay selection network-coded cooperation[END_REF], [START_REF] Vu | On the diversity of networkcoded cooperation with decode-and-forward relay selection[END_REF]. When K = N and any arbitrary relays are selected, it reduces to the diversity order of G d1 = L + 1 and G d2 = N + M -j N + 1 for K > L and K ≤ L, respectively [START_REF] Heidarpour | Generalized relay selection for network-coded cooperation systems[END_REF]. Finally, when K best users and L best relays are selected, it coincides to the results in [START_REF] Heidarpour | Multiuser diversity in network-coded cooperation: Outage and diversity analysis[END_REF]. Special Case 4. The derived diversity order can also be thought as a generalization of the all results available in the non-NCC literature. For K = 1 and M = 0 (non-cooprative multiuser case), the diversity order reduces to G d1 = N -i 1 +1 which coincides to that of [START_REF] Salhab | Multiuser cognitive networks with N th-best user selection and imperfect channel estimation[END_REF]. For N = 1 and the best relay selection, it reduces to G d2 = M + 1 [START_REF] Bletsas | A simple cooperative diversity method based on network path selection[END_REF]. For N = 1 and the j th 1 best relay is selected, it reduces to G d2 = M -j 1 + 2 which agrees with that of in [START_REF] Ikki | On the performance of cooperativediversity networks with the N th best-relay selection scheme[END_REF]. When the best user and the best relay are selected, it reduces to G d2 = N + M . This diversity order is identical to that of [START_REF] Ding | A new efficient lowcomplexity scheme for multi-source multi-relay cooperative networks[END_REF], [START_REF] Sun | On the combination of cooperative diversity and multiuser diversity in multi-source multi-relay wireless networks[END_REF]. For N = 1 and any arbitrary relay selection, it reduces to G d2 = M -j 1 + 2. This result is in agreement with the diversity order reported in [START_REF] Chu | SER and PER performance of packet decode-and-forward relaying with generalized order selection combining[END_REF].

B. Insights and Guidelines

Here, we provide some insights and guidelines that can be drawn from our diversity analysis and can help the understanding and the design of practical NCC systems with user-relay selection protocols.

From (32), the following remarks and guidelines can be drawn:

Remark 1. From N K M L different user-relay selections, ∆ 1 = N -K +1 distinct
diversity orders can be achieved. Therefore, the number of achievable diversity orders is a function of the number of users N , number of selected users K, but it is independent of the number of relays M and the number of selected relays L. Remark 2. The maximum and minimum diversity orders are given by

G max d1 = N -K + L + 1, G min d1 = L + 1 (51)
The condition i K-L = K -L is the necessary (but not sufficient) condition for achieving maximum diversity G max d1 .

Other user selections with i K-L = K -L cannot provide G max d1 . The condition i K-L = K -L is satisfied if and only if the set of selected users includes K -L highest-SNR users. On the other hand, the system has the minimum diversity G min

d1 if i K-L = N -L or ψ max L = N + M -L + 1. Remark 3. When ψ max L < M + i K-L + 1, the diversity is determined by G d1 = N -i K-L + 1
which only depends on the number of users N and the i th K-L best user. This indicates that other system parameters such as number of relays M , number of selected relays L, and any arbitrary relay selection do not impact the achievable diversity order. Remark 4. The number of user selections that always guarantee the diversity order of G d1 = N -i K-L + 1, no matter how the RS proceeds, can be expressed as

ξ = i K-L -1 K -L -1 . ( 52
)
If user selection includes K -L highest-SNR users, we have i K-L = K -L which yields the maximum diversity order of G max d1 = N -K + L + 1 and ξ = 1. This implies that only one user selection always guarantees maximum diversity G max d1 , no matter which of L relays are selected. This user selection is indeed the best user selection that includes K highest-SNR users. On the other hand, when i K-L = N -L, we have the minimum diversity order of G min d1 = L + 1 and ξ = N -L-1 K-L-1 . This suggests that N -L-1 K-L-1 number of user selections, including the worst user selection, have always minimum diversity G min d1 irrespective of RS process. Note that the order of the selected relays only manifests its effect on the coding gain, rather than the diversity. According to (33), if the set of selected relays does not include the lowest-SNR relay (i.e., j L = M ), the coding gain of any arbitrary relay selection is identical to that of the best relay selection leading to the same outage performance in the high-SNR regime. Remark 5. When

ψ max L > M + i K-L + 1, the diversity is determined by G d1 = N + M -ψ max L + 2.
In this case, the diversity is a function of the number of users N , number of relays M , the j th 1 , j th 2 , ..., j th L best relays and the i th K-L+1 , i th K-L+2 , ..., i th K best users. This implies that all the system parameters impact the achievable diversity except the i th 1 , i th 2 , ..., i th K-L best users. Example 1. Consider a network with N = 6, K = 4, M = 4, and L = 2. These system parameters satisfy the condition K > L. All 6 corresponding achievable diversity orders (32) are reported in Table I. As can be seen, there are

∆ 1 = N -K + 1 = 3 different diversity orders ranging from minimum diversity G min d1 = L + 1 = 3 to maximum diversity G max d1 = N - K + L + 1 = 5.
This confirms the statements in Remarks 1, 2. In addition, the user selections with i 2 = 2 i.e., i 2 = 3, 4 are not capable of achieving the maximum diversity of five even if the best relay selection is performed, confirming Remark 2. Furthermore, there are six user selections that always achieve the diversity order of G d1 = N -i K-L +1, no matter which of two relays are selected. More precisely, the best user selection I = {1, 2, 3, 4} guarantees the maximum diversity of five. There are also ξ = On the other hand, based on (37), we have the following design insights and remarks. Remark 6. All possible user-relay selections provide ∆ 2 = N + M -K -L + 1 different diversities. Accordingly, the number of diversity orders is a function of all system parameters.

Remark 7. The diversity order depends on N , M , the i th 1 , i th 2 , ..., i th K best users and the j th 1 , j th 2 , ..., j th K best relays. Therefore, the j th K+1 , j th 2 , ..., j th L best relays do not change the achievable diversity order. Remark 8. The maximum and minimum diversity orders are given by (53). The diversity order of G max d2 = N -K + M + 1 can be achieved if and only if ψ max K = K + 1, implying that the set of selected users and relays must include K highest-SNR users and K highest-SNR relays. On the other hand, the system has the minimum diversity order of G min d2 = L + 1 if and only if Remark 9. The number of relay selections that achieve full diversity order G max d2 is given by

ψ max K = N + M -L + 1. G max d2 = N -K + M + 1, G min d2 = L + 1 (53)
N = 4, K = 2, M = 6, L = 4. J = {1, 2, 3, 4} J = {1, 2, 3, 5} J = {1, 2, 3, 6} J = {1, 2, 4, 5} J = {1, 2, 4, 6} J = {1, 2, 5, 6} J = {1, 3, 4, 5} J = {1,
ζ = M -K L -K . ( 54
)
Remark 10. The relay selections that include K highest-SNR relays has the minimum diversity of M + 1 when the lowest-SNR user is in the set of selected users or equivalently i K = N . Similarly, the worst relay selection has the minimum diversity of L + 1 when i K = N .

Remark 11. The term

N -K + 1 in G max dv (v = 1, 2) (51
) and (53) corresponds to the MUD and the remaining terms L and M correspond to the CD. It can be readily checked that G max dv increases when the number of users N increases. Further, it decreases when the number of selected users K increases. Obviously, when K = N the MUD gain vanishes and only the CD gain can be achieved [START_REF] Heidarpour | Multiuser diversity in network-coded cooperation: Outage and diversity analysis[END_REF].

Example 2. Now, consider a network with N = 4, K = 2, M = 6, and L = 4. These system parameters satisfy the condition K ≤ L. The achievable diversity orders (37) for all

V. NUMERICAL RESULTS AND DISCUSSIONS

In this section, we provide numerical and simulation results to verify the derived analytical expressions. Table III shows the simulation parameters. Here, we consider the same system parameters as in Table I. Specifically, we assume that number of users N = 6, number of selected users K = 4, number of relays M = 4, and number of selected relays L = 2. The transmission rate R 0 is set one. The randomly generated values for the channel variances of the user-to-relay links are given in (55). Note that the effect of different transmit power, noise variance, and path loss on the received signal can be lumped into the fading variances [START_REF] Laneman | Cooperative diversity in wireless networks: Efficient protocols and outage behavior[END_REF]. In particular, the element at the n th row and the m th column of matrix Σ SR corresponds to the variance of the channel between user S n and relay R m .

Σ SR =        
2.3 2.6 0.5 5.1 6.5 0.8 4.9 6.5 4.8 2.7 5.1 1.3 3.9 3.9 0.7 5.2 3.7 4.2 2.1 1.1 2.6 1.9 3.5 4.3

        . (55)
Furthermore, the n th and m th elements in the vector variances Σ SD (56) and Σ RD (57) correspond to the channel variance of the link from user S n and Relay R m to the destination D.

Σ SD = 0.7 0.8 1.2 1.3 0.9 2.3 ,

Σ RD = 2.3 1.2 3.8 4.9 .

In what follows, the derived analytical expressions for the OP and diversity order are examined via representative numerical plots and Monte-Carlo simulations.

Fig. 3 plots the OP of GURS NCC versus SNR ρ with different sets of selected users and two highest-SNR relays (J = {1, 2}). One can observe that the analytical curves perfectly match with simulation results, confirming the correctness of the derived expression [START_REF] Ding | A new efficient lowcomplexity scheme for multi-source multi-relay cooperative networks[END_REF]. Furthermore, the asymptotic curves accurately predict the behaviour of the outage provability in the high-SNR regime. More specifically, the slope of the asymptotic curves reveals that the maximum diversity order of G max d1 = N -K +L+1 = 5 can be achieved if i 2 = 2. This is verified as the diversity for I = {1, 2, 3, 5} and I = {1, 2, 4, 6} with i 2 = 2 is equal to G max d1 = 5, while that of I = {1, 3, 4, 5} and I = {1, 4, 5, 6} with i 2 = 3 and i 2 = 4 is equal to four and three, respectively. In conclusion, the condition i K-L = K -L is the necessary condition for achieving maximum diversity G max d1 , as shown in Table I. In Fig. 4, we plot the OP of GURS NCC for different userrelay selections. It can be seen, the best user selection with the highest-and lowest-SNR relays achieves the maximum diversity order of G max d1 = 5. When I = {1, 2, 3, 5}, however, the diversity order varies depending on the relay selection process. More precisely, the diversity order for I = {1, 2, 3, 5} with J = {1, 2} is equal to five, while that of I = {1, 2, 3, 5} with J = {3, 4} is four. This indicates that the best user selection always guarantees the maximum diversity order G max d1 , no matter how the relay selection proceeds, as shown in Table I.

Fig. 5 illustrates the outage performance of GURS NCC for I = {2, 4, 5, 6} and different relay selections. As can be seen, the slope of the curves is always proportional to the number of users N and the i th K-L best user which is reflected by the parallel slopes of the asymptotic lines. This verifies the theoretical observation that the diversity order is equal to G d1 = N -i K-L + 1 = 3 (cf. Table I). Interestingly, this diversity is preserved, no matter which of two relays are selected. Furthermore, when the worst relay is not selected i.e., j 2 = 4, the outage performance is exactly the same as that of the best relay selection in the high SNR regime. On the other hand, when the set of selected relays includes the worst relay (j 2 = 4), the outage is always worse than that of the best relay selection both in finite and asymptotic SNRs.

B. Number of Selected Users Less Than Number of Selected Relays

Here, the same system parameters as in Table II are considered. In particular, we assume N = 4, K = 2, M = 6, L = 4. These system parameters satisfies the condition K ≤ L. The variances of the user-to-relay, user-to-destination, and relay-to-destination channels are generated randomly and are, respectively, given by (58), (59), and (60). We set the transmission rate as R 0 = 2.

Σ SR =     0.5 1.
Σ SD = 1.9 0.9 1.5 1.1 ,

Σ RD = 1.2 2.7 3.3 2.2 0.9 2.6 .

Fig. 6 shows the outage performance of GURS NCC when the best/worst user and best/worst relay sets are selected. Once again, the analytical curves are confirmed by simulations to be exact and accurate. Furthermore, the asymptotic lines well approximate the exact curves in the high SNR regime. In addition, we can readily see that the best user-relay selection achieves the maximum diversity of G max d2 = N -K +M +1 = 9. On the other hand, the worst user-relay selection has the minimum diversity of G min d2 = L + 1 = 5. Besides, although the best-user worst-relay selection outperforms the best-relay worst-user selection in terms of the coding gain, the diversity order for both cases is identical and is equal to G d2 = M + 1 = 7 (cf. Table II). Finally, Figs. 7 and 8 present the outage performance of GURS NCC for J = {1, 2, 5, 6} and J = {3, 4, 5, 6} when different sets of selected users are considered. As can be seen, three distinct diversities are achieved for J = {1, 2, 5, 6} and J = {3, 4, 5, 6} depending on the set of selected users. In particular, for J = {1, 2, 5, 6}, the maximum diversity of G max d2 = 9 is achieved when the user selection includes two highest-SNR users. Furthermore, when the user selection includes the worst user (i.e., i 2 = 4), the minimum diversity order of G d2 = M + 1 = 7 is achieved. Also, I = {1, 3} and I = {2, 3} have the diversity order of eight. On the other hand, from Fig. 8, we observe that in the case of J = {3, 4, 5, 6} the diversity of G d2 = M + 1 = 7 is achieved for I = {1, 2}. Besides, when i 2 = 4 the diversity order of G d2 = L + 1 = 5 is achieved. For both I = {1, 3} and I = {2, 3} the diversity is identical and is equal to six. These observations are in agreement with the diversity orders reported in Table II.

VI. CONCLUSIONS

In this paper, we proposed generalized user-relay selection in a multiuser multirelay NCC system. More specifically, we considered N sources, M relays, and a single destination. The destination selects the i th 1 , i th 2 , ..., i th K best sources and the j th 1 , j th 2 , ..., j th L best relays subject to any practical considerations. Considering n.i.i.d. Rayleigh fading channels, generalized closed-form expression for the OP has been derived. Asymptotic analysis has been further performed to quantify the diversity order and coding gain of the considered system. We showed that the derived diversity order is the generalized version of the earlier results reported in the literature and thus subsume all existing results as special cases. Our results also revealed that if K > L, G d1 = N -i K-1 + 1, and the set of selected relays does not include the lowest-SNR relay i.e., j L = M , the coding gain of any arbitrary relay selection is identical to that of the best relay selection. On the other hand, when K ≤ L and the relay selections include K highest-SNR relays, GURS NCC has the minimum diversity of G d2 = M + 1 when the lowest-SNR user is in the sets of selected users i.e., i K = N . Similarly, the worst relay selection has the minimum diversity of G min d2 = L + 1 if i K = N . Monte-Carlo simulations were also provided to corroborate the accuracy of our analytical findings. Our results clearly provide useful design insights and guidelines for practical cooperative systems with user-relay selection protocols.

The derived OP and diversity order expressions can be applied to investigate various new technologies, including energy harvesting and cognitive radio. Furthermore, the proposed GURS assumes perfect CSI for user-relay selection process. Hence, performance loss due to outdated CSI on the performance of GURS should be investigated. These tasks are set aside for future work.

Fig. 1 .

 1 Fig. 1. Timing diagram for GURS NCC.

  Consider a dual-hop multiuser multirelay network with N sources S = {S n } N n=1 , one destination D, and M DF relays R = {R m } M m=1

4 4 2 =

 42 90 user-relay selections with their TABLE I DIVERSITY ORDERS FOR ALL POSSIBLE USER-RELAY SELECTIONS: N = 6, K = 4, M = 4, L = 2.

2 1 = 2

 12 (52) number of user selections that always achieve the diversity of four i.e., I = {1, 3, 4, 5} and I = {2, 3, 4, 5}. Besides, ξ = 3 1 = 3 user selections always have the minimum diversity of three. They are I = {1, 4, 5, 6}, I = {2, 4, 5, 6} and the worst user selection I = {3, 4, 5, 6}. This confirms the statements in Remark 4.

  3, 4, 6} J = {1, 3, 5, 6} J = {1, 4, 5, 6} J = {2, 3, 4, 5} J = {2, 3, 4, 6} J = {2, 3, 5, 6} J = {2, 4, 5, 6} J = {3, 4, 5, 6} I = {1, 2} 9

9 .

 9 user-relay selections are provided in TableII. It can be seen that there are∆ 2 = N + M -K -L + 1 = 5 different achievable diversity orders; from the minimum diversity of G min d2 = L + 1 = 5 to the maximum diversity of G max d2 = N -K + M + 1 = 9 i.e., G d2 = 5, 6, 7, 8, 9. This confirms Remarks 6, 8. Besides, ζ = 4 2 = 6 (54) relay selections achieve maximum diversity G max d2 = Furthermore, the relay selections that include K = 2 highest-SNR relays have the minimum diversity of M + 1 = 7 when i 2 = 4 i.e., I = {1, 4}, I = {2, 4}, and I = {3, 4}. Similarly, the worst relay selection J = {3, 4, 5, 6} has the minimum diversity of L + 1 = 5 when i 2 = 4. This confirms the statements in Remarks 9 and 10.

Fig. 3 .Fig. 4 .

 34 Fig. 3. OP versus ρ for N = 6, K = 4, M = 4, L = 2, J = {1, 2} with different user selections.

Fig. 5 .

 5 Fig. 5. OP versus ρ for N = 6, K = 4, M = 4, L = 2, I = {2, 4, 5, 6} and different relay selection sets.

Fig. 6 .

 6 Fig. 6. OP versus ρ for N = 4, K = 2, M = 6, L = 4 with the best/worst user selection and the best/worst relay selection.

Fig. 7 .

 7 Fig. 7. OP versus ρ for N = 4, K = 2, M = 6, L = 4, J = {1, 2, 5, 6} and different user selections.

Fig. 8 .

 8 Fig. 8. OP versus ρ for N = 4, K = 2, M = 6 L = 4, J = {3, 4, 5, 6} and different user selections.

TABLE II DIVERSITY

 II ORDERS FOR ALL POSSIBLE USER-RELAY SELECTIONS:

This can be implemented in practice using a cyclic redundancy check (CRC).

The authors in[START_REF] Heidarpour | Multiuser diversity in network-coded cooperation: Outage and diversity analysis[END_REF] proposed a user-relay selection that selects the best users and relays to exploit both MUD and CD gains in NCC systems.

5G wireless communication systems use two main frequency bands, namely traditional sub-6 GHz band (< 6 GHz) and millimeter-wave (mmwave) band (30-300 GHz). In this paper, we consider sub-6 GHz 5G and assume n.i.i.d. Rayleigh fading channels to model multipath fading environments. The Rayleigh fading model for the sub-6 GHz band, however, cannot be applied to mm-wave band due to poor scattering propagation and significant attenuation of mm-wave signals.

In time-varying fading channels, due to a delayed feedback the instantaneous CSI used in user/relay selection may substantially differ from the CSI at the data transmission instant. The outdated CSI may result in wrong selections, and hence impact the system performance. The effect of the outdated CSI on the performance of GURS NCC is an interesting research top and is left as a future work.

We assume that the network codes are constructed over a sufficiently large field size q. This ensures that the resulting network-coded messages are distinct and mutually independent. The destination thus requires only K messages (either from selected users or from selected relays) to jointly recover K original messages.

This work was supported by the Telus Communications Inc. and Alberta Innovates Graduate Student Scholarship.