# Random Access for Underwater Acoustic Cellular Systems
## 3 RAP Design
### Proposed RAP
#### 3.2.1 Proposed RAP 1  
RAP 1 is generated using a prime-length \(ZC\) sequence with a root index \(u_{c}\) where the ID of a UE, \(c\), is mapped. RAP 1 of sequence length \(N_{ZC}\) is defined in the discrete-time domain as follows:  
\[x_{ZC}^{c}(n)=x_{u_{c}}(n)q(n),\;0<u_{c}<N_{ZC} \tag{3}\]  
The \(ZC\) sequence, \(x_{u}(n)\), with a root index \(u\) and rectangle function, \(q(n)\), are defined as:  
\[x_{u}(n)=e^{j\frac{m}{N_{ZC}}n(n+1)},\;q(n)=\left\{ \begin{array}{ll}1,&n=0,1, \cdots,N_{ZC}-1\\ 0,&\text{otherwise}\end{array} \right. \tag{4}\]  
Here, the length of \(ZC\) sequence is chosen as a prime number because it maximizes the number of root indices, thus achieving good correlation property. In order to analyze the properties of the proposed RAP in terms of time delay and Doppler shift, its AF is analyzed. The AF of RAP 1 with ID \(c\) is given in the discrete-time domain as follows:  
\[ \begin{array}{ll}A_{ZC}^{c}(n,\epsilon)&=\frac{1}{N_{ZC}}\sum\limits_{m=- \infty}^{\infty}x_{ZC}^{c}(m)\big{(}x_{ZC}^{c}(m-n)\big{)}^{*}e^{j\frac{2\pi t }{N_{ZC}}m}\\ &=\frac{1}{N_{ZC}}\sum\limits_{m=-\infty}^{\infty}x_{u_{c}}(m)x_{u_{c}}^{*}(m- n)q(m)q(m-n)e^{j\frac{2\pi t}{N_{ZC}}m}\\ &=\rho_{ZC}(n)e^{j\pi\frac{(m_{c}+\epsilon)N_{ZC}+\epsilon(n-1)}{N_{ZC}}} \begin{cases}1,&(nu_{c}+\epsilon)\text{mod}N_{ZC}=0\\ \frac{\sin\{c\rho_{ZC}(n)(nu_{c}+\epsilon)\}}{\sin\{c\frac{(nu_{c}+\epsilon)} {N_{ZC}}\}},&\text{otherwise}\end{cases}\end{array}  \tag{5}\]  
Figure 5: RAP detection process. where \(\varepsilon=f_{D}\tau\). Here, \(f_{D}\) and \(\tau\) denote the Doppler shift and duration of RAP, respectively. Furthermore, \(am{\rm{od}}b\) denotes the remainder of division and \(\rm{sinc}(x)\) denotes the normalized sinc function (=\(\sin(\pi x)/\pi x\)). Further, \(\rho_{ZC}(n)=1-|n|/N_{ZC}\). For \(|n|\geq N_{ZC}\), \(A_{ZC}^{c}(n,\varepsilon)=0\). As shown in (5), the magnitude at the origin (\(n_{0}=0\), \(\varepsilon=0\)) is one. For a small value of \(\varepsilon\) (compared with \(N_{ZC}\)), the magnitude of AF at the correct timing can be approximated as \(\left|A_{ZC}^{c}(0,\varepsilon)\right|\approx|\sin c(\varepsilon)|\), which is a sinc function of \(\varepsilon\). This result signifies that the magnitude at the correct timing decreases as the Doppler shift increases. It becomes zero when the value of \(f_{D}\tau\) is an integer number. Therefore, the magnitude of AF at the correct timing decreases significantly when the Doppler shift is large. The position of side peaks, which may contribute to the RAP detection with a large timing error, can also be predicted using (5). The position (\(n_{i}\)) of the \(i\)-th (\(i>0\)) significant side peak can be obtained as \(n_{i}u_{c}\approx\alpha_{i}N_{ZC}\) (\(-N_{ZC}<n_{i}<N_{ZC}\)), i.e., the side peak occurs at \(n_{i}\) when the product of \(n_{i}\) and \(u_{c}\) is given by an integer value close to the product of the sequence length and an arbitrary integer value \(\alpha_{i}\). The maximum value of side peak occurs when \((n_{i}u_{c}+\varepsilon){\rm{mod}}N_{ZC}=0\), with the value of \(\rho_{ZC}(n_{i})\) at \(n_{i}\). The term \((n_{i}u_{c}+\varepsilon){\rm{mod}}N_{ZC}\) becomes zero only when \(\varepsilon\) is a non-zero integer value. For example, if \(u_{c}=5\), side peaks occur at \(n_{1}=\pm 100\) and \(n_{2}=\pm 200\) because \(100\times 5=500\) and \(200\times 5=1000\) are the closest integer values to 499 and 998, respectively. The maximum values of side peak occur when the values of \(\varepsilon\) are equal to \(-1\) and \(-2\), because (\(500-1\))mod499 = 0 and (\(1000-2\))mod499 = 0, respectively. In this case, \(\rho_{ZC}(100)=0.8\) and \(\rho_{ZC}(200)=0.6\). Figure 6 shows the AF of RAP 1 with a root index of 5 as a function of time delay (Figure 6a) and Doppler shift (Figure 6b). As shown in Figure 6a, the magnitude of AF is 1 at the correct timing (\(n=0\)) and decreases in a sinc pattern as \(n\) increases or decreases, when the Doppler shift is 0 (circle).