## 3 Theoretical Analysis
### Integration of Polar Codes and Direct Network Coding in Relay-Assisted VLC Systems  
Figure 4 showcases a system model that integrates polar codes with PNC. While the encoding process for this scheme shares similarities with the previous model, the following are the notable distinctions:  
* During the same time slot, both A and B concurrently transmit their signals to the relay node;
* The relay node processes the superimposed signal using a distinct physical-layer mapping technique. It directly applies network coding to the combined signal, rather than treating the signals from nodes A and B as separate entities. Here are the steps:  
(1). The source nodes encode the original information \(u_{A}\) and \(u_{B}\) using polar encoders configured with the identical code rates, resulting in \(c_{A}\) and \(c_{B}\), respectively. These encoded signals are modulated to produce \(x_{A}\) and \(x_{B}\), which are transmitted simultaneously to the relay node. Upon passing through the VLC channel, the relay node receives a combined signal, represented as  
\[y_{R}=h(x_{A}+x_{B})+n_{R}, \tag{19}\]  
Figure 3: A model that integrates polar codes with direct network coding in a relay-assisted VLC. where \(h\) denotes the VLC channel's instantaneous gain, \(y_{R}\) is the received signal, and \(n_{R}\) is noise with a mean of zero and a variance of \(\sigma^{2}\);  
(2). The LLR of the combined signal \(y_{R}\) is computed to directly derive the network-coded result for \(u_{A}\) and \(u_{B}\). The mapping scheme at the relay node R is shown in Table 1, where \(P_{t}\) and \(P_{r}\) represent the transmitted light power and received light power. The relation between \(P_{t}\) and \(P_{r}\) is detailed in Equation (2). The XOR results of the two VLC signals can be obtained through the mapping scheme. In particular, the LLR of \(y_{R}\) is computed using the following formula:  
\[L\Big{(}y_{R}^{i}\Big{)}=L\Big{(}c_{A}^{i}\oplus c_{B}^{i}\Big{)}=\ln\frac{P \big{(}c_{A}^{i}\oplus c_{B}^{i}=0\mid y_{R}^{i}\big{)}}{P\big{(}c_{A}^{i} \oplus c_{B}^{i}=1\mid y_{R}^{i}\big{)}}, \tag{20}\]  
where \(i\) represents the index in the sequence. When \(c_{A}^{i}\oplus c_{B}^{i}=0\), two possible scenarios arise:  
\[c_{A}^{i}\oplus c_{B}^{i}=0\Rightarrow\left\{ \begin{array}{l}c_{A}^{i}=0,c_ {B}^{i}=0\Rightarrow x_{A}^{i}+x_{B}^{i}=0,\\ c_{A}^{i}=1,c_{B}^{i}=1\Rightarrow x_{A}^{i}+x_{B}^{i}=2.\end{array} \right. \tag{21}\]  
When \(c_{A}^{i}\oplus c_{B}^{i}=1\), different corresponding scenarios emerge:  
\[c_{A}^{i}\oplus c_{B}^{i}=1\Rightarrow\left\{ \begin{array}{l}c_{A}^{i}=0,c_ {B}^{i}=1\Rightarrow x_{A}^{i}+x_{B}^{i}=1,\\ c_{A}^{i}=1,c_{B}^{i}=0\Rightarrow x_{A}^{i}+x_{B}^{i}=1.\end{array} \right. \tag{22}\]  
The prior probability of each situation is  
\[P\Big{(}x_{A}^{i}+x_{B}^{i}=0\Big{)}=\frac{1}{4}, \tag{23}\]  
\[P\Big{(}x_{A}^{i}+x_{B}^{i}=1\Big{)}=\frac{1}{2}, \tag{24}\]  
\[P\Big{(}x_{A}^{i}+x_{B}^{i}=2\Big{)}=\frac{1}{4}. \tag{25}\] \begin{table}
\begin{tabular}{l c c c c} \hline \(c_{A}\) & \(c_{B}\) & \(x_{A}\) & \(x_{B}\) & \(y_{R}\) & \(c_{A}\oplus c_{B}\) \\ \hline
0 & 1 & 0 & 1(\(P_{t}\)) & 1 (\(P_{r}\)) & 1 \\
1 & 0 & 1(\(P_{t}\)) & 0 & 1 (\(P_{t}\)) & 1 \\
1 & 1 & 1(\(P_{t}\)) & 1(\(P_{t}\)) & 2(2\(P_{t}\)) & 0 \\ \hline \end{tabular}
\end{table} 
Table 1: The relay mapping rule. Figure 4: A model that integrates polar codes with physical-layer network coding in a relay-assisted VLC system. The posterior probability of each case is  
\[