Web Simulation 

 

 

 

 

Signal Correlation Explorer 

This interactive tutorial visualizes correlation in wireless communications. Correlation is a “signal matching” tool: auto-correlation helps with synchronization (finding the start of a frame), and cross-correlation helps identify specific signals amidst noise or interference.

Mathematical Foundation

1. Discrete Cross-Correlation

For two discrete signals x[n] and y[n], the cross-correlation at lag m is:

Rxy[m] = ∑n x[n] · y[n+m]   (real)

Rxy[m] = ∑n x[n] · y*[n+m]   (complex, y* = conjugate)

When the template x aligns with the matching segment in y, the sum reaches a peak. The lag m at the peak gives the time delay (time-of-arrival). For complex sequences (e.g. Zadoff-Chu), |R| is displayed.

2. Example Sequences

The simulator supports diverse sequences: Barker 13/11 (DSSS), Zadoff-Chu (LTE/5G PRACH, complex-valued), Gold 31 (5G NR scrambling), PN-15 (IS-95 CDMA), Walsh-8 (orthogonal CDMA codes), NR PSS/SSS (5G cell search). The default Barker 13 code [1, 1, 1, 1, 1, −1, −1, 1, 1, −1, 1, −1, 1] has:

  • Low sidelobes: Auto-correlation has a sharp main lobe and small sidelobes (≤1).
  • Peak = 13: When perfectly aligned, the correlation equals the sequence length.
  • Wi-Fi / LTE use: Barker-like codes are used in DSSS and preamble detection.

3. Processing Gain

Even when the signal is buried in noise (negative SNR), the correlation peak persists because we integrate over N samples. Processing gain ≈ 10 log10(N) dB.

4. 5G NR PSS (Primary Synchronization Signal)

The NR PSS is a length-127 BPSK-modulated m-sequence (TS 38.211 §7.4.2.2.1). Three PSS sequences (NID(2) = 0, 1, 2) use cyclic shifts of the same m-sequence. The auto-correlation has a peak of 127 and very low sidelobes — ideal for cell search and symbol timing. Each PSS uniquely identifies one of the three NID(2) components of the physical cell ID.

5. 5G NR SSS (Secondary Synchronization Signal)

The NR SSS is the element-wise product of two cyclically shifted m-sequences x0 and x1 (TS 38.211 §7.4.2.3.1). The shifts m0 and m1 encode the 336 possible NID(1) values. Together with PSS, the SSS allows the UE to decode the full physical cell ID NIDcell = 3·NID(1) + NID(2) (0–1007). The cross-correlation between different PSS/SSS sequences is very low, enabling fast cell differentiation.

6. Multipath

In multipath channels, the received signal is the sum of the direct path plus reflected copies. The correlation plot shows a primary peak (direct) and smaller ghost peaks (reflections). Rake receivers combine these peaks to improve detection.

Controls
0.30 150
0 Sync:
1. Reference Signal
2. Received Signal (Reference + Noise + Delay)
3. Correlation Rxy(τ)

 

Usage

Use the simulation to explore signal correlation:

  1. Mode: Cross-Correlation shows the reference sliding over the noisy received signal. Auto-Correlation correlates the reference with itself (no noise).
  2. Example: Select from diverse sequences: Barker 13/11 (DSSS), Zadoff-Chu (LTE/5G PRACH, complex), Gold 31 (5G NR, various c_init), PN-15 (IS-95 CDMA), Walsh-8 rows 0–7 (orthogonal CDMA codes), Random BPSK, NR PSS NID2=0/1/2 (5G cell search, 127 chips), or NR SSS (5G physical cell ID, 127 chips).
  3. Noise: Increase the noise level. Even when the received signal looks like random static, the correlation peak remains detectable.
  4. Shift τ: Manually slide the template. The yellow overlay shows where the reference is positioned. When it aligns with the buried sequence, R(τ) peaks and the Sync indicator turns green.
  5. Find Sync: Click to jump the shift to the correlation peak (maximum |R(τ)|). Instantly aligns the template with the buried sequence.
  6. Multipath: Toggle to add reflected paths. The correlation plot shows a main peak plus smaller ghost peaks.
  7. Re-sample Noise: Draw a new noise realization.

Visual Guide

  • Reference (blue/cyan): The selected sequence (oversampled 10× per chip for short codes; 1 sample/chip for NR PSS/SSS). For complex sequences (Zadoff-Chu), real and imaginary parts are shown in separate canvases.
  • Received (red/cyan): Reference + Gaussian noise + delay. For complex sequences, real and imaginary parts are shown in separate canvases.
  • Yellow overlay: The template position at the current shift. When it overlaps the buried sequence, R(τ) spikes.
  • Correlation (green): Rxy(τ) vs. shift. The orange dot marks the current shift and its value.
  • Sync indicator: Green when the current R(τ) exceeds 80% of the maximum (lock detected).

Key Insights

  • Peak position = Time-of-Arrival: The lag at the correlation peak tells the receiver when the packet arrived (used in GPS, Wi-Fi timing). Use Find Sync to jump directly to the peak.
  • Processing gain: Crank up the noise until the signal is invisible. The peak still stands—this is why Barker codes work in noisy channels.
  • Multipath peaks: In real environments, reflections create secondary peaks. Rake receivers combine them to improve performance.
  • NR PSS cross-correlation: Try selecting PSS NID2=0 and PSS NID2=1 in auto-correlation mode to compare their auto-correlation profiles. Then use cross-correlation and notice how a PSS detector locks only on the matching cell ID.
  • NR SSS cell ID separation: SSS PCI=0 and PCI=500 have very different chip patterns. In cross-correlation mode the wrong SSS reference produces no detectable peak — this is how the UE eliminates neighbouring cells during cell search.