Pilot Reuse Among D2D Users in D2D Underlaid Massive MIMO Systems

# Pilot Reuse Among D2D Users in D2D Underlaid Massive MIMO Systems

Hao Xu, Student Member, IEEE0, Wei Xu, Senior Member, IEEE0, Zhaohui Yang, Student Member, IEEE0, Jianfeng Shi, Student Member, IEEE0, and Ming Chen, Member, IEEE0 Copyright (c) 2015 IEEE. Personal use of this material is permitted. However, permission to use this material for any other purposes must be obtained from the IEEE by sending a request to pubs-permissions@ieee.org. This work was in part supported by the NSFC (Nos. 61372106, 61471114, & 61221002), NSTMP under 2016ZX03001016-003, the Six Talent Peaks project in Jiangsu Province under GDZB-005, Science and Technology Project of Guangdong Province under Grant 2014B010119001, the Scholarship from the China Scholarship Council (No. 201606090039), Program Sponsored for Scientific Innovation Research of College Graduate in Jiangsu Province under Grant KYLX16_0221, and the Scientific Research Foundation of Graduate School of Southeast University under Grant YBJJ1651. (Corresponding author: Hao Xu, Wei Xu.)H. Xu, W. Xu, Z. Yang, J. Shi and M. Chen are with the National Mobile Communications Research Laboratory, Southeast University, Nanjing 210096, China (Email: {xuhao2013, wxu, yangzhaohui, shijianfeng and chenming}@seu.edu.cn).
###### Abstract

In a device-to-device (D2D) underlaid massive MIMO system, D2D transmitters reuse the uplink spectrum of cellular users (CUs), leading to cochannel interference. To decrease pilot overhead, we assume pilot reuse (PR) among D2D pairs. We first derive the minimum-mean-square-error (MMSE) estimation of all channels and give a lower bound on the ergodic achievable rate of both cellular and D2D links. To mitigate pilot contamination caused by PR, we then propose a pilot scheduling and pilot power control algorithm based on the criterion of minimizing the sum mean-square-error (MSE) of channel estimation of D2D links. We show that, with an appropriate PR ratio and a well designed pilot scheduling scheme, each D2D transmitter could transmit its pilot with maximum power. In addition, we also maximize the sum rate of all D2D links while guaranteeing the quality of service (QoS) of CUs, and develop an iterative algorithm to obtain a suboptimal solution. Simulation results show that the effect of pilot contamination can be greatly decreased by the proposed pilot scheduling algorithm, and the PR scheme provides significant performance gains over the conventional orthogonal training scheme in terms of system spectral efficiency.

## I Introduction

With the increasing demand on broadband wireless communications, the problem of spectrum insufficiency has become a major factor limiting the wireless system performance [1]. Massive multiple-input multiple-output (MIMO) transmission was proposed in [2] and has triggered considerable research interest recently due to its great gains in spectral efficiency (SE) and energy efficiency (EE) [3, 4, 5]. Besides, device-to-device (D2D) communication has also been proven promising in enhancing the SE of the traditional cellular systems and has drawn great attention recently [6, 7, 8]. Different from the conventional cellular communication where all traffic is routed via base station (BS), D2D communication allows two closely located users to communicate directly, and thus have distinct advantages such as high SE, short packet delay, low energy consumption and increased safety.

There has been extensive research on design and analysis of massive MIMO systems [9, 10, 11, 12, 13]. In [9], the uplink capacity bounds were derived under both perfect and imperfect channel state information (CSI), and the tradeoff between SE and EE was studied. Ref. [10] compared two most prominent linear precoders with respect to (w.r.t.) SE and radiated EE in a massive MIMO system. Unlike [9] and [10], which considered simplified single-cell scenarios, [11, 12, 13] studied multi-cell massive MIMO systems. As for underlaid D2D communication, a great challenge to the existing cellular architecture is the cochannel interference due to spectrum reuse. There has been a lot of literature working on interference mitigation for D2D underlaid systems [14, 15, 16, 17, 18, 19, 20]. In [14, 15, 16, 17], resource allocation and power control algorithms were proposed to maximize the SE of D2D users (DUs), and in [18, 19, 20], extended algorithms were carried out to maximize the EE of DUs.

