Signal in the dark 01 · The LFSR Forge 02 · The 43-Shift Wheel 03 · Into the SSB 04 · Correlation Race 05 · The Proof 06 · Mastery
Live signal · 3GPP TS 38.211 §7.4.2.2

One sequence wakes
every phone on Earth.

Before your phone knows anything — no cell ID, no timing, no frame structure — it hunts for 127 BPSK chips hidden in noise: the Primary Synchronization Signal. This is the story of how it's forged, hidden, and found.

127BPSK chips
x⁷+x⁴+1LFSR polynomial
3cyclic shifts
−1worst sidelobe
scroll to decode
PROLOGUE · WHY PSS EXISTS

Your phone is born deaf and blind

Power on a UE in a new city. It knows the synchronization raster — a list of frequencies where an SSB might live — and absolutely nothing else. No symbol timing. No frame number. No cell identity. The PSS is the only signal designed to be found by a receiver that knows nothing.

1 · Blind hunt

The UE sweeps GSCN raster points, and at each one slides a matched filter across raw samples — correlating against all 3 PSS replicas at every possible timing offset. Millions of hypotheses per second.

2 · One spike

When the right replica meets the right offset, the correlator erupts — a peak ~127× above the noise floor. In one instant the UE gains OFDM symbol timing, coarse frequency lock, and NID(2).

3 · The chain unlocks

PSS → SSS gives NID(1) → cell ID = 3·NID(1)+NID(2) → PBCH DM-RS gives the SSB beam index → MIB → SIB1 → RACH. Every attach in 5G begins with these 127 chips.

The entire PSS, in two lines — TS 38.211 §7.4.2.2dPSS(n) = 1 − 2·x(m) , m = (n + 43·NID(2)) mod 127 , 0 ≤ n < 127 x(i+7) = ( x(i+4) + x(i) ) mod 2 , seed x(6..0) = 1 1 1 0 1 1 0
CHAPTER 01 · GENERATION

The LFSR Forge — watch the sequence being born

Seven flip-flops, two taps, one XOR. The polynomial x⁷ + x⁴ + 1 is primitive — it walks through all 127 non-zero states before repeating, spraying out a maximum-length sequence. Press play and watch each bit get forged and riveted onto the 127-chip ring.

bit 0 / 127
m-sequence generator · x(i+7) = x(i+4) ⊕ x(i)CafeTele PHY Lab
register bit = 1register bit = 0feedback taps x(i), x(i+4)chip riveted to ring (m-bit → BPSK)
2⁷−1 = 127
states before repeat — maximal
64 / 63
ones / zeros — near-perfect balance
1−2x
bit → BPSK: 0→+1, 1→−1 (real!)
Why BPSK matters: the PSS is purely real-valued ±1. A matched filter against it needs only additions and sign flips — no complex multiplies. That's deliberate: this filter runs continuously on every 5G chip on the planet, even at 2% battery.
CHAPTER 02 · THREE IDENTITIES

The 43-Shift Wheel — one sequence, three faces

5G doesn't generate three different sequences. It forges one m-sequence and spins the starting point: shift 0, 43, or 86 chips. Since 127/3 ≈ 42.3, the three read-heads are maximally far apart on the wheel — and cyclic shifts of an m-sequence are almost orthogonal to each other.

shift = 43 × 0 = 0 chips
cyclic shift wheel · m = (n + 43·N₍ID₎²) mod 127outward = +1 · inward = −1
shift 0
N₍ID₎² = 0 → cells 0, 3, 6, 9…
shift 43
N₍ID₎² = 1 → cells 1, 4, 7, 10…
shift 86
N₍ID₎² = 2 → cells 2, 5, 8, 11…
Why exactly 43? Any shift would give a valid sequence — but 0/43/86 splits the 127-wheel into three nearly equal arcs. Cross-correlation between any two shifts of an m-sequence is exactly −1 at perfect alignment, and stays low even when timing slips — so the detector almost never confuses two cells from different N₍ID₎² groups.
CHAPTER 03 · PLACEMENT

