Spread Spectrum, PN Sequences & Walsh Codes

Direct-sequence spread spectrum multiplies data by a faster chip sequence and recovers it by aligned correlation. This entry derives processing gain, works desired and interfering codes chip by chip, explains PN and OVSF correlation, and connects acquisition, multipath, RAKE combining, and near–far power control.

builds onDigital Modulation: ASK, FSK, PSK & QAMConvolution & Correlation

Direct-sequence spread spectrum (DSSS) multiplies each data symbol by a faster sequence of chips. The transmitter spends bandwidth so an aligned receiver can add the desired chips coherently while noise and some mismatched signals add less coherently. The useful quantity is not that the waveform “looks random”; it is the set of autocorrelation and cross-correlation values at the delays and frequency offsets the receiver will actually encounter.

Spreading is not channel coding. It does not by itself create redundant parity equations that correct an arbitrary error pattern. Nor is a PN sequence cryptographic secrecy: a public deterministic sequence can be predicted. Spreading can provide processing gain, code separation, ranging structure, spectral shaping, or resistance to certain interference, but only under a complete acquisition and power-control design.

Direct-sequence mechanism #

Represent one data symbol by b∈{−1,+1}b\in\{-1,+1\} and a length-NN chip code by cn∈{−1,+1}c_n\in\{-1,+1\}. The transmitted chips are

xn=bcn,n=0,…,N−1.x_n=b c_n,\qquad n=0,\ldots,N-1.

An aligned correlator multiplies by the same code and sums:

z=∑n=0N−1rncn.z=\sum_{n=0}^{N-1}r_n c_n.

For rn=bcn+wnr_n=bc_n+w_n,

z=b∑cn2+∑wncn=bN+w′,z=b\sum c_n^2+\sum w_nc_n=bN+w',

because cn2=1c_n^2=1. The desired amplitude grows as NN, while independent chip-noise variance grows as NN; output SNR therefore grows by NN relative to one chip. In decibels, the ideal processing gain is

Gp=10log⁡10N=10log⁡10RcRs,G_p=10\log_{10}N=10\log_{10}\frac{R_c}{R_s},

where RcR_c is chip rate and RsR_s symbol rate. This does not create energy: one data symbol already occupies NN chips, and comparisons must keep symbol energy, occupied bandwidth, and interference model consistent.

Worked despreading and interference #

Choose

c=[+1,−1,+1,+1],b=+1.c=[+1,-1,+1,+1],\qquad b=+1.

The transmitted and received noiseless chips are r=cr=c. Multiplying by cc produces [+1,+1,+1,+1][+1,+1,+1,+1], so z=4z=4 and the symbol is recovered.

Now choose an orthogonal code d=[+1,+1,−1,−1]d=[+1,+1,-1,-1]. Its zero-lag contribution at the same correlator is

⟨d,c⟩=1−1−1−1=−2,\langle d,c\rangle=1-1-1-1=-2,

so this particular pair is not orthogonal. A correct orthogonal choice is d=[+1,+1,+1,−1]d=[+1,+1,+1,-1], for which

⟨d,c⟩=1−1+1−1=0.\langle d,c\rangle=1-1+1-1=0.

This small calculation is worth doing explicitly: code names and equal lengths do not imply orthogonality.

Despreading by correlation and OVSF code allocation A four-chip desired symbol adds coherently after multiplication by its code while an orthogonal interferer cancels. An OVSF tree shows why choosing a code blocks its ancestors and descendants. Correlation creates gain only for the aligned code chip-by-chip despreading OVSF allocation constraint desired code creceived r = +cmultiply r·corthogonal dmultiply d·c +1−1+1+1 +1−1+1+1 +1+1+1+1 +1+1+1−1 +1−1+1−1 Σ = 4 → recover +1 Σ = 0 → cancels only while aligned [+][+ +][+ −][++ ++][++ −−][+− +−][+− −+] select [+ +] ⇒ its root and two children are unavailable Orthogonality is a zero-lag property; delay, multipath, or frequency offset destroys the exact cancellation.
The desired aligned code becomes four equal positive terms after despreading. An orthogonal code cancels only for the specified alignment. In an OVSF tree, selecting one code forbids its ancestors and descendants because those paths are not mutually orthogonal.

