In time-domain OCT a broadband ("low-coherence") source feeds a Michelson interferometer. Two beams reflect back — one from a scanning reference mirror, one from reflective layers inside the sample — and recombine at the detector. Interference fringes appear only while the two path lengths match to within the source's coherence length; this is coherence gating, and it is what lets OCT pick out a single depth without any lens focusing on it.
Coherence length: L_c = 0.44 · λ₀² / Δλ
Axial resolution: Δz = L_c / 2 (round trip)
A-scan envelope: I(z) = Σᵢ Rᵢ · exp[ -4ln2 · (2(z - dᵢ)/L_c)² ]
Each sample layer i sits at depth di with reflectivity Ri; the round-trip path mismatch to the reference mirror is 2(z − di). The exponential is the Gaussian coherence function that follows from a Gaussian source spectrum (Wiener–Khinchin theorem) — its FWHM is exactly L_c. The displayed A-scan is this envelope after demodulation, exactly what a real OCT system shows (the underlying optical fringe oscillates at λ₀, far too fast to plot at micron depth scale).
- λ₀, Δλ — center wavelength and bandwidth of the source. A wider Δλ gives a shorter coherence length and finer axial resolution: this is the core OCT resolution/bandwidth trade-off.
- Layer separation Δd — distance between the two sample reflectors. When Δz (resolution) is larger than Δd, their two coherence-gated peaks merge into one — the two layers can no longer be told apart.
- Mirror depth zref — where the reference arm is currently path-matched; the detector only lights up brightly when a sample layer sits within about one coherence length of this depth. Auto-Scan sweeps it to build the full A-scan.
Real systems (SD-OCT retinal scanners, anterior-segment imagers) use superluminescent diodes with Δλ ≈ 50–100 nm at λ₀ ≈ 840–1310 nm to reach 3–15 μm axial resolution — the same numbers this simulator computes.