# Differential Characteristics Based Iterative Multiuser Detection for Wireless Sensor Networks
## 3 Multiuser Detection Based on Differential Characteristics
### Preliminary Threshold Detection  
As is described in the above Section 3.1, it is feasible to distinguish the wrongly received bits by threshold detection. Set two statuses \(H_{0}\) and \(H_{1}\), \(H_{0}\) represents the status where candidate bit \(b_{k}\) is correct, and \(H_{1}\) represents the status where candidate bit \(b_{k}\) is wrong. Let \(Z_{k}=\left|\,L(b_{k})\,\right|\), according to \(\rho_{ik}\gg\rho_{ik},\ i\
eq k\), we can see that the probability density functions of \(Z_{k}\) in \(H_{0}\) and \(H_{1}\) are given as follows:  
\[H_{0}:f_{Z_{k}}(y)=\begin{cases}0&y\leq 0\\ \dfrac{2}{A\sqrt{\pi N_{0}}}\exp[-\dfrac{y^{2}}{A^{2}N_{0}}]&y>0\end{cases} \tag{18}\]  
\[H_{1}:f_{Z_{k}}(y)=\begin{cases}0&y\leq 0\\ \dfrac{1}{A\sqrt{\pi N_{0}}}\Bigg{\{}\exp[-\dfrac{(y-2A^{2})^{2}}{A^{2}N_{0}}] +\exp[-\dfrac{(y+2A^{2})^{2}}{A^{2}N_{0}}]\Bigg{\}}&y>0\end{cases} \tag{19}\]  
The curves of the probability density functions in the two status are depicted in Figure 3. The red dashed line shows the optimal threshold.  
Set \(a\) as the judgment threshold. If \(Z_{k}>a\), verdict \(b_{k}\) is the wrong bit; or else, verdict \(b_{k}\) is the correct bit. The probability of detection is given as  
\[P(Z_{k}>a|H_{1})=\frac{1}{2}[erfc(\frac{a-2A^{2}}{A\sqrt{N_{0}}})+erfc(\frac{ a+2A^{2}}{A\sqrt{N_{0}}})] \tag{20}\]  
Figure 2: The value of differential characteristics function \(\left|\,L(b_{k})\,\right|\).  
The probability of false alarm is given as  
\[P(Z_{k}>a|H_{0})=erfc(\frac{a}{A\sqrt{N_{0}}}) \tag{21}\]  
Set \(P_{e}\) as the average BER of candidate bits, according to Equations (19) and (20), the BER after threshold detection equals:  
\[P_{e,out}(a)=\frac{1}{2}P_{e}[erfc(\frac{2A^{2}-a}{A\sqrt{N_{0}}})+erfc(\frac{2 A^{2}+a}{A\sqrt{N_{0}}})]+(1-P_{e})erfc(\frac{a}{A\sqrt{N_{0}}}) \tag{22}\]  
Therefore we can adjust the value of the threshold to minimize the value of \(P_{e,out}\), the value of \(a\), which corresponds to the minimum, is called the optimal threshold. However, the optimal threshold is relevant to many factors, including SNR and the BER of the candidate bit set. Hence, it's difficult to set an accurate threshold to obtain the best judgment in different situations.  
Therefore, a suboptimal threshold is selected to get the preliminary wrong bit recognition. From (19) we can see that when \(y>0\), the second term of \(f_{z_{k}}(y)\) is approximately equal to zero, especially at high SNR, i.e., noise power spectral density \(N_{0}\) is small compared to \(A\), so the second term of \(f_{z_{k}}(y)\) can be ignored. For this approximation, according to (18) and (19) the solution of the following equation can be regarded as the best threshold:  
\[\frac{2}{A\sqrt{\pi N_{0}}}\exp\left(-\frac{y^{2}}{A^{2}N_{0}}\right)=\frac{1 }{A\sqrt{\pi N_{0}}}\exp\left(-\frac{\left(y-2A^{2}\right)^{2}}{A^{2}N_{0}} \right),\quad y>0 \tag{23}\]  
Solving this equation we can get:  
\[\hat{y}=A^{2}+\frac{\ln(2)}{2}N_{0}\approx A^{2}+0.3466N_{0} \tag{24}\]  
From the above discussion, the calculation of threshold described in (24) needs accurate estimation of noise power spectral density \(N_{0}\). Because \(A^{2}\) is larger than \(N_{0}\) in actual communication system when SNR \(>0\) (in dB), thus the second term in (24) can be ignored. In this paper we take \(A_{i}^{2}\) as the detection threshold of the \(i\)th received bit. Furthermore, lower threshold results in higher detection probability, at the cost of higher false alarm probability. Then the next stage, error bit correction, will be utilized to reduce the false alarm probability.  
Figure 3: The probability density functions of two statuses.