This interactive tutorial visualizes a CDMA (Code Division Multiple Access) spread spectrum system: a narrow, low-rate data signal is transformed into a wide, noise-like signal by spreading with a Walsh-Hadamard code and Short PN scrambling, then reconstructed at the receiver by despreading, de-scrambling, and integrate-and-dump.
Signal chain
1. Data & modulation — A binary sequence (e.g. 101010) is mapped to baseband: 0 → −1, 1 → +1. BPSK uses one bit per symbol on the I-axis; QPSK uses bit pairs as I/Q symbols (same Walsh on both branches).
2. Spreading — Each symbol is multiplied by a 64-chip Walsh-Hadamard code (3GPP2/IS-95, SF=64) and then by a Short PN sequence. In QPSK, the I-branch uses the I-channel PN (15-bit LFSR) and the Q-branch uses the Q-channel PN (different polynomial per IS-95/CDMA2000), keeping the two channels decorrelated.
3. Pulse shaping (optional) — A Root-Raised Cosine (RRC) filter (roll-off α configurable) smooths chip edges into a band-limited waveform.
4. RF modulation — Baseband (or RRC-filtered) is up-converted: BPSK as x(t) cos(2π fc t); QPSK as I·cos − Q·sin.
5. Channel — AWGN is added (slider); optional Other Users add multi-user interference with different Walsh codes.
6. Receiver — Demodulation (I/Q for QPSK), matched filter (RRC), de-scrambling (× same I and Q PN), despreading (× same Walsh), then integrate & dump per symbol. Processing gain, BER, and Sync (Cell ID match) are displayed. Plots include Tx/Rx constellation, eye diagram (matched-filtered descrambled), and correlation peak for timing sync.
64-ary Walsh (3GPP2 C.S0002): User ID 0–63 selects the Walsh row. Cell ID and Receiver Cell ID set the Short PN offset (64 chips per ID). I- and Q-channel PN use different LFSR polynomials so the spectrum is flat and I/Q are independent.
Transmit chips spread a symbol by the Walsh code w and Short PN p; the receiver recovers the symbol by correlating with the same codes (integrate & dump over SF chips), giving a processing gain set by the spreading factor:
c[n] = d · w[n] · p[n] → d̂ = (1/SF) Σn c[n] · w[n] · p[n], Gp = 10 log10(SF) = 10 log10(64) ≈ 18 dB
Simulation
The interactive simulator is below. Use the controls to explore the concepts described above.
Usage
Use the controls and scope panes to explore CDMA spreading, dual-PN scrambling, and reception:
- Data (0/1): Binary sequence (e.g. 101010). Non-binary characters are stripped. For QPSK, bits are taken in pairs as I/Q symbols.
- Modulation: BPSK (one bit per symbol on I) or QPSK (I and Q with separate PN scrambling per IS-95).
- User ID (Walsh 0–63): Walsh row for spreading. Receiver must use the same User ID and Cell ID.
- Cell ID / Receiver Cell ID: Short PN offset (64 chips per ID). Sync is OK when both match.
- Noise: Slider 0–1. Higher values add more AWGN; processing gain keeps the recovered bits reliable.
- Other Users: Number of interferers (different Walsh codes, same PN offset). Stresses multi-user performance.
- RRC filter / RRC α: Root-Raised Cosine pulse shaping. When on, spread chips are RRC-filtered; receiver applies matched filter (RRC) before descrambling.
- PN spread / Walsh: Toggle scrambling and spreading for comparison (e.g. “no spread” preset).
- Plots 1–14: Baseband data, PN spread, Walsh, spread signal, RF+noise, Tx constellation, RF spectrum (Tx/Rx), Rx constellation, descrambled signal, despread signal, integrator ramp, eye diagram (matched-filtered descrambled), correlation peak (sync).
- Stats: Processing gain (dB), BER, Sync (OK / No Sync). Clear Data and Preset (e.g. High Noise, Multi-User, Wrong Cell) quick-set scenarios.
Tip: In QPSK, raise noise to see the four clusters in the Rx constellation; use “Wrong Cell” to see loss of sync when Receiver Cell ID ≠ Cell ID.
Parameters
- Data: Binary string. Default 101010. Mapped to ±1; QPSK uses bit pairs as I/Q.
- Modulation: BPSK or QPSK. QPSK uses dual Short PN (I and Q polynomials) per IS-95/CDMA2000.
- Noise level: AWGN scale. 0 = none; 1 = strong.
- Other Users: 0–10 interferers with random I/Q symbols and different Walsh codes.
- RRC filter: Root-Raised Cosine pulse shaping. α (roll-off) configurable (e.g. 0.35).
- User ID: Walsh index 0–63 (SF=64). Cell ID / Receiver Cell ID: PN offset index (0–511, 64 chips per step).
Limitations
- Conceptual IS-95/CDMA2000 chain. The blocks (Walsh spread, dual-PN scramble, RRC, AWGN, despread) follow the standard structure but use a short data sequence and SF=64 for clarity — not a bit-exact 3GPP2 link or full frame/coding structure.
- AWGN channel only. The channel adds white Gaussian noise (and optional same-offset interferers). Multipath fading, RAKE reception, near/far power control, and Doppler are not modeled.
- Idealized synchronization. Timing/carrier recovery is reduced to a correlation peak and a Cell-ID match; real acquisition, tracking loops, and frequency offset are not simulated.
- Simplified multi-user interference. “Other Users” share the PN offset with different Walsh codes; a real cell has many users with independent power, codes, and asynchronous timing.
- No channel coding. There is no convolutional/turbo coding, interleaving, or CRC, so the displayed BER reflects only spreading gain versus noise, not a coded link budget.
- Teaching tool. Built to visualize spreading, scrambling, processing gain, and despreading — not to predict the throughput or coverage of a deployed CDMA system.