# A Joint Detection and Decoding Scheme for PC-SCMA System Based on Pruning Iteration
## 3 Proposed Algorithm for Joint Detection and Decoding
### Joint Detection and Decoding Scheme Based on Pruning Iteration PI-JDD
#### 3.1.1 RNs Update  
The message updating from RN \(k\) to user node \(j\) in the \(t\)-th iteration can be calculated as:  
\[\begin{split} P_{r_{k}\to u_{j}}^{t}\Big{(}x_{j}^{t}\Big{)}=\max_{ \sim x_{j}}&\left\{-\frac{1}{2\sigma^{2}}\|y_{k}^{t}-\sum_{ \varepsilon\varepsilon_{k}}h_{k\gamma}^{t}x_{k\gamma}^{t}\|+\left(\left[P^{t- 1}\Big{(}x_{i}^{t}\Big{)}\right]^{new}-P_{r_{k}\to u_{i}}^{t-1}\Big{(}x_{i}^{ t}\Big{)}\right)\right.\\ &\left.+\sum_{o\in\varepsilon_{k}/\{i,j\}}\left(\left[P^{t-1} \Big{(}x_{o}^{t}\Big{)}\right]^{old}-P_{r_{k}\to u_{o}}^{t-1}\Big{(}x_{o}^{t} \Big{)}\right)\right\}\end{split} \tag{4}\]  
where \(\varepsilon_{k}\) denotes the users occupied on the \(k\)-th RN, and adopts the factor matrix \(F^{t-1}\) which is updated after the \((t-1)\)-th iteration, \(i\
eq j\), \(i\varepsilon\varepsilon_{k}\),\(j\varepsilon\varepsilon_{k}\). \([]^{old}\) and \([]^{new}\) represent the messages before and after the RN updates the message, respectively.  
Figure 3: Message passing process based on pruning iteration.  
Figure 2: Message passing process of S-JIDD.  
The message confidence stability from resource \(k\) to user \(j\) in the \(t\)-th iteration is defined as \(S_{r_{k}\to u_{j}}^{t}\):  
\[S_{r_{k}\to u_{j}}^{t}=\frac{1}{\sum_{x_{j}\in\chi_{j}}\left|P_{r_{k}\to u_{j}}^{t }\left(x_{j}\right)-P_{r_{k}\to u_{j}}^{t-1}\left(x_{j}\right)\right|} \tag{5}\]  
The branch with the largest \(S_{r_{k}\to u_{j}}^{t}\) is the branch closest to convergence, which indicates that this branch did not generate effective update messages during this iteration and was removed from the factor graph in the next iteration, as shown the dashed line in Figure 3. For the first iteration, the original factor graph was used since the branch convergence rate could not be distinguishable.  
The output probability of each user's codeword can be expressed as:  
\[P_{e}^{S}\left(x_{j}^{I}\right)=\prod_{p\in\zeta_{j}}P_{r_{p}\to u_{j}}^{t_{ max}}\left(x_{j}^{I}\right) \tag{6}\]  
where \(\zeta_{j}\) represents the RNs occupied by user \(j\).  
According to the SCMA mapping relationship, the bit message of user \(j\) is denoted as:  
\[P_{e,SCMA}^{B}\left(b_{j,(l-1)Q+m}=0\right)=\sum\
olimits_{x_{j,0}^{l}\in \left[x_{j}^{I}\right]q_{j,m}=0\right]}P_{e}^{S}\left(x_{j,0}^{I}\right),\;1\; \leq\;\text{m}\;\leq\;\text{Q} \tag{7}\]  
\[P_{e,SCMA}^{B}\left(b_{j,(l-1)Q+m}=1\right)=\sum\
olimits_{x_{j,1}^{l}\in \left[x_{j}^{I}\right]q_{j,m}=1\right]}P_{e}^{S}\left(x_{j,1}^{I}\right),\;1\; \leq\;\text{m}\;\leq\;\text{Q} \tag{8}\]  
where \(\left\{x_{j}^{I}\right|q_{j,m}=0\right\}\) and \(\left\{x_{j}^{I}\right|q_{j,m}=1\right\}\) denote the codewords that satisfy the mapping function \(\left\{f_{i}:q_{j,1},\ldots,q_{j,m-1},0,q_{j,m+1},\ldots,q_{j,Q}\right\}\to x_{j }^{I}\) and \(\left\{f_{i}:q_{j,1},\ldots,q_{j,m-1},1,q_{j,m+1},\ldots,q_{j,Q}\right\}\), respectively.  
The log-likelihood ratios (LLR) of each bit message can be calculated as:  
\[L_{e,SCMA}^{B}\left(b_{j,(l-1)Q+m}\right)=log\frac{P_{e,SCMA}^{B}\left(b_{j,(l -1)Q+m}=0\right)}{P_{e,SCMA}^{B}\left(b_{j,(l-1)Q+m}=1\right)} \tag{9}\]  
Then, the LLR message of SCMA is de-interleaved and the LLR message of SCMA is de-interleaved and input to the SCAN decoder, denoted by:  
\[L_{a,polar}^{B}\left(c_{j}\right)=\prod\
olimits^{-1}\left(L_{e,SCMA}^{B} \left(b_{j}\right)\right) \tag{10}\]