Though massive MIMO and D2D communication have been widely studied, only a few papers investigated the interplay between massive MIMO and D2D communication [21, 22]. In [22], the SE of cellular and D2D links was investigated under both perfect and imperfect CSI, but the overhead for acquiring CSI was not considered. In massive MIMO systems, orthogonal pilots are transmitted by cellular users (CUs) to obtain CSI. When D2D communication is introduced and orthogonal pilots are used at each D2D transmitter (D2D-Tx) for channel estimation, the pilot overhead is large which will significantly affect the system performance. Furthermore, as a multi-user transmission strategy, massive MIMO is designed to support multiple users transmitting on the same time-frequency block. Though D2D-to-cellular interference can be greatly reduced by a large antenna array at BS, cellular-to-D2D interference still persists and may be worse than a conventional single-input single-output (SISO) D2D underlaid system.

In order to shorten pilot overhead, an effective strategy is allowing orthogonal pilots to be reused among different users. Most of the existing works with pilot reuse (PR) mainly focus on multiple-cell scenarios, i.e., mobile users in the same cell use orthogonal pilots, and users in different cells reuse the same set of pilots [23, 24, 25, 26, 27]. To the best of the authors’ knowledge, only a few works have considered the strategy of PR within a cell [28, 29, 30, 31]. In [28], the authors analyzed the feasibility of PR over spatially correlated massive MIMO channels with constrained channel angular spreads. Authors of [29] and [30] allowed D2D-Txs to reuse the pilots of CUs and proposed an interference-aided minimum-mean-square-error (MMSE) detector to suppress the D2D-to-cellular interference. [31] also studied a D2D underlaid massive MIMO system with PR, but the performance of CUs was left out of consideration for simplicity. In contrast to these existing works, our work analyzes the achievable rate of both cellular and D2D links under PR, and proposes pilot scheduling as well as power control algorithms to optimize the system performance. The main contributions of this paper are summarized as follows:

We assume that CUs use orthogonal pilots while all D2D-Txs reuse another set of pilots for channel estimation. The motivation of PR stems from that D2D pairs usually locate dispersively and use low power for short-distance transmission. Hence, letting several D2D pairs which are far away from each other use the same pilot for channel estimation would cause endurable pilot contamination. Under PR, we first derive the expression of MMSE estimate of all channels. With the obtained imperfect CSI, all receivers apply the partial zero forcing (PZF) receive filters studied in [32] for signal detection. Then, we derive the effective signal-to-interference-plus-noise ratio (SINR) and a lower bound on the ergodic achievable rate of each user.

Different from the estimation of cellular channel vectors which is only affected by noise, the channel estimation of D2D links experiences effect from both noise and pilot contamination due to PR. To mitigate pilot contamination, we develop a pilot scheduling and pilot power control algorithm under the criterion of minimizing the sum mean-square-error (MSE) of channel estimation of D2D links. We first show that with an appropriate number of orthogonal pilots available for DUs and a well designed pilot scheduling scheme, each D2D-Tx should transmit its pilot using the maximum power. Then, we develop a heuristic pilot scheduling scheme to allocate pilots to DUs, and show that the sum MSE of channel estimation of D2D links can be decreased significantly.

We study the sum SE maximization for D2D links while guaranteeing the quality of service (QoS) of CUs. Efficient power control algorithms often play an important role in reducing cochannel interference and reaping the potential benefits of D2D communication. However, these algorithms are usually carried out based on the knowledge of instantaneous CSI of all links [14, 15, 16, 17]. Apart from the computational complexity, such algorithms require BS to gather instantaneous CSI of all links, which is difficult for implementation. Therefore, in this paper, we consider performing the power control algorithm periodically at a coarser frame level granularity based on large-scale fading coefficients which vary slowly. Simulation results show that the proposed algorithm converges rapidly and obtains a much higher sum SE of D2D links compared to the typical orthogonal training scheme.

Note that since PR among D2D pairs in a D2D underlaid massive MIMO system has been less well researched, we consider a simplified single-input multiple-output (SIMO) transmission for D2D communication as [22], and mainly focus on analyzing the effect of PR on the system performance. As for MIMO transmission, similar results can be obtained by simply modifying the analysis and optimization of this manuscript. On the other hand, our analysis in this paper focuses on a single-cell scenario for the sake of clarity. Regarding the multi-cell massive MIMO system, there has been a lot of literature working on mitigating pilot contamination [33, 34, 35]. As a result, for a multi-cell D2D underlaid massive MIMO system, where PR among D2D pairs persists, we can first use the algorithms developed in [33, 34, 35] to allocate pilots to CUs if CSI can be exchanged among cells, and then straightforwardly extend the proposed algorithms to improve system performance.

