# Random Access for Underwater Acoustic Cellular Systems
## 4 RAP Detection
\begin{array}{l}F_{R[t;\mathrm{H}_{1}]}(\gamma)=\int\limits_{0}^{\gamma}f_{ R[t;\mathrm{H}_{1}]}(r)dr=1-Q_{1}\left(\frac{\sqrt{2\lambda[t;\mathrm{H}_{1}]}}{ \sigma[t;\mathrm{H}_{1}]},\frac{\sqrt{2\gamma}}{\sigma[t;\mathrm{H}_{1}]}\right) \\ F_{R[t;\mathrm{H}_{0}]}(\gamma)=\int\limits_{0}^{\gamma}f_{R[t;\mathrm{H}_{0}] }(n)dr=1-Q_{1}\left(\frac{\sqrt{2\lambda[t;\mathrm{H}_{0}]}}{\sigma[t;\mathrm{ H}_{0}]},\frac{\sqrt{2\gamma}}{\sigma[t;\mathrm{H}_{0}]}\right)\end{array}  \tag{30}\]  
where \(Q_{1}\)(_a,b_) denotes the first-order Marcum function with the arguments of \(a\) and \(b\). Since the symbol duration of RAP is usually smaller than the correlation window, the output signal in the early part of RAP detector follows the central chi square distribution. In this case, the Marcum function becomes an exponential function as follows [18]:  
\[F_{R[t;\mathrm{H}]}(\gamma)=1-\left\{ \begin{array}{ll}e^{-\frac{\gamma}{ \sigma^{2}[k]}},&\lambda[t;\mathrm{H}]=0\\ Q_{1}\left(\frac{\sqrt{2\lambda[t;\mathrm{H}]}}{\sigma[t;\mathrm{H}]},\frac{ \sqrt{2\gamma}}{\sigma[t;\mathrm{H}]}\right),&\lambda[t;\mathrm{H}]\
eq 0 \end{array} \right. \tag{31}\]  
From (22) and (27), we can obtain the non-centrality parameter as follows:  
\[ \begin{array}{l}\lambda^{c}[t;\mathrm{H}_{0}]=\left(\sum\limits_{i=0}^{C-1 }\mathrm{E}\left\{\mathrm{Re}\left\{R_{x}^{i,c}(t)\right\}\right\}\right)^{2} +\left(\sum\limits_{i=0}^{C-1}\mathrm{E}\left\{\mathrm{Im}\left\{R_{x}^{i,c}( t)\right\}\right\}\right)^{2}\\ \lambda^{c}[t;\mathrm{H}_{1}]=\left(\sum\limits_{i=0}^{C-1}\mathrm{E}\left\{ \mathrm{Re}\left\{R_{x}^{i,c}(t)\right\}\right\}\right)^{2}+\left(\sum\limits_ {i=0}^{C-1}\mathrm{E}\left\{\mathrm{Im}\left\{R_{x}^{i,c}(t)\right\}\right\} \right)^{2}\end{array}  \tag{32}\]  
where \(R_{x}^{1,c}(t)\) denotes a random variable after the cross-correlation between the RAP received from the _i_-th UE and the reference RAP transmitted from UE \(c\) at the instant \(t\). Here, \(\mathrm{Re}[\cdot]\) and \(\mathrm{Im}[\cdot]\) denote the real and imaginary parts, respectively. Subsequently, the detection probability and false alarm probability of the proposed RAPs (RAP 1 and RAP 2) are compared using the analytical and simulation results in a Doppler environment. Here, the window size, \(T_{W}\), is set to a value twice the symbol duration. The analytical result is obtained using (29) with parameters determined under the assumption of an additive white Gaussian noise (AWGN) channel. The signal-to-noise ratio (SNR) and duration of the RAP are set to \(-10\) dB and \(125\) ms, respectively. The Marcum function is evaluated numerically using MATLAB building functions. The sampling rate is set to the same value (4 kHz) as the bandwidth of UL 0. Figure 13 compares the receiver operating characteristic (ROC) curves of the proposed RAPs. For RAP 1, the first and second RAPs are generated using ZC sequences with root indices of 3 and 5 (i.e., \(u_{c}\) = 3, \(u_{d}\) = 5). For RAP 2, the first and second RAP are generated using LFM waveforms with the frequency sweeping parameters of 2 kHz and 2.11 kHz (\(\Delta\beta\) = \(\beta_{c}\) - \(\beta_{d}\) = 110 Hz), respectively. In RAP 2, the frequency shifting parameter is set to half of \(\beta_{c}\), i.e.,\(f_{c}\) = \(\beta_{c}\)/2 and \(f_{d}\) = \(\beta_{d}\)/2. Figure 13a,b show the ROC curves (detection probability versus false alarm probability) of RAP 1 and RAP 2, respectively. As shown in these figures, the simulation results are consistent with the analytical results in all the cases. Here, the first argument in the legend represents the number of UEs. The value '1' represents the case where there is no interfering UE. There is an interfering UE in the case of '2'. As shown in Figure 13a, performance degradation caused by the interfering UE is small, indicating that RAP 1 is robust against the interference. Notably, the maximum magnitude of CAF for a pair of root indices of 3 and 5 is small (5.5%), as shown in Figure 7a.