Web Simulation 

 

 

 

 

5G NR PRACH Waveform Lab 

This interactive tutorial simulates the 5G NR Physical Random Access Channel (PRACH) baseband signal generation as defined in 3GPP TS 38.211 Section 5.3.2. It visualizes how Zadoff-Chu (ZC) sequences are mapped to subcarriers and transformed into a time-continuous OFDM-like waveform with a Cyclic Prefix (CP).

The tutorial features a dark-themed engineering dashboard with parameter controls on the left and synchronized visualizations on the right. The Time Domain plot shows the real and imaginary parts of the PRACH signal s(t), with regions for gNB Rx window, CP, ZC symbol(s), and guard period; a dashed line marks the CP/symbol boundary. The UL Resource Grid heatmap shows PRACH placement in time and frequency (20 MHz × preamble duration). The gNB Correlation Output plot shows preamble detection |R(τ)| with optional Doppler ghost peaks; a collision warning and Fix button appear when a ghost lands on another preamble index.

You can select a Preamble Format (0, 1, 2, 3 for long; A1–C2 for short) to apply 3GPP LRA, ΔfRA, NCP, and μ, or use Custom and set LRA and ΔfRA manually. For LRA=839, the Root Sequence Index (i) maps to physical root u via the 3GPP table; for short formats you set Root Index (u) directly. Other controls include NCS, v, Restricted (High-Speed) set, UE Distance (km) for RTD and TA warning, AWGN SNR, and frequency/grid parameters (BWP start, msg1-FrequencyStart, nRA, k̄). The debug panel shows K, k0, k1, NRA_RB, BW, TCP, Tu, and Cv.

NOTE : The root index u should be coprime with LRA for proper ZC properties. For LRA=839, use the Root Sequence Index (i) which selects a valid u from the 3GPP mapping table.

3GPP TS 38.211 Time-Continuous Signal

The PRACH baseband signal s(t) is defined as:

s(t) = βPRACH Σk=0LRA−1 ak · ej2π(k + K·k1 + k̄)ΔfRA(t − TCP)

where:

  • ak: Zadoff-Chu sequence symbols, ak = e−jπu·k(k+1)/LRA
  • K: Ratio of PUSCH subcarrier spacing (15·2μ kHz) to PRACH subcarrier spacing ΔfRA
  • k1: Frequency resource mapping offset (BWP and PRACH resource index)
  • TCP: Cyclic prefix duration = NCP · Tc
  • Tu: Useful symbol duration = 1/ΔfRA

Zadoff-Chu Sequences: ZC sequences have constant amplitude in both time and frequency domains, making them ideal for PRACH. Different UEs can use different root indices u or cyclic shifts of the same root, allowing the gNB to distinguish random access attempts via correlation.

Cyclic Prefix: The CP is a copy of the tail of the useful symbol prepended to the beginning. It provides protection against multipath interference and ensures phase continuity at the symbol boundary. The dashed line in the Time Domain plot marks where the CP ends and the main symbol begins.

 

Usage Example

Follow these steps to explore the 5G PRACH waveform:

  1. Initial State: On load you see the sidebar (NR PRACH parameters) and three charts: Time Domain (Real/Imag s(t) with CP/ZC/GP regions), UL Resource Grid heatmap, and gNB Correlation Output. The debug bar shows the k1 formula and K, k0, k1, NRA_RB, BW, TCP, Tu, Cv.
  2. Preamble Format: Choose a format (e.g. 0, A1, C2) to auto-fill LRA, ΔfRA, NCP, μ from 3GPP tables. Use Custom to edit LRA and ΔfRA manually.
  3. Root Sequence Index (i) / Root Index (u): For LRA=839 the slider is logical index i (mapped to physical u); for short formats it is u directly. Changing it alters the ZC sequence and the correlation peak; use Fix if a collision warning appears.
  4. Enable Repetition: Check to show multiple preamble repetitions in time (per format κ). The time plot and resource grid update accordingly.
  5. NCS, v, Restricted set: Adjust preamble indexing and optional High-Speed (Restricted) logic. Cv and restricted-set params (du, nshift, etc.) are shown in the sidebar.
  6. UE Distance & SNR: Set distance (km) to see RTD and the TA warning when distance exceeds CP protection. Set AWGN SNR to see the correlation plot under noise.
  7. Debug Panel: Use the bottom bar (k1 formula, K, TCP, Tu, etc.) to verify 3GPP values.