Correlation is the design currency #

For a periodic length-NN sequence, define cyclic autocorrelation

Rcc[ℓ]=∑n=0N−1cnc(n+ℓ) mod N.R_{cc}[\ell]=\sum_{n=0}^{N-1}c_n c_{(n+\ell)\bmod N}.

A useful acquisition sequence has a large, narrow peak at ℓ=0\ell=0 and controlled sidelobes elsewhere. Cross-correlation

Rcd[ℓ]=∑n=0N−1cnd(n+ℓ) mod NR_{cd}[\ell]=\sum_{n=0}^{N-1}c_n d_{(n+\ell)\bmod N}

measures how much one code leaks into another receiver at each relative delay. Code selection must therefore inspect the whole relevant correlation function, not only Rcd[0]R_{cd}[0].

Maximal-length sequences (m-sequences) come from a length-mm linear-feedback shift register using a primitive polynomial. Their period is N=2m−1N=2^m-1 for any nonzero initial state; the all-zero state is absorbing and must be excluded. In bipolar form, a full-period m-sequence has two-level periodic autocorrelation: NN at zero shift and −1-1 at every nonzero cyclic shift. That makes the correct phase prominent, though the sequence family is not automatically a good multi-user code set.

Gold and related sequence families trade the perfect two-level autocorrelation of one m-sequence for a larger set with bounded cross-correlation. The right family depends on whether the system needs ranging, identification, asynchronous access, or many simultaneous channels.

Walsh codes and OVSF trees #

Rows of a Hadamard matrix satisfy

wi⋅wj=0(i≠j).\mathbf w_i\cdot\mathbf w_j=0\quad(i\ne j).

They are attractive when a common transmitter aligns all code channels. Orthogonal variable spreading factor (OVSF) codes organize Walsh-like codes into a tree. Starting from C=[c0,…,cN−1]C=[c_0,\ldots,c_{N-1}], its children are

C0=[C,C],C1=[C,−C].C_0=[C,C],\qquad C_1=[C,-C].

Longer codes provide larger spreading factor and lower data rate at the same chip rate. But an allocated code blocks every ancestor and descendant: those sequences share structure and are not mutually orthogonal. Capacity is therefore not “the number of unused leaves”; it depends on which branches are occupied.

3GPP/ETSI TS 25.213 defines concrete OVSF generation and allocation rules for UTRA spreading. It also separates channelization codes, which maintain orthogonality among synchronized channels, from scrambling codes, which identify or separate cells/users and change correlation properties. Interchanging those roles breaks the receiver even if both sequences contain only ±1\pm1 chips.

Acquisition searches delay and frequency cells #

Before despreading gain exists, the receiver does not know code phase. It searches hypotheses over delay, and often Doppler/frequency:

Z(τ,f)=∑n=0N−1rncn−τ∗e−j2πfnTc.Z(\tau,f)=\sum_{n=0}^{N-1}r_n c^*_{n-\tau}e^{-j2\pi f nT_c}.

Coherent integration is powerful but sensitive to frequency error: phase rotation across the dwell prevents chips from adding in the same direction. Noncoherent accumulation combines magnitudes from shorter coherent dwells, tolerating uncertainty at some sensitivity cost.

The search threshold is a system-level decision. If one cell has false-alarm probability pp and MM approximately independent cells are tested,

PFA,total=1−(1−p)M≈Mp.P_{FA,total}=1-(1-p)^M\approx Mp.

A threshold that looks safe on one correlation trace can fail continuously over a million delay-frequency cells. Practical acquisition uses candidate ranking, confirmation dwells, known secondary structure, and a lock detector that compares peak dominance and persistence—not only absolute magnitude.

