Loading learning content...
CDMA's ability to separate simultaneous transmissions on the same frequency rests on a profound mathematical concept: orthogonality. When we say two codes are orthogonal, we mean that when we multiply them together and sum the result, we get zero. This "zero cross-correlation" property is what allows a receiver to completely ignore all signals except the one intended for it.
Orthogonality is familiar from geometry—perpendicular vectors have zero dot product. But in CDMA, we extend this concept to sequences of numbers (codes), and the consequences are far-reaching. Understanding orthogonality deeply reveals why CDMA works, when it fails, and what design choices system architects must make.
This page explores orthogonality from first principles through advanced implications, giving you the mathematical intuition to understand CDMA's power and limitations.
By the end of this page, you will understand orthogonality mathematically and intuitively, master cross-correlation computation, comprehend why synchronization is critical for Walsh code orthogonality, learn about quasi-orthogonal codes for asynchronous systems, and appreciate the design trade-offs between code families.
Let's begin with the rigorous mathematical definition, then build intuition from there.
Discrete-Time Definition:
Two code sequences $c_1$ and $c_2$, each of length $N$, are orthogonal if:
$$\sum_{i=0}^{N-1} c_1[i] \cdot c_2[i] = 0$$
This sum is the inner product (or dot product) of the sequences. For CDMA codes using ${-1, +1}$ values, orthogonality means the codes have equal numbers of agreements and disagreements.
Continuous-Time Definition:
For continuous-time signals over period $T$:
$$\int_0^T c_1(t) \cdot c_2(t) , dt = 0$$
Normalized Cross-Correlation:
The cross-correlation $\rho_{12}$ is often normalized to the range $[-1, +1]$:
$$\rho_{12} = \frac{1}{N} \sum_{i=0}^{N-1} c_1[i] \cdot c_2[i]$$
For orthogonal codes: $\rho_{12} = 0$
For identical codes: $\rho_{11} = 1$ (autocorrelation at zero lag)
**Walsh codes (length 4):**
- W1 = [+1, -1, +1, -1]
- W2 = [+1, +1, -1, -1]**Computing inner product:**
$$\sum_{i=0}^{3} W1[i] \cdot W2[i]$$
$= (+1)(+1) + (-1)(+1) + (+1)(-1) + (-1)(-1)$
$= +1 - 1 - 1 + 1$
$= 0$ ✓
**Verification:** W1 and W2 agree on positions 0 and 3, disagree on positions 1 and 2.
Agreements: 2, Disagreements: 2
Since agreements = disagreements, inner product = 0.
**The codes are orthogonal.**For binary codes with values {-1, +1}, orthogonality requires exactly half the positions to match and half to differ. This is why orthogonal code sets always have lengths that are powers of 2 (for Walsh codes) or carefully designed lengths (for other families).
Understanding correlation functions is essential for analyzing CDMA code performance. Two types of correlation matter: cross-correlation (between different codes) and auto-correlation (a code with itself at different time shifts).
Cross-Correlation Function:
The cross-correlation of codes $c_1$ and $c_2$ as a function of time shift $\tau$ is:
$$R_{12}(\tau) = \sum_{i=0}^{N-1} c_1[i] \cdot c_2[(i + \tau) \mod N]$$
For CDMA, we want $R_{12}(0) = 0$ (orthogonality at zero lag), but what about other shifts?
Perfect vs. Practical Orthogonality:
Auto-Correlation Function:
The auto-correlation of a code with a time-shifted version of itself:
$$R_{11}(\tau) = \sum_{i=0}^{N-1} c_1[i] \cdot c_1[(i + \tau) \mod N]$$
Ideal auto-correlation has a sharp peak at $\tau = 0$ and zero elsewhere:
$$R_{11}(\tau) = \begin{cases} N & \tau = 0 \ 0 & \tau \neq 0 \end{cases}$$
This is crucial for synchronization—the receiver correlates with the code, and the peak tells it exactly when the code starts.
| Code Family | Cross-Corr (aligned) | Cross-Corr (shifted) | Auto-Corr (peak) | Auto-Corr (off-peak) |
|---|---|---|---|---|
| Walsh (length N) | 0 (perfect) | ≤ N (poor) | N | Varies, ≤ N |
| PN (m-sequence) | −1/N (near zero) | −1/N (near zero) | N | −1 |
| Gold (length N) | ≤ t(n)/N | ≤ t(n)/N | N | ≤ t(n) |
| Kasami (large set) | ≤ 2^(n/2)/N | ≤ 2^(n/2)/N | N | ≤ 2^(n/2) |
No code family is perfect at everything. Walsh codes have perfect zero-lag cross-correlation but poor shifted cross-correlation. PN sequences have good auto-correlation everywhere but non-zero cross-correlation. This trade-off drives the use of different codes for different purposes in real CDMA systems.
Walsh codes (also called Hadamard codes) provide perfect orthogonality when users are synchronized. They form the backbone of channel separation in CDMA systems.
Hadamard Matrix Construction:
Walsh codes are the rows of a Hadamard matrix, constructed recursively:
$$H_1 = [1]$$
$$H_2 = \begin{bmatrix} 1 & 1 \ 1 & -1 \end{bmatrix}$$
$$H_4 = \begin{bmatrix} 1 & 1 & 1 & 1 \ 1 & -1 & 1 & -1 \ 1 & 1 & -1 & -1 \ 1 & -1 & -1 & 1 \end{bmatrix}$$
$$H_{2N} = \begin{bmatrix} H_N & H_N \ H_N & -H_N \end{bmatrix}$$
Key Properties:
| Code | Sequence | Binary Pattern | Use in IS-95 |
|---|---|---|---|
| W0 | +1+1+1+1+1+1+1+1 | 00000000 | Pilot (always transmitting) |
| W1 | +1-1+1-1+1-1+1-1 | 01010101 | Traffic channel |
| W2 | +1+1-1-1+1+1-1-1 | 00110011 | Traffic channel |
| W3 | +1-1-1+1+1-1-1+1 | 01100110 | Traffic channel |
| W4 | +1+1+1+1-1-1-1-1 | 00001111 | Traffic channel |
| W5 | +1-1+1-1-1+1-1+1 | 01011010 | Traffic channel |
| W6 | +1+1-1-1-1-1+1+1 | 00111100 | Traffic channel |
| W7 | +1-1-1+1-1+1+1-1 | 01101001 | Traffic channel |
**Test pair:** W3 and W5
- W3 = [+1, -1, -1, +1, +1, -1, -1, +1]
- W5 = [+1, -1, +1, -1, -1, +1, -1, +1]**Element-wise product:**
$W3 \cdot W5 = [(+1)(+1), (-1)(-1), (-1)(+1), (+1)(-1), (+1)(-1), (-1)(+1), (-1)(-1), (+1)(+1)]$
$= [+1, +1, -1, -1, -1, -1, +1, +1]$
**Sum:** $+1+1-1-1-1-1+1+1 = 0$ ✓
**For any pair Wi, Wj (i ≠ j):**
The Hadamard construction ensures that exactly half the positions have the same sign and half have opposite signs.
**Number of orthogonal pairs in Walsh-8:** $\binom{8}{2} = 28$ pairs, all with inner product = 0.Walsh orthogonality requires perfect time alignment. If codes are shifted by even one chip, orthogonality is destroyed. This is why Walsh codes are used on the synchronous downlink (base station to mobile) but not the asynchronous uplink (mobiles to base station cannot all synchronize precisely to chip boundaries).
Walsh codes' perfect orthogonality holds only at zero time shift. In practice, signals arrive at different times due to propagation delays, multipath, and timing imperfections. Understanding how timing errors destroy orthogonality is crucial for CDMA system design.
Shifted Cross-Correlation:
Consider Walsh codes W1 and W2 (length 4):
At zero shift: $R_{12}(0) = (+1)(+1) + (-1)(+1) + (+1)(-1) + (-1)(-1) = 0$ ✓
At shift $\tau = 1$ (W2 shifted by one position):
Actually, W1 and W2 happen to remain orthogonal at shift 1. Let's try W1 and W3:
At shift $\tau = 1$ (W3 shifted):
Let me try W1 and W4:
At shift $\tau = 0$: $R_{14}(0) = 1 - 1 + 1 - 1 = 0$ ✓ At shift $\tau = 1$: W4 shifted = [+1, +1, +1, +1] (unchanged, all same) $R_{14}(1) = 1 - 1 + 1 - 1 = 0$ ✓ (W4 is constant)
Let's examine a more compelling example with length-8 codes:
W2 and W3 (length 8):
At $\tau = 0$: Inner product = 0 ✓
At $\tau = 1$ (W3 cyclic shifted right by 1):
$R_{23}(1) = (+1)(+1) + (+1)(+1) + (-1)(-1) + (-1)(-1) + (+1)(+1) + (+1)(+1) + (-1)(-1) + (-1)(-1)$ $= 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 8$ ✗
Complete correlation! A one-chip shift made W3 identical to W2!
As shown above, a single chip timing error can transform zero cross-correlation into maximum cross-correlation. In practice, partial chip errors create proportional interference. This is why CDMA systems use precise timing advance on downlink and avoid Walsh codes on asynchronous uplink.
Multipath Impact:
Multipath propagation causes copies of the signal to arrive at different times. Consider a two-ray channel where:
Received signal: $r(t) = s(t) + \alpha \cdot s(t - \tau)$
When the receiver despreads:
The reflected path creates self-interference from other Walsh channels. In severe multipath (like indoor environments with delay spreads > 1 chip), significant orthogonality loss occurs.
Since Walsh codes lose orthogonality when shifted, CDMA systems need codes with better shifted correlation properties for asynchronous operation. Pseudo-Noise (PN) sequences fill this role.
Maximum-Length Sequences (m-sequences):
PN sequences generated by Linear Feedback Shift Registers (LFSRs) exhibit remarkable properties:
Autocorrelation of m-sequence:
$$R(\tau) = \begin{cases} N & \tau = 0 \ -1 & \tau \neq 0 \end{cases}$$
This two-valued autocorrelation is ideal for synchronization—a sharp peak indicates alignment.
Gold Code Construction:
While m-sequences have excellent autocorrelation, their cross-correlation can take on many values, some quite large. Gold codes combine pairs of m-sequences to create larger sets with bounded cross-correlation.
Construction: For two m-sequences $a$ and $b$ of period $N = 2^n - 1$:
$$G^{(k)} = a \oplus T^k b \quad \text{for } k = 0, 1, ..., N-1$$
where $T^k b$ is sequence $b$ shifted by $k$ positions and $\oplus$ is XOR.
Gold code set size: $N + 2$ codes (the two original m-sequences plus $N$ XOR combinations)
Cross-correlation bound: For properly chosen preferred pairs: $$|R_{ij}(\tau)| \leq t(n) = \begin{cases} 2^{(n+1)/2} + 1 & n \text{ odd} \ 2^{(n+2)/2} + 1 & n \text{ even} \end{cases}$$
| Property | Walsh Codes | PN (m-sequences) | Gold Codes |
|---|---|---|---|
| Set size (length N) | N codes | Few (limited pairs) | N + 2 codes |
| Cross-corr at τ=0 | 0 (perfect) | Variable | Variable |
| Cross-corr shifted | Up to N (poor) | ≈ 0 (good) | Bounded (good) |
| Autocorrelation | Variable | Two-valued (ideal) | Three-valued |
| Synchronization needed | Chip-level | Bit-level | Bit-level |
| Primary use | Synchronous downlink | Scrambling, uplink | Large code sets |
IS-95 uses Walsh codes on downlink (all channels synchronized by base station) and long PN codes on uplink (mobiles transmit asynchronously). The combination leverages Walsh's perfect synchronous orthogonality while using PN codes where synchronization cannot be guaranteed.
Modern CDMA systems need to support multiple data rates—voice at 12 kbps, video at 384 kbps, data at 2 Mbps—while maintaining orthogonality. Orthogonal Variable Spreading Factor (OVSF) codes solve this problem elegantly.
The Challenge:
Different data rates require different spreading factors:
Short and long Walsh codes are not automatically orthogonal—a length-4 code might correlate with part of a length-64 code.
OVSF Tree Structure:
OVSF codes are organized as a tree where:
OVSF Allocation Rules:
Code Allocation Example:
If we allocate C4_1 = (1,1,1,1), then:
**WCDMA scenario:**
- SF = 4 for 2 Mbps data
- SF = 128 for 12.2 kbps voice
- Need: 1 data user + maximum voice users**Step 1:** Allocate SF=4 code for data user
Choose C(4,1): blocks 1/4 of the code tree
**Step 2:** Calculate blocked voice codes
SF=128 codes under C(4,1): 128/4 = 32 codes blocked
**Step 3:** Available voice codes
Total SF=128 codes: 128
Blocked: 32
Available: 128 - 32 = 96 voice users
**Trade-off:** 1 high-rate user consumes capacity equivalent to 32 voice users
**Optimal allocation:** Place data user on code path with fewest active voice users to minimize disruption.WCDMA (3G) uses OVSF codes to simultaneously support diverse services. The network must carefully manage code allocation to maximize capacity—placing high-rate users to minimize blocking, and potentially reassigning voice users when data sessions start. This code management is a critical 3G network function.
The mathematical properties of code orthogonality have profound practical implications for CDMA system design, capacity, and performance.
| Environment | Delay Spread | Orthogonality Factor (α) | Capacity Impact |
|---|---|---|---|
| Indoor | 10–100 ns | 0.9–1.0 | Near-ideal, Walsh works well |
| Suburban | 100 ns–1 µs | 0.5–0.8 | Moderate degradation |
| Urban | 1–3 µs | 0.4–0.6 | Significant interference |
| Mountainous | 3–10 µs | 0.2–0.4 | Severe multipath |
| Satellite | < 10 ns | 0.95–1.0 | Excellent (single path) |
Downlink capacity is approximately proportional to orthogonality factor. In an urban environment with α = 0.5, capacity is roughly half of what perfect orthogonality would provide. This is why CDMA capacity projections often differ significantly from actual deployments—theoretical analyses assume perfect orthogonality that reality doesn't provide.
We've explored orthogonality from mathematical definition through practical system implications. Let's consolidate the essential concepts:
Critical Formulas:
$$\rho_{12} = \frac{1}{N} \sum_{i=0}^{N-1} c_1[i] \cdot c_2[i] = 0 \text{ (for orthogonal codes)}$$
$$H_{2N} = \begin{bmatrix} H_N & H_N \ H_N & -H_N \end{bmatrix}$$
$$C_{\text{actual}} = C_{\text{ideal}} \times \alpha \text{ (orthogonality factor)}$$
What's Next:
In the final page, we explore cellular applications of channelization—how FDMA, TDMA, and CDMA have been deployed in real cellular networks from 1G through 4G/LTE. We'll examine how hybrid systems combine these techniques and how spectral efficiency has evolved across mobile generations.
You now understand code orthogonality—the mathematical foundation enabling CDMA. From Walsh matrices to OVSF trees, from perfect synchronous separation to practical multipath degradation, orthogonality principles inform every aspect of CDMA system design. Next, we'll see these channelization techniques applied to real cellular networks.