# Spectrum and Energy Efficiency of Uplink Massive MIMO System with D2D Underlay
## 2 System Model  
We consider a massive MIMO system with a D2D link underlay as shown in Figure 1, which consists of a BS with \(N\) antennas, \(K\) CUEs, and one D2D link. Each CUE or D2D user is equipped with a single omnidirectional antenna. The CUEs transmit signal to the BS using the same time-frequency resource as the D2D link.  
Let \(\sqrt{\beta_{ck}}\mathbf{h}_{ck}\) denote the channel vector from the \(k\)-th CUE to the BS, where \(\beta_{ck}\) and \(\mathbf{h}_{ck}\sim\mathcal{CN}(\mathbf{0},\mathbf{I})\) represent the large-scale fading (path-loss) and the small-scale fading, respectively. Similarly,  
Figure 1: System Model.  
denotes the channel vector from the D2D transmitter to the BS. \(\sqrt{\alpha_{ck}}g_{ck}\) and \(\sqrt{\alpha_{d}}g_{d}\) represent the channel fading from the \(k\)-th CUE and the D2D transmitter to the D2D receiver, respectively.  
Similarly to [3], the channel vectors from the CUEs to the BS are assumed to be available at the BS, and the maximum ratio combining (MRC) technique is adopted for the data reception. The detected signal of the \(k\)-th CUE after the linear processing can be given as  
\[r_{ck}=\sqrt{P_{c}\beta_{ck}}\mathbf{h}_{ck}^{H}\mathbf{h}_{ck}s_{ck}+\sum_{j \
eq k}^{K}\sqrt{P_{c}\beta_{cj}}\mathbf{h}_{ck}^{H}\mathbf{h}_{cj}s_{cj}+\sqrt {P_{d}\beta_{d}}\mathbf{h}_{ck}^{H}\mathbf{h}_{d}s_{d}+\mathbf{h}_{ck}^{H} \mathbf{n}, \tag{1}\]  
where \(P_{c}\) and \(P_{d}\) represent the transmit powers of the CUEs and the D2D transmitter, respectively. \(\mathbf{n}\sim\mathcal{CN}(0,\sigma^{2}\mathbf{I})\) is an additive white Gaussian noise (AGWN) vector at the BS. In addition, \(s_{d}\) and \(s_{ck}\) denote respectively the normalized signal sent by the D2D transmitter and the \(k\)-th CUE, i.e., \(\mathbb{E}\left[\left|s_{d}\right|^{2}\right]=\mathbb{E}\left[\left|s_{ck} \right|^{2}\right]=1\). The SINR at the \(k\)-th CUE is denoted as \(\gamma_{ck}\) and given as  
\[\gamma_{ck}=\frac{S_{ck}}{I_{ck}+\sigma^{2}}, \tag{2}\]  
where \(I_{ck}=P_{d}\beta_{d}\left|\frac{\mathbf{h}_{ck}^{H}}{\left\|\mathbf{h}_{ck} \right\|}\mathbf{h}_{d}\right|^{2}+\sum_{j\
eq k}^{K}P_{c}\beta_{cj}\left| \frac{\mathbf{h}_{ck}^{H}}{\left\|\mathbf{h}_{ck}\right\|}\mathbf{h}_{cj} \right|^{2}\) and \(S_{ck}=P_{c}\beta_{ck}\left\|\mathbf{h}_{ck}\right\|^{2}\). The average achievable rate of the \(k\)-th CUE is  
\[\mathcal{R}_{ck}=\mathbb{E}\left[\log_{2}(1+\gamma_{ck})\right]. \tag{3}\]  
The received signal at the D2D receiver can be given as  
\[y_{d}=\sqrt{P_{\text{d}}\alpha_{d}}g_{d}s_{d}+\sum_{k=1}^{K}\sqrt{P_{c}\alpha _{ck}}g_{ck}s_{ck}+n_{d}, \tag{4}\]  
where \(n_{d}\sim\mathcal{CN}\left(0,\sigma_{d}^{2}\right)\) is the AGWN at the D2D receiver. The SINR at the D2D receiver is  
\[\gamma_{d}=\frac{S_{d}}{I_{d}+\sigma_{d}^{2}}, \tag{5}\]  
where \(S_{d}=P_{\text{d}}\alpha_{d}\left|g_{d}\right|^{2}\) and \(I_{d}=\sum_{k=1}^{K}P_{\text{c}}\alpha_{ck}\left|g_{ck}\right|^{2}\). The average achievable rate of the D2D link is  
\[\mathcal{R}_{d}=\mathbb{E}\left[\log_{2}(1+\gamma_{d})\right]. \tag{6}\]  
The energy consumption of the massive MIMO system in a normalized time block is  
\[E=KP_{c}+(N+K)P_{\text{cir}}+P_{0}. \tag{7}\]  
where \(P_{\text{cir}}\) and \(P_{0}\) represent the circuit power consumption per RF chain and the basic power consumption of the system, respectively. The EE of the massive MIMO system defined as the ratio between the sum-rate and the energy consumption is given as  
\[\Xi=\frac{\sum_{k=1}^{K}\mathcal{R}_{ck}}{E}. \tag{8}\]