This repository started as theory notes for free-space optical (FSO) receiver SNR. It now also includes a lightweight experimental baseline for a photodiode-based digital OOK link using a fast steering mirror (FSM) for static alignment.
The goal is to keep the physics reference intact while adding lab-ready measurement conventions, data templates, and simple Python scripts that turn oscilloscope/FSM scan data into repeatable baseline metrics.
The first experimental benchmark is a static FSM alignment scan:
- Hold the optical transmitter in known OOK low/high states.
- Sweep FSM X/Y commands around the nominal alignment point.
- Record photodiode receiver voltages and noise at each FSM point.
- Reject or flag clipped measurements.
- Select the best repeatable point by SNR, not by peak voltage alone.
The best static FSM command is the highest repeatable SNR point without ADC, TIA, or oscilloscope clipping. This point becomes the reference for later jitter injection and correction-algorithm tests.
For all digital OOK measurements in this repository:
Delta V = V_high - V_lowSNR_step = (Delta V)^2 / sigma^2SNR_decision = ((Delta V / 2)^2) / sigma^2SNR_step_dB = 20 log10(Delta V / sigma)SNR_decision_dB = 20 log10((Delta V / 2) / sigma)Q-factor = (mu_high - mu_low) / (sigma_high + sigma_low)BER estimate = Q((mu_high - mu_low) / (sigma_high + sigma_low))
For static scan data, the scripts use the explicit noise_used_v column when
it is provided. If that field is blank, they use
max(sigma_high_v, sigma_low_v) as a conservative scalar noise value for the
SNR calculations. The Q-factor and BER estimate always use the separate high
and low state standard deviations.
- docs/06-photodiode-receiver-chain.md documents the detector, TIA, filtering, digitizer, and clipping checks.
- docs/07-static-fsm-snr-benchmark.md defines the static FSM scan procedure and best-point selection rule.
- docs/08-jitter-and-correction-benchmark.md defines the comparison format for later jitter/correction tests.
- docs/09-lab-checklists.md provides short setup, capture, and review checklists.
- data/templates/fsm_static_scan_template.csv is the starting CSV format for FSM X/Y scan measurements.
- scripts/analyze_fsm_static_scan.py computes SNR, Q-factor, BER estimate, clipping flags, best point, JSON summary, annotated CSV, and heatmaps.
- scripts/plot_snr_heatmap.py plots any X/Y scan value column as a heatmap.
- scripts/compare_jitter_cases.py compares later static, jittered, and corrected benchmark cases.
Install the small analysis stack:
python -m pip install -r requirements.txtAnalyze a static FSM scan:
python scripts/analyze_fsm_static_scan.py \
data/templates/fsm_static_scan_template.csv \
--output-dir results/fsm_static_scanPlot one metric from an annotated scan CSV:
python scripts/plot_snr_heatmap.py \
results/fsm_static_scan/fsm_static_scan_template_metrics.csv \
--value-column snr_step_db \
--output results/fsm_static_scan/snr_step_db_heatmap.pngCompare later jitter/correction cases:
python scripts/compare_jitter_cases.py path/to/jitter_cases.csv \
--baseline-case static_baseline \
--output-dir results/jitter_comparisonPersonal reference notes on SNR, noise summation, square-law detection, and BER for direct-detection optical links. Compiled while studying ahead of an FSO baseline characterization experiment.
When characterizing an optical communication link on a laboratory
oscilloscope, the Signal-to-Noise Ratio (SNR) is a physical,
un-normalized measurement of signal power relative to noise power captured
within the active receiver sampling bandwidth (
The voltage waveform displayed on the screen alternates between two distinct voltage states:
-
$V_{\text{low}}$ : baseline voltage when the transmitter laser is completely OFF. -
$V_{\text{high}}$ : average voltage when the transmitter laser is completely ON. -
$\Delta V$ : the meaningful signal amplitude step:$$\Delta V = V_{\text{high}} - V_{\text{low}}$$
The "fuzziness" of the lines on screen maps directly to random background electronic noise fluctuations.
-
Standard Deviation (
$\sigma$ ): the AC RMS voltage of the waveform during a steady static state. -
Variance (
$\sigma^2$ ): electrical power through a load resistor$R_L$ scales as$P = V^2/R_L$ , so variance represents the total noise power of the system.
Warning
Bandwidth filter impact: widening the scope's analog bandwidth
filter (
Multiple independent physical phenomena generate background noise in an optical receiver simultaneously. Because these sources are statistically independent, their variances (powers) add linearly, not their voltages:
-
Thermal noise (
$\sigma_{\text{thermal}}^2$ ): thermal agitation of electrons in the photodiode load resistor and TIA channels. Constant — depends only on temperature and circuit design. -
Dark current noise (
$\sigma_{\text{dark}}^2$ ): leakage current present even with zero incident light, from spontaneous electron-hole generation in the semiconductor. -
Flicker /
$1/f$ noise ($\sigma_{1/f}^2$ ): low-frequency drift from crystal lattice traps; causes the baseline to wander over long holds. -
Quantization noise (
$\sigma_{\text{quant}}^2$ ): ADC rounding error when digitizing the waveform.
-
Quantum shot noise (
$\sigma_{\text{shot}}^2$ ): photon arrival is a discrete Poisson process, so variance is directly proportional to the average photocurrent ($I_{\text{photo}}$ ). Maximal when the laser is ON, zero when OFF. -
Relative Intensity Noise (
$\sigma_{\text{RIN}}^2$ ): amplitude fluctuations from the laser cavity itself; scales quadratically with intensity.
Because the baseline electronic noise terms are identical in ON and OFF states, measuring both and subtracting variances isolates the pure optical noise contribution:
An RF antenna tracks the field amplitude
A photodiode can't track optical-frequency field oscillations directly —
it responds to power, proportional to
Note
The 2-for-1 dB rule: a 1 dB drop in optical power causes a 2 dB
drop in electrical signal power on the scope. This holds cleanly in a
thermal-noise-limited system. Once shot noise dominates (which it will,
since shot noise itself scales with
Adding an optical amplifier (e.g. EDFA) injects an Amplified Spontaneous
Emission (ASE) noise field
At high power this term dominates thermal noise, simplifying the SNR to a purely linear relationship with optical power:
(Only relevant once an optical amplifier is in the link — not applicable to an unamplified baseline test.)
The downstream decoder places an electronic Decision Threshold
(
-
False alarm (
$0 \to 1$ ): laser OFF, but a large positive noise spike pushes the voltage above threshold at the sampling instant. -
Missed detection (
$1 \to 0$ ): laser ON, but a negative noise dip pulls the voltage below threshold.
Baseline noise follows a normal Gaussian distribution, so bit-error
probability requires integrating the tail areas past the decision
threshold — handled by the Q-function,
For symmetric OOK, the distance from a bit state's center to the threshold
is
Tip
The cliff effect: because
Important
Symmetric-noise assumption: this formula assumes
To make results replicable across labs with different hardware, engineers
normalize raw SNR into
-
$E_b$ (Energy per Bit):$E_b = P_{\text{average}} / \text{Bit Rate}$ . -
$N_0$ (Noise Power Spectral Density):$N_0 = \sigma^2 / B$ .
Where
In a static ON-hold / OFF-hold baseline test:
- Effective state-switching data rate
$R \approx 0\ \text{bps}$ . - Scope sampling filter
$B$ is wide open (e.g. 20–200 MHz).
Because
Original theory reference notes preserved as the physics foundation for the experimental FSO baseline workflow above.