Riding the SSB — 127 chips find their seats

The SS/PBCH Block is a 240-subcarrier × 4-symbol postage stamp beamed into the void. The PSS boards symbol 0, occupying subcarriers 56–182 — dead center, flanked by 8 and 9 silent guard tones so the matched filter sees a clean edge.

PSS · symbol 0 · SC 56–182
SS/PBCH block · 240 SC × 4 symbols
PSS (sym 0)PBCH (sym 1–3)SSS (sym 2, SC 56–182)PBCH DM-RSguard / unused
sym 0
PSS — first thing on air
sym 1·3
PBCH + DM-RS (MIB)
sym 2
SSS center + PBCH wings
8 + 9
guard tones around PSS
CHAPTER 04 · DETECTION

The Correlation Race — three hunters, one prey

This is what your phone actually does. A noisy capture scrolls in; three matched filters — one per N₂ hypothesis — slide across it sample by sample. Crank the noise down to −10 dB SNR, add carrier frequency offset, and watch the m-sequence still win. This is the moment of cell detection, live.

received samples → sliding correlators ×3idle — press Run
N₂=1 ✓
Cell detected
peak / runner-up ratio …
Field reality: a real UE correlates the time-domain waveform (the IFFT of these 127 chips) and uses split/partial correlation to survive large CFO before it has any frequency reference. The race you see here is the same algorithm, visualized at chip level.
CHAPTER 05 · WHY IT WORKS

The Proof Theater — 127 vs −1

Slide an m-sequence against itself: at zero lag the correlation is 127; at every other lag it collapses to exactly −1. Not "small" — exactly −1, by algebra. That 42 dB cliff between peak and sidelobe is the entire reason cell search works at −6 dB SNR. Cross-correlate two different PSS and the aligned lag is again −1 — the only peak left is the mother sequence showing through at the 43-chip family shift, which in the time domain maps to a frequency offset, never to a false timing lock.

peak 127 @ lag 0 · sidelobes −1
cyclic correlation across all 127 lags

Why NR ditched Zadoff-Chu

LTE's PSS was a Zadoff-Chu sequence — gorgeous autocorrelation, but with a fatal flaw: under carrier frequency offset, a ZC sequence looks like a time-shifted version of itself. A cheap oscillator could make the UE lock onto the wrong symbol timing. The m-sequence has no such time–frequency ambiguity: CFO just shaves the peak, it never moves it. NR also tripled the length (63 → 127 effective), buying ~3 dB extra detection gain for cell-edge and deep-indoor.

The two-line algebra

For an m-sequence s of length N=127, the cyclic product s(n)·s(n+τ) is itself the same m-sequence at another phase (shift-and-add property). Any m-sequence has 64 ones and 63 zeros, so the sum over a period is 63·(+1) + 64·(−1) = −1 for every τ ≠ 0, and trivially 127 at τ = 0. The "magic" is one line of finite-field algebra.

CHAPTER 06 · MASTERY

The numbers, the spec, the test

Engineer's reference card

PropertyValue
Sequence familymaximum-length (m-sequence)
Length127 chips
Generator polynomialx⁷ + x⁴ + 1 (primitive over GF(2))
Recurrencex(i+7) = (x(i+4) + x(i)) mod 2
Seed x(6…0)1 1 1 0 1 1 0
ModulationBPSK, d(n) = 1 − 2·x(m)
Cyclic shifts43·N₍ID₎² ∈ {0, 43, 86}
SSB positionsymbol 0, subcarriers 56–182
Cell ID contributionN₍ID₎ᶜᵉˡˡ = 3·N₍ID₎¹ + N₍ID₎²
SpecTS 38.211 §7.4.2.2 · TS 38.213 §4.1

Prove it — 6 questions 0 / 6

CafeTele
5G NR Physical Layer Lab · 104 lessons · 3GPP-verified