In this paper, we follow the common notations. , and denote the set of natural numbers, the real space and the complex space, respectively. The boldface upper (lower) case letters are used to denote matrices (vectors). stands for the dimensional identity matrix and denotes the all-zero vector or matrix. “ ” represents the set subtraction operation. Superscript denotes the conjugated-transpose operation and denotes the expectation operation. We use to denote the Euclidean norm of . means that each element in is positive (nonnegative).

The rest of this paper is organized as follows. In Section II, a D2D underlaid massive MIMO system is introduced. In Section III, we present the MMSE estimate of all channels under PR and show how PR affects the channel estimation. The achievable rate of both cellular and D2D links is analyzed in Section IV. In Section V, we aim to minimize the sum MSE of channel estimation of D2D links and maximize the sum SE of all D2D links. Finally, numerical verifications are presented in Section VI before concluding remarks in Section VII.

## Ii System Model

Consider the uplink of a D2D underlaid massive MIMO system with one BS, CUs and D2D pairs. The set of CUs and D2D pairs are denoted by 111Here we misuse the notation while avoiding possible ambiguity with the in the complex normal distribution sign . and , respectively. The BS is equipped with antennas and each CU has one transmit antenna. As for the D2D communication, we assume SIMO transmission, i.e., each D2D-Tx is equipped with one antenna and each D2D receiver (D2D-Rx) is equipped with antennas as in [22]. In this system, all transmitters use the same time-frequency resource block to transmit signals, leading to cochannel interference. The dimensional received data vector at BS is

 y(c)=N∑n=1√qs,nu(c)nh(c)nx(c)n+K∑i=1√ps,iu(d)ih(d)ix(d)i+z, (1)

where is the data transmit power of CU , and is the zero-mean unit-variance data symbol of CU . is the real-valued large-scale fading coefficient from CU to BS and is assumed to be known as a priori. denotes the fast fading vector channel from CU to BS. , , and are similarly defined for D2D-Tx . is the complex Gaussian noise at BS with covariance .

Analogously, the dimensional received data vector at D2D-Rx is given by

 y(d)k=K∑i=1√ps,iv(d)ikg(d)ikx(d)i+N∑n=1√qs,nv(c)nkg(c)nkx(c)n+nk, (2)

where and denote the real-valued large-scale fading coefficient and the fast fading vector channel from D2D-Tx to D2D-Rx , respectively. and are similarly defined for the link from CU to D2D-Rx . is the complex Gaussian noise at D2D-Rx with covariance .

## Iii Channel Estimation

Orthogonal pilots are usually adopted to obtain the CSI of all links. In a D2D underlaid system, to reduce pilot overhead, we assume that CUs use orthogonal pilots while all D2D-Txs reuse another set of pilots for channel estimation. Denote as the pilot matrix with orthogonal column vectors (i.e., ). () is the length of the pilots and is also the number of pilots available for channel estimation (this is the smallest amount of pilots that are required). Then, without loss of generality, we assume that pilot () is allocated to CU and the remaining pilots are reused among all D2D pairs.

### Iii-a Channel Estimation at BS

Similar as the uplink data transmission in (1), the dimensional received signal matrix of pilot transmission at BS is

 Y(c)=N∑n=1√qp,nu(c)nh(c)nωHn+K∑i=1√pp,iu(d)ih(d)iλHi+Z, (3)

where and denote the pilot transmit powers of CU and D2D-Tx , respectively. is the pilot allocated to D2D pair . is the noise matrix which consists of independently and identically distributed (i.i.d.) Gaussian elements with zero mean and variance . Then, the MMSE estimate of is given by [36]

 ^h(c)n=√qp,nu(c)nqp,nu(c)n+N0Y(c)ωn,∀n∈N. (4)

Given the channel estimate vector , we can express the true channel vector as , where the error vector represents the CSI uncertainty. Due to the property of MMSE estimation [36], is statistically independent of , and they follow

 ^h(c)n∼CN(0,δ(c)nIB),~h(c)n∼CN(0,ε(c)nIB), (5)

