# A Multi-Node Detection Algorithm Based on Serial and Threshold in Intelligent Sensor Networks
## 5 S-T-Max-log-MPA Algorithm  
In order to reduce the complexity of the detection algorithm, the S-T-Max-log-MPA is proposed. Based on the Max-log-MPA algorithm [44], this proposed algorithm introduces the serial updating algorithm and threshold application. In the Max-log-MPA algorithm, the exponential algorithm is changed into the process of sum algorithm and maximum value. The sensor node information updating is integrated with the resource node information updating in the S-MPA algorithm, which reduces the complexity of information storage. In the T-MPA algorithm, a hard decision is used to effectively reduce the sensor node information that needs to be updated in each cycle [45]. The algorithm proposed here is based on the advantages of the above algorithms; it can effectively reduce the complexity of the detection algorithm while maintaining a good BER.  
The basic idea of this algorithm is as follows: the threshold is added based on the S-MPA algorithm, and the codeword reliability and sensor node stability are combined as the index to judge the codeword reliability of sensor nodes. Before the message updating, the stability of the sensor variable node is judged. If the log likelihood ratio (LLR) of the sensor variable node meets the threshold condition, the sensor variable node is decoded in advance and will not be updated in the later iteration.  
In the process of iterative updating, the necessary conditions for the stability of sensor variable nodes have been judged first, so it is considered that the codeword sent by the sensor node has been judged accurately in the process of message iteration. Decoding the information of the sensor node will not bring a big error to the SCMA system, and in this process, the multi-node detection algorithm of the system can effectively reduce complexity.  
Since the stability of sensor variable nodes in the iterative updating process is judged first in the S-T-Max-log-MPA algorithm, Equation (9) of the resource node updating process of the algorithm is modified as Equation (12):  
\[t_{\alpha\to u_{\rm t}}^{\rm t}(x_{\rm j})=2\times\frac{1}{\sqrt{2\pi}s}\times \max_{\
eg\varsigma}\{-\frac{1}{2s^{2}}||y_{\rm k}-\sum\limits_{v\in\ell_{k}} h_{v,v}x_{\rm k,v}||^{2}+\prod\limits_{m\in\ell_{k}/j}t_{\alpha\to u_{\rm t}}^{ \rm t}(x_{\rm j})+\prod\limits_{m\in\ell_{k}/j}t_{\alpha\to u_{\rm t}}^{-1}(x _{\rm j})\}. \tag{12}\]  
Then, the sensor nodes are judged by the LLR of each sensor node's coding bit, as shown in Equations (13) and (14):  
\[Q(x_{\rm j})=ap_{v}(x_{\rm j})\times\prod\limits_{m\in\ell_{k}/j}I_{\rm cm\to u _{\rm t}}(x_{\rm j}), \tag{13}\]  
\[LLR_{\rm j,x}=\log(\frac{\sum\limits_{m:b_{m,i}=0}^{\rm mb_{m,i}=0}Q(x_{\rm j})} {\sum\limits_{m:b_{m,i}=1}^{\rm mb_{m,i}=0}Q(x_{\rm j})}), \tag{14}\]  
where, \(ap_{v}(x_{\rm j})\) represents the prior probability of user j codeword, \(LLR_{\rm j,k}\) represents the log likelihood ratio, \(\sum\limits_{m:b_{m,i}=0}Q(x_{\rm j})\) represents the output probability of the decoded variable node, and \(\sum\limits_{m:b_{m,i}=1}Q(x_{\rm j})\) represents the output probability of the variable node to be decoded.