Web Simulation 

 

 

 

 

Time-Frequency Synchronization (OFDM) 

This interactive tutorial visualizes OFDM synchronization failures: Timing Offset, Carrier Frequency Offset (CFO), and Phase Noise. OFDM (Orthogonal Frequency-Division Multiplexing) is used in WiFi, 4G/5G, and DVB. The receiver must align its FFT window with the symbol and correct frequency/phase errors; otherwise, the constellation degrades.

The simulation builds a continuous stream of three full OFDM symbols: [Prev tail] + [CP] + [Current data] + [Next head]. Prev and Next are real OFDM (last 64 / first 64 samples of adjacent symbols), not noise—so ISI has the same PAPR and texture as the center symbol. QPSK on data subcarriers, pilots every 4th. Impairments are applied to the whole stream. You see the time-domain waveform, frequency (magnitude and phase), constellation (I/Q after FFT), and phase vs subcarrier for pilots. A movable FFT-window and highlighted CP show why timing errors cause ISI when the window slides into prev or next.

Mathematical Model

OFDM: Data symbols X[k] are mapped to subcarriers, then IFFT gives the time-domain block. A Cyclic Prefix (CP) is prepended. The transmitted signal is x[n], n = 0,…,N+CP−1.

Timing Offset (τ): The receiver uses an FFT window starting at sample τ. If τ is within the CP, the effective channel is circular and we see a linear phase ramp across subcarriers. If the window crosses the symbol boundary, we get ISI.

CFO (ε): A frequency offset multiplies the received signal by ej2πεn/N. In the constellation you see common rotation; but CFO also causes ICI (see below).

Phase Noise: Modeled as a Wiener process (random walk). Each sample is multiplied by ejφ[n] with φ[n] = φ[n−1] + noise. This causes jittery spreading of the constellation, distinct from the smooth CFO rotation.

Orthogonality, ICI, and Why Time-Domain Correction Works

OFDM’s “magical” property is orthogonality: each subcarrier fits exactly into its own FFT “bucket.” Multiplying by ej2πεn/N (CFO) changes only the angle, not the length, of a phasor—yet the constellation becomes fuzzy (amplitude spreading). Why?

Leakage (ICI): The FFT sorts the signal into frequency buckets. With perfect sync, subcarrier k goes 100% into bucket k. With CFO, the signal “spins” in time; to the FFT that looks like a frequency shift. Energy leaks into neighboring buckets—Inter-Carrier Interference (ICI). Your bucket loses energy (leaked out) and gains “trash” (leaked in from neighbors). Those leakage terms add random vectors: sometimes they add, sometimes cancel. The result is the fuzzy cloud—amplitude spreading—even though the ideal signal alone would only rotate.

Post-FFT correction: You let leakage happen, then rotate the FFT output. You fix the angle of the main signal, but the ICI is already mixed in. You cannot remove neighbors’ leakage by rotating. The cloud stops spinning but stays fuzzy.

Pre-FFT (time-domain) correction: You apply counter-rotation before the FFT. That “stops the spinning” before the signal enters the FFT. Subcarrier k again goes 100% into bucket k. No leakage → no fuzz. The constellation is sharp. This simulation uses time-domain CFO correction when you enable Correction (Auto or Manual).

Analogy: Spinning the camera during a long exposure turns stars into streaks. Rotating the photo in Photoshop leaves them streaky. Stabilizing the camera while taking the shot keeps each star on one pixel—sharp dots. Time-domain correction is like stabilizing the camera.

Phase Wrapping and the Phase Plot

You may notice a difference between the Constellation and the Phase vs Subcarrier plot when you dial Correction Strength: the constellation improves gradually (geometric shrinkage), but the phase plot often looks “broken” until you get very close to 100%. That comes from phase wrapping—the way we plot phase uses modulo arithmetic (−π to π), not “true” angle.

The sawtooth effect: CFO creates a linear phase ramp across subcarriers (φ ∝ ε·k). With ε = 0.2 and N = 128, the phase rotates many full circles (2π) across the band. The graph can only show values in [−π, π], so it wraps the ramp—and the straight ramp becomes a sawtooth (zig‑zag).

Why 50% looks like 0%: At 0% correction the phase wraps many times → dense zig‑zag. At 50% it still wraps often → still a dense zig‑zag. At 80%, fewer wraps, but still zig‑zag. In all cases the plot looks like “noise” or “fluctuation”; you barely see improvement until wrapping stops.

The “magical” ~95% moment: When the slope gets shallow enough that the total rotation across all subcarriers is less than 2π, the phase no longer wraps. The sawtooth snaps into a single straight line. That’s why it feels like “nothing happens” until you’re almost at 100%.

Visual proof: Imagine a clock hand spinning fast (CFO). At 100 mph → blur; at 50 mph → still blur; at 1 mph → you suddenly see the hand move. The phase plot is similar: many wraps look like chaos until the effective “speed” is low enough.

Bottom line: The correction is working at 50% or 80%—the constellation and EVM show it. The “sudden” jump in the phase plot is an optical illusion from wrapping. To show improvement earlier, we could unwrap the phase or plot the slope instead of raw phase; for now, the [−π, π] phase plot is a useful reminder of how modulo arithmetic changes what you see.