where

 δ(c)n=qp,nu(c)nqp,nu(c)n+N0,ε(c)n=1−δ(c)n. (6)

We then analogously derive the MMSE estimate of as follows

 ^h(d)k=√pp,ku(d)k∑i∈Xkpp,iu(d)i+N0Y(c)λk,∀k∈K, (7)

where is the set of all D2D pairs using the same pilot as D2D pair . Denote . Then, and are statistically independent satisfying

 ^h(d)k∼CN(0,δ(d)kIB),~h(d)k∼CN(0,ε(d)kIB), (8)

where

 δ(d)k=pp,ku(d)k∑i∈Xkpp,iu(d)i+N0,ε(d)k=1−δ(d)k. (9)

### Iii-B Channel Estimation at D2D-Rxs

The dimensional received pilot signal matrix at D2D-Rx can be written as

 Y(d)k=N∑n=1√qp,nv(c)nkg(c)nkωHn+K∑i=1√pp,iv(d)ikg(d)ikλHi+Nk, (10)

where is the noise matrix consisting of i.i.d. Gaussian elements with zero mean and variance . Then, the MMSE estimate of is given by

 ^g(d)ik=√pp,iv(d)ik∑j∈Xkpp,jv(d)jk+N0Y(d)kλi,∀i,k∈K, (11)

Denote . Then, as mentioned above, is statistically independent of , and the distributions of them are given by

 ^g(d)ik∼CN(0,μ(d)ikIM),~g(d)ik∼CN(0,ϵ(d)ikIM), (12)

where

 μ(d)ik=pp,iv(d)ik∑j∈Xkpp,jv(d)jk+N0,ϵ(d)ik=1−μ(d)ik.

Similarly, we have the MMSE estimate of as follows

 ^g(c)nk=√qp,nv(c)nkqp,nv(c)nk+N0Y(d)kωn,∀n∈N,k∈K. (13)

Denote the channel estimation error vector by , then, and are statistically independent and satisfy

 ^g(c)nk∼CN(0,μ(c)nkIM),~g(c)nk∼CN(0,ϵ(c)nkIM), (14)

where

 μ(c)nk=qp,nv(c)nkqp,nv(c)nk+N0,ϵ(c)nk=1−μ(c)nk. (15)

From (4) and (13), it can be observed that the estimation of and is only affected by pilot noise. The pilot interference from other CUs and DUs disappear completely due to the orthogonality of the pilots. As for the estimation of and , it is clear from (7) and (11) that apart from the effect of pilot noise, it is also affected by pilot contamination due to PR among D2D pairs.

## Iv Achievable Rate Analysis

In this section, we analyze the achievable rate of both cellular and D2D links under PR. Let denote the unit norm receive filter used by BS for detecting the signal of CU , and denote the unit norm receive filter adopted by D2D-Rx for detecting the signal from D2D-Tx . Since the receive filter can be used either to boost the desired signal power or to eliminate interference signal, the SINR of each link critically depends on the receive filter that is used. In this paper, we adopt PZF receivers, which use part of degrees of freedom for signal enhancement and the remaining degrees of freedom for interference suppression, for signal detection at both BS and D2D-Rxs.

We assume that BS uses and degrees of freedom to cancel the interference from the nearest cellular interferers and the nearest D2D interferers using different orthogonal pilots. From (7), we can obtain the following relationship

 ^h(d)k=  ⎷pp,ku(d)kpp,iu(d)i^h(d)i,∀k∈K,i∈Xk∖k, (16)

which indicates that the estimation of channels from two different D2D-Txs using the same pilot to BS are in the same direction. As a result, the interference from D2D interferers applying the same pilot can be eliminated simultaneously by using one degree of freedom. Since orthogonal pilots are reused by D2D pairs, we divide all D2D pairs into sets with D2D pairs in each set using the same pilot for channel estimation. Then, we know that BS is able to cancel the interference from sets of D2D interferers. The feasible set of is given by

 {(bc,bd)∈N×N∣bc≤N−1,bd≤τ−N,bc+bd≤B−1}. (17)

The PZF filter can be obtained by normalizing the projection of channel estimation on the nullspace of channel estimation vectors of cancelled interferers (refer to (45) in Appendix A). For the sake of convenience, let denote the set of uncancelled CUs when detecting , and denote the set of uncancelled DUs when detecting cellular signals.

