Field Guide · algorithm

Also known as: access code correlator, sync-word correlation, sliding correlator

Access-code correlation is a sliding cross-correlation that searches a symbol stream for a known sync word (the “access code”) and flags every position where the match strength crosses a threshold.1 It is the standard way a receiver answers the question “where does a frame start?” — the detection step that anchors deframing and frame synchronization.

stream: + - - + … [+ - - + - +] … - + pattern: [+ - - + - +] slide → peak = frame start corr
The known access code is slid along the stream; the correlation spikes at the offset where it aligns.

How it works

Let the access code be a length-N pattern p[0..N−1] of expected symbol values (for a binary sync word, ±1). The correlator holds the most recent N incoming symbols and, at every new symbol, computes the inner product with the pattern:

corr = Σ_{k=0}^{N-1} s[n-N+1+k] · p[k]

When the incoming symbols match the pattern, every product is positive and corr is large; when they don’t, the products scatter and cancel toward zero. A detection is declared wherever corr exceeds a threshold. Because the sum is recomputed as a sliding window, the cost is N multiply-adds per input symbol — the same arithmetic as a matched filter whose impulse response is the reversed access code, which is exactly what this is: the matched filter for the sync word.

Variants

  • Hard vs soft symbols. Correlating hard-decided ±1 symbols is cheapest; correlating the demodulator’s soft values preserves confidence information and detects the code a couple of dB deeper into the noise.
  • Normalised correlation. Dividing by the running signal energy makes the threshold independent of amplitude/AGC state, so one fixed threshold works across signal levels.
  • Error-tolerant matching. For binary codes, thresholding on the number of matching bits (Hamming distance) lets the detector accept a sync word with a few flipped bits — essential at low SNR.
  • Differential correlation. When there is a residual carrier offset, correlating symbol-to-symbol transitions rather than absolute values removes the phase rotation.

Relevance to SDR

Access-code correlation is the front door of frame recovery in essentially every burst or framed protocol: GNU Radio’s correlate_access_code block, P25’s Frame Sync search, DMR’s SYNC detection, and preamble detectors for ADS-B and AIS all reduce to this operation. Sync words are chosen — often Barker codes — precisely so their autocorrelation has one sharp peak and low sidelobes, which is what makes the threshold decision reliable.

GopherTrunk implements it directly. internal/dsp/sync provides a Correlator that keeps a ring buffer of soft symbols and slides an inner product against a stored pattern, appending the stream indices where the correlation clears a threshold; internal/dsp/stats adds a normalised full cross-correlation used offline. Every GT protocol that locks a frame — P25, DMR, NXDN, TETRA, D-STAR, YSF — leans on this sync-word search before deframing can extract a payload.

Sources

  1. Cross-correlation — Wikipedia, on the sliding inner product that measures alignment between a pattern and a signal. 

See also