## 4 Changing Laws of BER Performance
### BER of Long-Code System  
The BER expression of the long-code system under single-frequency interference can be expressed thus, following [21]:  
(1) \(\Delta f=0\)  
\[P\left(e\left\lvert\,_{\Delta\varphi}\right\rangle\,=Q\left[\sqrt{\frac{2E_{b}/N _{0}}{1+(E_{b}/N_{0})(1/P)\cos^{2}(\Delta\varphi)/N}}\,\right] \tag{18}\]  
(2) \(\Delta f\
eq 0\)  
\[P\left(e\left\lvert\,_{\Delta\varphi}\right\rangle\,=Q\left\{\sqrt{\frac{2E_{b }/N_{0}}{1+\frac{I}{P}\frac{E_{b}}{N_{0}}\sin^{2}(\Delta fT_{c})}{N}\left[1+ \frac{\cos(2\pi\Delta f/NT_{c}-2\Delta\varphi)}{N\sin(2\pi\Delta fT_{c})} \sin(2\pi\Delta fNT_{c})\right]}\,\right\} \tag{19}\]  
where N represents the spread spectrum ratio, and \(E_{b}\) is the energy per bit. Because the single-frequency interference phase \(\varphi\) is assumed to be a uniform random variable between 0 and 2\(\pi\), the phase deviation \(\Delta\varphi\) has the same distribution. The average probability of error is then calculated by integrating over \(\Delta\varphi\), so that  
\[P_{e}=\frac{1}{2\pi}\int_{0}^{2\pi}P\left(e\left\lvert\,_{\Delta\varphi} \right\rangle\,d\Delta\varphi\right. \tag{20}\]  
BER of Short-Code System Under Interference with a Frequency Offset of Zero, That Is, \(\Delta f=0\)  
When the spreading code is a short-period PN sequence, the ratio of the number of spreading codes \"1\" and \"0\" in one bit is not a random quantity but a definite value. According to the balance of m-sequences, there is always one more \"1\" than \"0\" in the sequence. The interference sequence after despreading becomes  
\[A_{j}(m)=\sqrt{2l}\cos(\Delta\varphi)\int_{t_{0}}^{t_{0}+T_{b}}c(t)dt=\sqrt{2l}T _{c}\cos(\Delta\varphi) \tag{21}\]  
The decision statistic of the mth data bit sent to the decision maker is  
\[A(m)=\pm\sqrt{2P}T_{b}+\sqrt{2l}T_{c}\cos(\Delta\varphi)+A_{N} \tag{22}\]  
The probability density function of \(A_{N}\) is given by  
\[f_{A_{N}}(\eta)=\frac{e^{-\eta^{2}/(2N_{0}T_{b})}}{\sqrt{2\pi N_{0}T_{b}}} \tag{23}\]  
In order to avoid confusion with n(t), n is used to represent the dummy variable of \(A_{N}\). When the transmitted data is '+1', the judgment error is \(A(m)<0\), and the probability of the event is expressed as follows:  
\[ \begin{split} P^{+}\Big{(}e|_{\triangle\varphi}\Big{)}& =\int_{-\infty}^{-[\sqrt{2P}T_{b}+\sqrt{2l}T_{c}\cos\left(\triangle \varphi\right)]}\frac{e^{-\eta^{2}/(2N_{0}T_{b})}}{\sqrt{2\pi N_{0}T_{b}}}d \eta\\ &\triangleq Q\Bigg{[}\sqrt{\frac{2E_{b}}{N_{0}}}\Bigg{(}1+ \frac{\cos\triangle\varphi}{N}\sqrt{\frac{l}{P}}\Bigg{)}\Bigg{]}\end{split}  \tag{24}\]  
Similarly, when the transmitted data is '\(-1\)', the system BER is  
\[P^{-}\Big{(}e|_{\triangle\varphi}\Big{)}\triangleq Q\Bigg{[}\sqrt{\frac{2E_{ b}}{N_{0}}}\Bigg{(}1-\frac{\cos\triangle\varphi}{N}\sqrt{\frac{l}{P}} \Bigg{)}\Bigg{]} \tag{25}\]  
Assuming that the transmitter sends information '+1' and '\(-1\)' with equal probability, the average BER of the system can be expressed as  
\[P\Big{(}e|_{\triangle\varphi}\Big{)}=\frac{1}{2}\Big{[}P^{+}\Big{(}e|_{ \triangle\varphi}\Big{)}+P^{-}\Big{(}e|_{\triangle\varphi}\Big{)}\Big{]} \tag{26}\]  
If the interference phase \(\varphi\) is randomly distributed on \([0,2\pi)\), in order to eliminate the relationship with the phase difference, the average probability of error is calculated by integrating over \(\Delta\varphi\); thus, the error probability can be determined as  
\[P_{e}=\frac{1}{2\pi}\int_{0}^{2\pi}\bigg{(}\frac{1}{2}Q^{+}+\frac{1}{2}Q^{-} \bigg{)}d\Delta\varphi \tag{27}\]  
where \(Q^{\pm}=Q\Big{(}\sqrt{\frac{2E_{b}}{N_{0}}}\pm\frac{\sqrt{2l}T_{c}\cos\Delta \varphi}{\sqrt{N_{0}T_{b}}}\Big{)}\). In addition, if the influence of thermal noise [Appendix A] is ignored, the system BER is 0.5 when \(\,|\sqrt{2l}T_{c}\cos(\Delta\varphi)|<\sqrt{2P}T_{b}\).