Similarly, each D2D-Rx uses and degrees of freedom to cancel the interference from the nearest cellular interferers and the nearest D2D interferers using different orthogonal pilots. should be in the following set

 {(mc,md)∈N×N∣mc≤N,md≤τ−N−1,mc% +md≤M−1}. (18)

The PZF filter can be obtained by first projecting channel estimation onto the nullspace of channel estimation vectors of cancelled interferers, and then normalizing the projection. Let and respectively denote the sets of uncancelled CU and DUs when detecting .

### Iv-a A lower bound on achievable rate of cellular links

Since BS only has the information of estimated channel vectors (4) and (7), which are treated as the true CSI, using PZF receiver for detecting , we can write the post-processing received signal associated with CU at BS as

 r(c)n=(β(c)n)Hy(c) =√qs,nu(c)n(β(c)n)H^h(c)nx(c)n +(β(c)n)H⎛⎜⎝∑a∈C(c)n∖n√qs,au(c)a^h(c)ax(c)a+∑i∈D(c)√ps,iu(d)i^h(d)ix(d)i +N∑a=1√qs,au(c)a~h(c)ax(c)a+K∑i=1√ps,iu(d)i~h(d)ix(d)i+z), (19)

where only the first term of the second equality is the desired information, while the other terms represent the cochannel interference, channel estimation error and noise, respectively. Thus, the effective SINR of cellular link can be expressed as

 η(c)n=S(c)nI(c→c)n+I(d→c)n+α(c)∥∥β(c)n∥∥22, (20)

where represents the desired signal from CU , and respectively denote the cochannel interference from all uncancelled cellular and D2D interferers, and they are given by

 I(c→c)n=∑a∈C(c)n∖nqs,au(c)a∣∣∣(β(c)n)H^h(c)a∣∣∣2, I(d→c)n=∑i∈D(c)ps,iu(d)i∣∣∣(β(c)n)H^h(d)i∣∣∣2. (21)

characterizes the effect of both channel estimation error and noise experienced by CU , and can be formulated as

 α(c)=N∑a=1qs,au(c)aε(c)a+K∑i=1ps,iu(d)iε(d)i+N0. (22)

In [9] and [22], the asymptotic uplink rate of cellular links in a massive MIMO (or D2D underlaid massive MIMO) system has been studied. As for the system considered in this paper, we can also obtain a similar result about the asymptotic uplink rate of CUs as shown in the following corollary. Since corollary 1 can be analogously verified as that in [22], we omit the proof process for brevity.

###### Corollary 1

With fixed transmit powers at all transmitters, using linear filters for signal detection at BS, the asymptotic uplink rate of each cellular link grows unboundedly as goes to infinity.

In fact, the number of antennas at BS is usually finite due to multiple practical constraints. Hence, in the following of this paper, we consider a more practical scenario where BS is equipped with large but finite numbers of antennas. Consider the block fading model, where all channels remain unchanged over the coherence interval with length . Then, based on (5), (8) and (20), we can derive a lower bound on the ergodic achievable rate of cellular links as shown in the following theorem.

###### Theorem 1

Given the SINR formula in (20), the ergodic achievable rate of cellular link is lower bounded by

 R(c,lb)n=(1−τT)log2(1+η(c,lb)n),∀n∈N, (23)

where

 η(c,lb)n=qs,nϕ(c)nN∑a=1qs,aφ(c)an+σ(%c), (24)

and

 ϕ(c)n = (B−bc−bd−1)u(c)nδ(c)n, φ(c)an = {u(c)a,a∈C(c)n∖nu(c)aε(c)a,a=nora∈N∖C(c)n, σ(c) = K∑i=1ps,iφ(d)i+N0, φ(d)i = ⎧⎨⎩u(d)i,i∈D(c)u(d)iε(d)i,i∈K∖D(c). (25)

Proof: See Appendix A.

###### Remark 1

When considering the effect of pilot length on , from (24), we can find that when , is affected by channel estimation error of cellular link , i.e., , and channel estimation errors of cancelled cellular links, i.e., . Since CUs use orthogonal pilots for channel estimation, the value of has no effect on and . Hence, for fixed pilot transmit power, decreases monotonically w.r.t. . In contrast, when , except the effect of and , is also influenced by the estimation errors of channels from cancelled D2D-Txs to BS, i.e., . Due to PR, increasing results in smaller , and thereby helps increase . Therefore, it would be hard to determine the monotonicity of w.r.t. .

### Iv-B A lower bound on achievable rate of D2D links

To detect , the received signal at D2D-Rx after using PZF receiver can be written as

 r(d)k=(β(d)k)Hy(d)k =√ps,kv(d)kk(β(d)k)H^g(d)kkx(d)k +K∑i=1√ps,iv(d)ik~g(d)ikx(d)i+N∑n=1√qs,nv(c)nk~g(c)nkx(c)n+nk). (26)

