# Mobile User Connectivity in Relay-Assisted Visible Light Communications
## 3 System Model
### Relay Assisted Models
#### 3.5.1 Analytical Performance of AF Relaying  
In the AF mode, the RN amplifies the received signal and forwards it to the Rx. Here we assume that the power of the signal retransmitted by the RN is scaled uniformly with respect to all bits in the packet with the average retransmission energy of \(E_{S}\). In the 1 st time slot/phase the sampled signals received at the RN (\(y_{R}(t)\)) and at the Rx (destination) (\(y_{D}(t)\)) are given by:  
\[y_{R}(t)=\sqrt{E_{s}}h_{SR}(t)\otimes s(t)+n_{R}(t) \tag{10}\]  
\[y_{D}(t)=\sqrt{E_{s}}h_{SD}(t)\otimes s(t)+n_{D}(t) \tag{11}\]  
where \(h_{SR}\) and \(h_{SD}\) denote the VLC impulse responses for the Tx-RN and the Tx-Rx links, respectively, and \(n_{R}\) and \(n_{D}\) are AWGN noises. During the 2 nd time slot/phase the signals at the output of the RN and received by the Rx are, respectively, given by [32]:  
\[x_{R}^{AF}(t)=\sqrt{\frac{E_{S}}{E_{S}h_{SR}^{2}(t)+\sigma_{total}^{2}}}h_{SR}( t)\otimes s(t)+\sqrt{\frac{1}{E_{S}h_{SR}^{2}(t)+\sigma_{total}^{2}}}n_{R}(t) \tag{12}\]  
\[y_{D}^{AF}(t)=\sqrt{E_{S}}h_{RD}(t)\otimes x_{R}^{AF}(t)+n_{D}^{{}^{\prime}}(t) \tag{13}\]  
where \(n_{D}^{{}^{\prime}}\) is the AWGN noise. Combining (12) and (13), the _sampled signal_ (from sampled signal we mean that the time varying signal is passed through a matched filter and it is sampled to maximize the signal-to-noise ratio, therefore, we drop the time index \(t\)) can be written as:  
\[y_{D}^{AF}=\sqrt{E_{s}}h_{RD}\sqrt{\frac{E_{S}h_{SR}^{2}}{E_{S}h_{SR}^{2}+\sigma _{total}^{2}}}s+\sqrt{E_{s}}h_{RD}\sqrt{\frac{1}{E_{S}h_{SR}^{2}+\sigma_{total}^ {2}}}n_{R}+n_{D}^{{}^{\prime}} \tag{14}\]  
From Equation (14) it is clear that \(y_{D}^{AF}\sim\mathcal{N}\left(\mu_{1},\sigma_{1}^{2}\right)\) where  
\(\mu_{1}=\sqrt{E_{s}}h_{RD}\sqrt{\frac{E_{S}h_{SR}^{2}}{E_{S}h_{SR}^{2}+\sigma_{ total}^{2}}}s\) and \(\sigma_{1}^{2}=\left(\frac{E_{s}h_{RD}^{2}}{E_{S}h_{SR}^{2}+\sigma_{total}^{2} }+1\right)\sigma_{total}^{2}\)  
**Log-Likelihood Detector**  
At destination, the receiver has two copies of the transmitted signal. Employing the equal gain combining scheme at the Rx. The _sampled signal_ is given as:  
\[y_{D}^{{}^{\prime}}=y_{D}+y_{D}^{AF} \tag{15}\]  
It can be seen from (11) and (14) that the probability density function (PDF) of the sampled signal is given by:  
\[f(y_{D}^{{}^{\prime}})=\mathcal{N}(\mu_{2},\sigma_{2}^{2}) \tag{16}\]  
where \(\mu_{2}=\mu_{1}+\sqrt{E_{s}}h_{SD}s\) and \(\sigma_{2}^{2}=\sigma_{1}^{2}+\sigma_{total}^{2}\). The Rx will detect the transmitted bit from the received signal by using the log-likelihood ratio (LLR) detector, which can be written as:  
\[f(y_{D}^{{}^{\prime}}|s=1)\underset{0}{\gtrgtr}f(y_{D}^{{}^{\prime}}|s=0) \tag{17}\]  
Hence, for the AF cooperative scheme the LLR detector test gives:  
\[\frac{1}{\sqrt{2\pi\sigma_{2}^{2}}}e^{-\frac{(y_{D}^{{}^{\prime}}-y_{D}^{{}^{ \prime}})^{2}}{2\sigma_{2}^{2}}}\underset{0}{\gtrgtr}\frac{1}{\sqrt{2\pi \sigma_{2}^{2}}}e^{-\frac{(y_{D}^{{}^{\prime}})^{2}}{2\sigma_{2}^{2}}} \tag{18}\]  
where \(\mu_{2}^{{}^{\prime}}=\mu_{2}|_{s=1}\). From (18), we get the following threshold-based detector, which indicates that if the value of received sampled signal is greater than the threshold \(\kappa_{th}^{AF}\), then the transmitted symbol is estimated as 1, else it is 0:  
\[y_{D}^{{}^{\prime}}\underset{0}{\gtrgtr}\kappa_{th}^{AF} \tag{19}\]  
where  
\[y_{D}(t)=\sqrt{E_{s}}h_{SD}(t)\otimes s(t)+n_{D}(t) \tag{11}\]0  
**Bit Error Rate Calculation:**  
The overall bit error probability of the considered VLC system with OOK is given as:  
\[y_{D}(t)=\sqrt{E_{s}}h_{SD}(t)\otimes s(t)+n_{D}(t) \tag{11}\]1  
Equation (21) can be rewritten as:  
\[y_{D}(t)=\sqrt{E_{s}}h_{SD}(t)\otimes s(t)+n_{D}(t) \tag{11}\]2where \(Pr(\cdot)\) stands for the probability.