After coarse acquisition, an early-minus-late discriminator tracks fractional-chip phase around the correlation peak. Its loop must follow code Doppler and oscillator drift without chasing noise or multipath sidelobes.

Multipath creates useful replicas and self-interference #

With resolvable paths,

r(t)=∑ℓαℓx(t−τℓ)+w(t).r(t)=\sum_{\ell} \alpha_\ell x(t-\tau_\ell)+w(t).

A RAKE receiver assigns a correlator finger to selected delays and combines their symbol estimates. Maximum-ratio combining uses weights proportional to the conjugate path estimates, wℓ∝αℓ∗w_\ell\propto\alpha_\ell^*, so stronger reliable paths contribute more.

Paths closer than roughly a chip may not be separately resolvable and instead distort the correlation peak. Paths from other symbols or codes contribute multiple-access and self-interference. “More fingers” is not automatically better: a weak finger with a poor channel estimate can add more noise than signal, and each finger needs delay and phase tracking.

Near–far limits code separation #

Suppose an unwanted user has received power JJ times the desired user's power and its normalized cross-correlation magnitude at the active delay is ∣ρ∣|\rho|. Its post-correlator interference power scales roughly as J∣ρ∣2J|\rho|^2. A code with ∣ρ∣=0.1|\rho|=0.1 provides only 20 dB rejection in power; an interferer 30 dB stronger still emerges about 10 dB above the desired signal contribution before other processing.

This is the near–far problem. Uplink CDMA therefore needs tight power control, interference-aware scheduling, or multi-user detection. Downlink orthogonality is also damaged by multipath because delayed copies no longer share the same alignment.

Separate the four transformations #

Transformation Purpose Receiver operation Failure when misordered
channel coding correct statistically likely errors/erasures soft or hard decoder burst structure and LLR meaning no longer match code assumptions
interleaving spread bursts across codewords deinterleave decoder sees concentrated errors or wrong symbol order
spreading/channelization create processing gain or aligned code channels code correlation no gain until exact phase/rate is known
scrambling/randomization whiten spectrum or distinguish streams inverse sequence operation wrong state/code can look like noise despite correct timing

The on-air order and receiver inverse order are protocol facts. CCSDS, for example, specifies attached sync markers, coding, and randomization with precise boundaries and sequence resets; 3GPP specifies separate spreading and scrambling stages. A correlator peak alone does not prove the subsequent inverse transformations are aligned.

Verification checklist #

  • Generate the exact first chips from the specified polynomial, initial state, output tap, shift direction, bipolar mapping, and reset rule; compare them bit for bit.
  • Plot normalized autocorrelation and all relevant cross-correlations over the full delay region, not only at zero lag.
  • Sweep carrier offset and fractional-chip delay to measure coherent loss and acquisition-cell spacing.
  • Record best peak, second-best peak, threshold, dwell count, code phase, frequency cell, and lock persistence.
  • Test a strong asynchronous interferer and multipath delays on both sides of one-chip resolution.
  • For OVSF allocation, reject ancestor/descendant conflicts programmatically and test dynamic reallocations.
  • Verify the complete inversion order with one known frame before running random BER tests.

A spread-spectrum link is working only when it can acquire from the declared delay-frequency uncertainty, keep code phase through the declared dynamics, and meet error performance under the declared correlation and near–far conditions. A clean PN generator and a tall correlation peak are necessary evidence, not the whole proof.

Sources

  1. bookSystems for Transmission of Digital Informationpdfnotes
  2. docsUniversal Mobile Telecommunications System (UMTS): Spreading and Modulation (FDD), 3GPP TS 25.213 version 11.4.0
  3. docsTM Synchronization and Channel Coding, CCSDS 131.0-B-5pdfnotes
  4. docsMIT 6.441 Lecture 17: AWGN, Spreading and DS-CDMA

Searches titles, aliases, headings, summaries, and full text.↑↓ move ↵ open esc close