Zadoff-Chu preamble sequences
PRACH preambles are generated from Zadoff-Chu (ZC) sequences — complex exponential sequences with constant amplitude and ideal cyclic autocorrelation properties. They are ideal for timing estimation because their autocorrelation has a single sharp peak at zero lag and zero everywhere else.
x_u,v(n) = x_u((n + C_v) mod L_RA)
where x_u(n) = e^(−jπun(n+1)/L_RA) is a Zadoff-Chu sequence of length L_RA with root index u.
For preamble format 0 (our prach-ConfigIndex=16): L_RA = 839 (long preamble). Different root indices u and cyclic shifts C_v generate the 64 preambles assigned to this cell.
// ZC sequence length (format 0): L_RA = 839 // Root ZC sequence (root index u=22, for example): x_22(n) = e^(−jπ×22×n×(n+1)/839), n = 0, 1, ..., 838 // First 4 values (complex exponentials on unit circle): x_22(0) = e^(0) = 1.000 + 0.000j x_22(1) = e^(−jπ×44/839) = 0.993 − 0.163j x_22(2) = e^(−jπ×132/839) = 0.972 − 0.236j x_22(3) = e^(−jπ×264/839) = 0.897 − 0.442j // Preamble i (0..63): cyclic shift of root sequence x_u,i(n) = x_22((n + i×N_CS) mod 839) // N_CS = cyclic shift (from zeroCorrelationZoneConfig=13 → N_CS=38) // 839 / 38 = 22 preambles per root → need ceil(64/22) = 3 root sequences
Why ZC sequences are ideal for timing estimation
At the gNB receiver, the received preamble is correlated against all 64 locally generated preamble sequences. The correlation peak position tells the gNB exactly when the preamble arrived — from which the propagation delay (and hence Timing Advance) is computed.
The cyclic shift N_CS creates an interference-free zone between different preambles: even if two UEs at very different distances transmit the same root preamble, their correlation peaks appear at different offsets and do not overlap, as long as the timing difference is less than N_CS × T_s.
PRACH resource — where and when
The UE must transmit on the correct PRACH occasion — the time-frequency resource linked to SSB beam index 3. SIB1's RACH configuration defines these occasions.
// From SIB1 (rach-ConfigCommon): prach-ConfigIndex = 16 → preamble format 0, long preamble (839 seq) msg1-FrequencyStart = 4 → PRACH starts at RB 4 from BWP start msg1-FDM = 1 → 1 PRACH occasion in frequency ra-ResponseWindow = sl10 → UE waits up to 10 slots for Msg2 // PRACH occasion timing (from prach-ConfigIndex=16, TS 38.211 Table 6.3.3.2-3): Subframe index = 0 (first subframe of each frame where PRACH occurs) PRACH symbol = 0 // Frequency position: PRACH_start_RB = msg1-FrequencyStart = 4 PRACH_start_Hz = Point_A + 4 × 12 × 30 kHz = 3496.38 + 1.44 MHz = 3497.82 MHz // SSB-to-PRACH mapping (TS 38.213 §8.1): SSB index 3 → maps to PRACH occasion offset 3 × (PRACH_per_SSB) // The UE transmits on the PRACH occasion associated with SSB 3
Transmit power calculation
The UE does not transmit the preamble at maximum power — it uses open-loop power control to target the correct received power at the gNB. The formula uses the path loss estimated from the SSB RSRP measurement.
P_PRACH = min(P_CMAX, preambleReceivedTargetPower + PL)
// Path loss estimate (from SSB measurement): PL = P_SSB_tx − RSRP_measured = 43 dBm − (−85 dBm) = 128 dB // (P_SSB_tx = gNB EIRP, obtained from SIB1 or assumed) // Target received preamble power (from SIB1): preambleReceivedTargetPower = −110 dBm // Required transmit power: P_PRACH = preambleReceivedTargetPower + PL = −110 + 128 = +18 dBm // Capped at UE max power P_CMAX = 23 dBm: P_PRACH = min(23, 18) = 18 dBm ← well within UE capability
Power ramping — what if no response?
If the UE sends Msg1 and does not receive a response within the RAR window (10 slots), it retransmits the preamble with higher power. Each retry increases power by powerRampingStep = 4 dB from SIB1.
// Each failed attempt increases power by 4 dB: Attempt 1: P = 18 dBm (initial) Attempt 2: P = 22 dBm (+4 dB) Attempt 3: P = 23 dBm (+4 dB, capped at P_CMAX) Attempt 4: P = 23 dBm (capped) ... Attempt 7: P = 23 dBm (max — final attempt) // If no response after 7 attempts: → RACH failure reported to upper layers → Connection establishment failure → UE may try again after backoff timer