## 3 Considered Two-Way Relaying PNC Systems
### Proposed PNC Detection Algorithm  
Instead of symbol-by-symbol operations in the relay aiming at the generation of the signal broadcast by the relay, more sophisticated processing can be applied, which should result in better performance as compared with the previous scheme. Using the successive interference cancellation (SIC) algorithm recently proposed by the authors of this paper in [17], we can find the estimates \(\widetilde{X}_{1,k}\) and \(\widetilde{X}_{2,k}\) of both composite signals \(X_{1,k}\) and \(X_{2,k}\) and, moreover, find the log-likelihood ratios (LLRs) of each bit assigned to a particular constellation point of both symbols. The algorithm presented and analyzed in [17] is visualized in Figure 5, for readers' convenience.  
The scheme starts with the joint ML tentative detection block (A1). This block searches for the pair of symbols \(\overline{X}_{1,k}\) and \(\overline{X}_{2,k}\) using the following rule:  
\[\left(\overline{X}_{1,k},\overline{X}_{2,k}\right)=\arg\min_{X_{k,1},X_{2,k}} \left|Y_{k}-\hat{H}_{1,k}X_{1,k}-\hat{H}_{2,k}X_{2,k}\right|^{2}\qquad\text{ for }k=0,1,\ldots,N-1 \tag{8}\]  
Again, we assume that the signal arriving through channel \(H_{1,k}\) has higher power than the signal arriving through channel \(H_{2,k}\). Out of two symbol estimates, we select the tentative estimate of the weaker signal, \(\overline{X}_{2,k}\), to generate the final estimate of the stronger one, \(\widetilde{X}_{1,k}\) (see (A3) in Figure 5). The latter is subsequently used to generate the approximate values of LLR used at the input of the channel code decoder. The result of soft input decoding is the information block estimate \(\hat{\mathbf{a}}_{1}\) of terminal A. This block is re-encoded using the same channel code. Then, the modulated symbols \(\hat{X}_{1,k}\) are produced and subsequently used in interference cancelling, and the detection of weaker user symbol estimates \(\widetilde{X}_{2,k}\), for which LLR inputs to the channel code decoder of the code used by terminal B are derived. The channel code decoder generates the information block estimate \(\hat{\mathbf{a}}_{2}\) of terminal B. Then, the relay calculates a new information block which is the modulo-2 sum of both decoded blocks, i.e.,  
\[\mathbf{b}=\hat{\mathbf{a}}_{1}\oplus\hat{\mathbf{a}}_{2} \tag{9}\]and generates QPSK/QAM symbols to be broadcast to both terminals. In both terminals A and B, regular detection and decoding algorithms are applied, resulting in the information block estimate \(\hat{\mathbf{b}}\). Finally, the binary blocks transmitted by the remote end terminals are determined using Formulas (6) and (7).  
As we can see, the proposed PNC algorithm to be applied in the relay is more complicated when compared with the reference one, because both composite signals and binary sequences carried by them are extracted in the relay. In addition to two channel code encoders and decoders used in both end terminals, two channel code decoding processes take place in the relay. Therefore, we categorize our relay as the decode-and-forward one. We expect that the increase in computational effort will result in better performance as compared with the simple reference PNC algorithm. This will be proved by simulation.