Tip: For LRA=839 use Root Sequence Index (i); the sim maps i to u via the 3GPP table. If the collision warning appears, click Fix to pick a root with a safe du buffer.

Parameters

Followings are short descriptions on each parameter
  • Preamble Format: 3GPP format (0, 1, 2, 3 for long; A1, A2, A3, B1, B4, C0, C2 for short) or Custom. Selecting a format sets LRA, ΔfRA, NCP, μ from TS 38.211 tables.
  • Sequence Length (LRA): 839 (Long), 139 (Short), 571 or 1151 (FR2-2). Available when Format is Custom. Determines the number of ZC subcarriers.
  • Root Sequence Index (i) / Root Index (u): For LRA=839, i is the logical index (0–837) mapped to physical u per 3GPP; for short formats the control is u directly. Should be coprime with LRA.
  • Frequency Range (FR1/FR2), Subcarrier Spacing (ΔfRA): FR and ΔfRA (1.25, 5, 15, 30 kHz). ΔfRA affects Tu = 1/ΔfRA and K. Editable when Format is Custom.
  • Numerology (μ): PUSCH numerology. K = 15·2μ / ΔfRA.
  • BWP Start (NBWP,istart), msg1-FrequencyStart, PRACH Resource Index (nRA): Contribute to the k1 frequency offset and resource grid placement.
  • Cyclic Prefix (NCP), Frequency offset (k̄): NCP in Tc units (TCP = NCP · Tc); k̄ is the additional subcarrier offset in the 3GPP formula.
  • NCS, v: Zero-correlation zone config and cyclic shift index. Cv is displayed. Restricted (High-Speed) uses restricted set Type A (du, nshift, etc.); optional manual du override.
  • UE Distance (km): Used to compute round-trip delay (RTD). A TA warning appears if distance exceeds CP protection.
  • AWGN SNR (dB): SNR for the correlation plot; the received preamble is simulated with additive noise at this level.

Controls and Visualizations

Followings are short descriptions on each control
  • Time Domain Chart: Real s(t) and Imag s(t) vs time (μs) with regions for gNB Rx window, CP, ZC symbol(s), and guard period. A dashed line marks the CP/symbol boundary. Includes an I/Q step inset for the first two ZC samples.
  • UL Resource Grid: Heatmap of PRACH placement in time and frequency (20 MHz × preamble window). Shows which subcarriers and symbols carry the PRACH.
  • gNB Correlation Output: |R(τ)| vs cyclic shift (delay τ) for preamble detection. Optional ghost peaks (Doppler) are marked; collision warning and Fix button appear when a ghost lands on another preamble index.
  • Math Debug Bar: k1 formula (symbolic → plugged → result), K, k0, k1, NRA_RB, BW (MHz), TCP (μs), Tu (μs), Cv. TA and collision messages appear above when applicable.

Key Concepts

  • Zadoff-Chu Sequences: Constant amplitude in time and frequency. Formula: ak = e−jπu·k(k+1)/LRA. For LRA=839, 3GPP maps logical Root Sequence Index i to physical u.
  • K Factor: K = (15·2μ) / ΔfRA. When PRACH SCS is 1.25 kHz and PUSCH uses 15 kHz, K=12. PRACH subcarriers are narrower than PUSCH.
  • Cyclic Prefix: Copy of the symbol tail prepended to combat multipath. TA warning appears when UE distance implies RTD > TCP.
  • k1 Offset: k1 = msg1-FrequencyStart·12 + nRA·NRA_RB·12 + k̄; maps PRACH into the common resource grid.
  • Restricted Set (Type A): For high mobility; uses du, nshift, dstart, etc. Ghost peaks at ±du can collide with other preambles; use Fix to choose a safe root.