Key Insight: Timing offset → phase ramp (Phase vs Subcarrier). CFO → rotation and ICI/fuzz. Phase noise → jittery smearing. Use Preset and sliders to see each effect; Correction (Auto or Manual) applies time-domain CFO correction and pilot-based phase cleanup to restore orthogonality and sharpen the constellation.

sample rate subcarrier spacing
0 samp (0.00 µs)
0.00 Δf (0 Hz)
σ=0.000 (~0.0° drift)
0% Applied
Time Domain — [Prev tail] + [CP] + [Data] + [Next head]; prev/next = real OFDM. Red = danger (ISI), blue = CP, yellow = FFT window
Frequency — Magnitude (Data=blue, Pilot=red)
Frequency — Phase (Data=blue, Pilot=red)
Constellation (Data=blue, Pilot=red)
Phase vs Subcarrier (Pilots)

 

Usage Example

Follow these steps to explore OFDM Time-Frequency Synchronization:

  1. Initial View: Time Domain (top) with [Prev tail|CP|Data|Next head] stream—prev/next are real OFDM—red danger zones, blue CP, yellow FFT Window; Frequency (magnitude & phase); Constellation and Phase vs Subcarrier below.
  2. Preset Dropdown: Use Preset to load scenarios: Perfect Sync (all zero), Timing Error (Phase Ramp), Timing Error (ISI), CFO Rotation, Phase Noise Jitter, Chaos (All).
  3. Sliders: Adjust Timing (−20 to +20 samples) to move the FFT window; CFO (−0.5 to +0.5) for frequency offset; Phase Noise (0–0.2) for Wiener jitter.
  4. Correction: Auto applies full time-domain CFO correction and pilot-based phase cleanup; Manual uses the Correction Strength slider.
  5. History Trail: Check to show fading trails in the constellation (CFO vs phase noise motion).
  6. Step Bwd / Step Fwd / Run–Stop: Pause with Stop, then step through symbols; Run resumes animation.

Tip: Use Timing Error (Phase Ramp) to see a linear phase vs subcarrier; CFO to see rotation (and ICI) in the constellation; Phase Noise for smearing. Enable History Trail to distinguish smooth CFO rotation from jittery phase noise. If the Phase vs Subcarrier plot looks “broken” until Correction Strength is near 100%, that’s phase wrapping (sawtooth effect)—the correction is working; see the Phase Wrapping section above.

Parameters

Short descriptions of each parameter:

  • Stream: [Prev tail (64)] + [CP (16)] + [Data (128)] + [Next head (64)]. Prev/Next = real OFDM (last/first 64 samples of adjacent symbols) for realistic ISI and PAPR.
  • Timing (τ): FFT window offset in samples (−20 to +20). Within CP → phase ramp; outside → ISI (prev or next symbol).
  • CFO (ε): Normalized carrier frequency offset (−0.5 to +0.5). Causes common rotation and ICI (fuzz); see Orthogonality section above.
  • Phase Noise: Wiener process strength (0–0.2). Causes jittery smearing, distinct from CFO.
  • Preset: Loads Timing, CFO, and Phase Noise combinations (Perfect Sync, Phase Ramp, ISI, CFO, Phase Noise, Chaos).
  • Correction: Auto = full time-domain CFO correction + pilot phase cleanup; Manual = Correction Strength (0–100%). Pre-FFT correction restores orthogonality and removes ICI.
  • History Trail: Keeps fading trails in the constellation to visualize CFO vs phase noise motion.

Controls and Visualizations

Short descriptions of each control:

  • Sliders: Timing, CFO, and Phase Noise update the simulation and value labels in real time.
  • Preset dropdown: Applies preset (τ, ε, phase noise) and syncs sliders.
  • Time Domain: Stream [Prev tail|CP|Data|Next head]; prev/next = real OFDM (last/first 64 samples). Red = danger zones (ISI if window slides into prev/next); blue = CP; yellow = FFT window. Window moves with Timing.
  • Frequency: Left = magnitude |X[k]|, right = phase ∠X[k] vs subcarrier; data=blue, pilots=red.
  • Constellation: I/Q after FFT. Blue = data, red = pilots. Time-domain correction removes ICI and sharpens clusters.
  • Phase vs Subcarrier: Pilot phases in [−π, π]; timing offset → ramp. Phase wrapping can make the plot look like a sawtooth until correction is near 100% (see Phase Wrapping section).
  • Step Bwd / Step Fwd / Run–Stop: Pause, single-step, or run the animation.

Key Concepts

  • OFDM: IFFT maps subcarriers to time domain; CP prepended. Receiver FFT-windows the useful part.
  • Three-symbol stream: [Prev tail | CP | Data | Next head]. Prev/Next are real OFDM (not noise); sliding the window into them causes realistic ISI with same PAPR and texture as the center symbol.
  • Timing offset: Window shift. Inside CP → circular shift → linear phase ramp across subcarriers. Outside CP → ISI (prev or next symbol leaks in).
  • CFO: exp(j2πεn/N) rotation; common phase for all subcarriers → constellation rotates as a whole.
  • Phase noise: Wiener random walk; per-sample phase jitter → smearing/arcs, distinct from CFO.
  • Correction: Time-domain CFO derotation and pilot-based phase cleanup; ideal window recovers a clean constellation.