# Preamble Design and Collision Resolution in a Massive Access IoT System
## 3 Preamble Design
### Sub-Preamble Sequence Design
During the detection of the shared sub-preamble, two TA values can be captured by Equation (10) because of the same shared sub-preamble index. Please note that the gNB is unable to distinguish which TA value belongs to which device. However, during the detection of two dedicated sub-preambles, two TA values can be captured respectively. In detail, the TA values of the two shared sub-preambles \(\tau_{s}^{1}\) and \(\tau_{s}^{2}\) are captured on an identical detection zone, while the TA values of the two dedicated sub-preambles \(\tau_{d}^{1}\) and \(\tau_{d}^{2}\) are captured on two different detection zones. Hence, the gNB can identify a device by finding \(\tau_{s}^{1}=\tau_{d}^{1}\) or \(\tau_{s}^{2}=\tau_{d}^{2}\). The scheme of capturing multiple TA values is summarized as Algorithm 3. Based on Algorithm 3, the TA value of each shared sub-preamble can be obtained by the gNB. If shared sub-preamble collision occurs, the TA value can still be captured with the corresponding dedicated sub-preamble. Only when the shared sub-preamble collision and dedicated sub-preamble collision occur simultaneously, the TA value is unable to be captured. Please note that sub-preamble collision implies more than one devices send dedicated sub-preambles with the same sub-preamble index on the same time-frequency resource. Hence, the probability that shared sub-preamble collision and dedicated sub-preamble collision occur simultaneously is low. Figure 3: An example of capturing two TA values. ```
1: Received shared sub-preamble sequence \(y_{s}(n_{s})\); Received dedicated sub-preamble sequence \(y_{d}(n_{d})\); The sets of the local sub-preamble sequences \(S_{i}\);
2:
3:
4: Captured TA value for the \(k\)th device \(\tau^{k}\); The shared sub-preamble index for the \(k\)th device \(v_{s}^{k}\); The dedicated sub-preamble index for the \(k\)th device \(v_{d}^{k}\); The location index for the \(k\)th device \(\mu^{k}\);
5:for all\(c_{s}(n_{s})\in S_{s}\)do
6: Calculate \(d_{s}(\tau_{s})\) for the received shared sub-preamble \(y_{s}(n_{s})\) according to Equation (9);
7:if\(d_{s}(\tau_{s})\geq r_{th,s}\)then
8: Record the sub-preamble index \(v_{s}\) of \(c_{s}(n_{s})\) in Y\({}_{s}\);
9: Calculate \(\widehat{\tau}_{s}^{1}\),..., \(\widehat{\tau}_{s}^{g}\) according to Equation (10), and record them in \(\Gamma_{s}\);
10:endif
11:endfor
12:for all\(\mu\in\{1,2\}\)do
13:for all\(c_{d}(n_{d})\in S_{d}\)do
14: Calculate \(d_{d}(\tau_{d})\) for the received dedicated sub-preamble \(y_{d}(n_{d})\) according to Equation (9);
15:if\(d_{d}(\tau_{d})\geq r_{th,d}\)then
16: Record the sub-preamble index \(v_{d}\) of \(c_{d}(n_{d})\) in Y\({}_{d}\);
17: Calculate \(\widehat{\tau}_{d}^{1}\),..., \(\widehat{\tau}_{d}^{c}\) according to Equation (10), and record them in \(\Gamma_{d}\);
18:endif
19:endfor
20:endfor
21:for all\(\widehat{\tau}_{s}^{k}\in\Gamma_{s}\)do
22:for all\(\widehat{\tau}_{d}^{k}\in\Gamma_{d}\)do
23:if\(\widehat{\tau}_{s}^{k}=\widehat{\tau}_{d}^{k}\)then
24: Output \(\tau^{k}=\widehat{\tau}_{s}^{k}\) and the corresponding \(v_{s}^{k}\), \(v_{d}^{k}\) and \(\mu^{k}\);
25:endif
26:endfor
27:endfor
28:endfor
```

**Algorithm 3** Multiple TA value capturing scheme. ### Random Access Scheme

Based on the multiple TA value capturing scheme, the random access scheme for multiple devices is revised as follows. * Step-1: Sub-preambles selection and transmission. An IoT device randomly selects a shared sub-preamble and a dedicated sub-preamble from the available sub-preamble sets \(S_{s}\) and \(S_{d}\) respectively. Applying Algorithm 1, the device randomly selects a location index \(\mu\) to generate a preamble sequence and then transmits it to the gNB on an available PRACH slot. * Step-2: Random access response. When the gNB receives the preambles from multiple devices, applying Algorithm 2 to obtain the shared sub-preambles and dedicated sub-preambles respectively. Then, applying Algorithm 3, the gNB captures the TA value for each device and generates the corresponding RAR messages.