where only the first term of the second equality is the desired signal, while the other terms respectively denote the cochannel interference, channel estimation error and noise. Then, the effective SINR of D2D link is

 η(d)k=S(d)kI(d→d)k+I(c→d)k+α(%d)k∥∥β(d)k∥∥22, (27)

where denotes the desired signal from D2D-Rx . , respectively denote D2D and cellular cochannel interference, characterizes the effect of both channel estimation error and noise experienced by D2D-Rx , and they are given by

 I(d→d)k=∑i∈D(d)k∖kps,iv(d)ik∣∣∣(β(d)k)H^g(d)ik∣∣∣2, I(c→d)k=∑n∈C(d)kqs,nv(c)nk∣∣∣(β(d)k)H^g(c)nk∣∣∣2, α(d)k=K∑i=1ps,iv(d)ikϵ(d)ik+N∑n=1qs,nv(c)nkϵ(c)nk+N0. (28)

Similarly as the cellular uplink case, we can also derive a lower bound on the ergodic achievable rate of D2D links.

###### Theorem 2

Given the SINR formula in (27), the ergodic achievable rate of D2D link is lower bounded by

 R(d,lb)k=(1−τT)log2(1+η(d,lb)k),∀k∈K, (29)

where

 η(d,lb)k=ps,kϕ(d)kK∑i=1ps,iψ(d)ik+σ(d)k, (30)

and

 ϕ(d)k = (M−mc−md−1)v(d)kkμ(d)kk, ψ(d)ik = ⎧⎪ ⎪ ⎪ ⎪⎨⎪ ⎪ ⎪ ⎪⎩v(d)ik,i∈D(d)k∖Xkv(d)ikϵ(d)ik,i=korK∖D(d)k(M−mc−md−1)v(d)ikμ(%d)ik+v(d)ikϵ(d)ik,i∈Xk∖k, σ(d)k = ∑n∈C(d)kqs,nv(c)nk+∑n∈N∖C(d)kqs,nv(c)nkϵ(c)nk+N0. (31)

Proof: See Appendix B.

###### Remark 2

From (30), it can be found that for any in feasible set (18), is an implicit function of due to PR. Increasing results in more accurate channel estimations of D2D links, and thereby helps increase . However, as increases, the number of symbols available for data transmission becomes smaller. In Section VI, we show by simulation results that first increases and then decreases w.r.t. .

In the following, we focus on pilot scheduling and power control design based on (23) and (29). Since large-scale fading coefficients vary slowly, the proposed pilot scheduling and power control algorithms can be performed periodically at a coarser frame level granularity, which will greatly decrease the computational complexity of BS. As a result, Theorem 1 and Theorem 2 are helpful for the following analysis.

## V Pilot Scheduling and Power Control

Up to now, we have investigated the cannel estimation as well as achievable rate of both cellular and D2D links in a D2D underlaid massive MIMO system with PR. Based on the above analysis, we focus on two problems in this section. The first problem aims to minimize the sum MSE of channel estimation of D2D links, and the second problem aims to maximize the sum rate of all D2D links while guaranteeing the QoS requirements of CUs.

### V-a Pilot Power Control and Pilot Scheduling

As mentioned in Section III, the channel estimation of cellular links is only affected by additive noise. Therefore, we assume that each CU transmits pilot signal with the maximum power. As for D2D links, apart from the effect of additive noise, channel estimation is also influenced by pilot contamination. Due to the location dispersion of D2D pairs and short-distance D2D transmission, it should be preferred that the pilot contamination can be greatly reduced by using an effective pilot scheduling and pilot power control algorithm. According to (12) and (III-B), the sum MSE of channel estimation of D2D links can be written as

 K∑k=1E{∥∥~g(d% )kk∥∥22}=K∑k=1Mϵ(d)kk. (32)

Since orthogonal pilots are reused among D2D pairs, denote the PR pattern by with each element in being binary-valued. If D2D pair is assigned pilot , we have , otherwise, we have . Denote the pilot transmit power vector of DUs by . Then, aiming at minimizing (32), we arrive at the following problem

 minO,pp K∑k=1Mϵ(d)kk (33a) s.t. 0≤pp,k≤τPk,∀k∈K, (33b) τ∑t=N+1ot−N,k=1,∀k∈K, (33c)

where is the maximum data transmit power of D2D-Tx . Constraints (33c) indicate that each D2D pair can be allocated only one pilot. Note that for simplicity, is formulated as a function of in an implicit way in (III-B). We can also equivalently rewrite it in an explicit way as follows

 ϵ(d)kk=τ∑t=N+1ot−N,k⎛⎜ ⎜ ⎜ ⎜ ⎜⎝1−pp,kv(d)kkK∑j=1ot−N,jpp,jv(d)jk+N0⎞⎟ ⎟ ⎟ ⎟ ⎟⎠,∀k∈K. (34)

To solve problem (33), we first give the optimal condition for in the following theorem.

###### Theorem 3

There always exists such that when the optimal pilot scheduling matrix has been determined, the optimal satisfies .

Proof: See Appendix C. The above theorem indicates that with a proper and the optimal , constraints (33b) are always active. We can explain Theorem 3 in an intuitive way as follows. When the number of orthogonal pilots available for DUs is appropriate (i.e., with a relatively low PR ratio) and these pilots are allocated to D2D pairs by using the optimal pilot scheduling scheme (a special case is and all D2D pairs use different orthogonal pilots for channel estimation), ignorable pilot contamination would be caused due to the dispersive positions of D2D pairs. Hence, all D2D-Txs should transmit their pilot signals in the maximum power to increase the estimation accuracy. In contrast, with a small (i.e., with a relatively high PR ratio), even using the optimal pilot scheduling scheme, pilot contamination may still influence the estimation accuracy greatly and solving (59) may yield . In this case, we need to enlarge the set of pilots for DUs to decrease PR ratio.

Based on Theorem 3, in the following, we assume that D2D-Txs always transmit pilots in the maximum power. Then, problem (33) becomes

 minO K∑k=1Mϵ(d)kk (35a) s.t. τ∑t=N+1ot−N,k=1,∀k∈K, (35b)

which is a mixed integer programming problem. The optimal can be obtained through exhaustive search (ES). Recalling (III-B), the number of scalar multiplication required to compute the objective function in (33) is . Thus, obtaining the optimal through ES involves a complexity of . Due to the exponential complexity, it will be impractical to run ES when the number of D2D pairs is large. Therefore, we propose a low complexity pilot scheduling algorithm.

To mitigate pilot contamination in a multi-cell massive MIMO system, [33] proposed the GCPA scheme, in which a metric is defined to indicate the interference strength among CUs and a binary matrix is used to describe the connections of CUs. However, to obtain the binary matrix, a suboptimal threshold needs to be found by applying iterative grid search. In this paper, we define a continuous-valued metric to evaluate the potential interference strength between D2D pair and

 (36)

Denote as the set of D2D pairs which have been allocated pilots, then, we summarize the pilot scheduling algorithm in Algorithm 1.

The basic idea of the PSA algorithm is that the D2D pair experiencing larger pilot contamination possesses a higher priority for pilot allocation. The main steps in each iteration can be explained as follows. First, D2D pair experiencing the largest potential interference from other DUs is selected. Then, the pilot causing the least interference to is chosen. Finally, pilot is assigned to D2D pair , i.e., , and is updated by . The algorithm will be carried out for times until all D2D pairs are allocated with pilots.

### V-B Data Power Control

In this subsection, we aim to maximize the sum rate of all DUs while guaranteeing the QoS requirements of CUs. Since the exact expressions of and are unapproachable, we use their lower bounds (23) and (29) for replacement. Simulation results show that the gap between the ergodic achievable rate and its lower bound is marginal, verifying the feasibility of the approximation.

Denote the data transmit power vectors of CUs and DUs by and , respectively. Then, we arrive at the following problem

 maxqs,ps K∑k=1R(d,lb)k (37a) s.t. η(c,lb)n≥γn,∀n∈N, (37b) 0≤qs,n≤Qn,∀n∈N, (37c) 0≤p