---
title: "Speckle Lab Interactive Lab | Sandbox Physics"
description: "Why does coherent light scattered by a diffuser look grainy, and can averaging images smooth it out?"
canonical_url: "https://sandboxphysics.com/labs/speckle-lab/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/speckle-lab/"
last_modified: "2026-10-27"
---

Optics 053 · Interference, coherence, cavities, and metrology

# Speckle Lab

**Why does coherent light scattered by a diffuser look grainy, and can averaging images smooth it out?** Each point on the screen gets light from many scattering points with random phases. Added coherently, they sometimes line up and sometimes cancel, which makes bright and dark grains. The wider the illuminated patch, the finer the grains. Averaging frames lowers the contrast only if they are uncorrelated; repeating nearly the same frame helps little.

Move a deterministic phase diffuser on a 3D Fourier bench and record simulated intensity maps. Average the recorded frames, then compare the contrast and displacement correlation of a finite sample with independent ensemble laws.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

The diffuser is an ideal scalar model with a finite set of point sites; it does not solve Maxwell scattering from ground glass or represent a calibrated flow camera. The fixed grayscale clips only the display, and the statistics keep every intensity. Frames are taken at discrete, stopped positions rather than during a continuous exposure.

Physics tutorial

## Audit the physics of Speckle Lab

**Background** A bright speckle grain does not come from one scattering particle. It forms where many coherent contributions interfere constructively at the same detector point: $I(\boldsymbol q)=\left|\frac1{\sqrt N}\sum_j e^{i\phi_j}e^{-2\pi i\boldsymbol r_j\cdot\boldsymbol q/(\lambda f)}\right|^2$. The coloured transmissive screen shows the programmed phase, and the separate grayscale sensor records the squared field amplitude. The two pictures need not look alike.

**Why it matters** Why does coherent light scattered by a diffuser look grainy, and can averaging images smooth it out?

Start with the essentials

- **Focus question**: Why does coherent light scattered by a diffuser look grainy, and can averaging images smooth it out?
- **One-sentence intuition**: When a detector averages frames taken one after another, it adds their intensities, not their complex amplitudes. How much the averaging helps depends on how correlated the frames are: $K^2=\frac1{M^2}\sum_{j,k}\operatorname{Cov}(I_j,I_k)$. Repeating a stationary frame leaves the contrast unchanged, and packing positions closer together does not give more independent observations.

### Core mathematical model

#### How a Fourier lens links phase sites to the sensor

$$
\begin{aligned}\boldsymbol q&=f\boldsymbol\alpha\\\boldsymbol h_\ell&=\boldsymbol r+\boldsymbol q\\\boldsymbol\alpha_{\mathrm{out}}&=\boldsymbol\alpha-\boldsymbol h_\ell/f=-\boldsymbol r/f\end{aligned}
$$

The screen sits in the front focal plane and the sensor in the back focal plane. A contribution leaving a phase site crosses the lens at the site position plus the chosen detector position, then lands at that detector position. The green and gold lines show a few of these paraxial contributions, not the full wave field. The detector faces the lens, and its opaque housing sits behind the absorbing plane.

#### The grain scale comes from the illuminated width

$$
\begin{aligned}D&=na,\quad a=50\,\mu\mathrm m\\s_0&=\lambda f/D\\\Delta q&=\lambda f/(128a)\end{aligned}
$$

The illuminated square holds phase sites of equal amplitude on a regular lattice. The field coherence is a finite geometric sum, and its first zero sets the characteristic grain scale quoted here. That scale is not the diameter of every visible grain, and it is not an imaging resolution. The whole detector window scales with wavelength and focal length, so the discrete angular samples stay the same. When the wavelength changes, the programmed phase values are kept; they are not derived from a fixed glass relief.

#### Measure contrast from unclipped records

$$
\begin{aligned}\overline I_p&=\frac1M\sum_m I_{m,p}\\K_{\mathrm{record}}&=\frac{\sqrt{\langle(\overline I_p-\langle\overline I\rangle)^2\rangle_p}}{\langle\overline I\rangle_p}\\\langle I\rangle_{\mathrm{DFT}}&=1\end{aligned}
$$

Each frame is computed by Fourier propagation, then squared, stored and averaged with equal weights. Parseval's theorem fixes the mean over the full discrete angular tile, so no frame gets its own auto exposure. The grayscale display reaches white at a normalized intensity of four, but brighter values still count in the statistics. A single finite realization can have contrast above one. The normalization check tests the discrete sum, not a calibrated optical power.

#### Shifting the screen keeps the overlapping phase sites

$$
\begin{aligned}N&=n^2\\O(\delta)&=n\max(0,n-|\delta|/a)\\\Gamma_I(\delta)&=\frac{O(\delta)[O(\delta)-1]}{N^2}\\\rho_{\mathrm{ensemble}}(\delta)&=\frac{\Gamma_I(\delta)}{1-1/N}\end{aligned}
$$

This covariance for a finite set of equal phasors is an analytic limit, derived for shifts by whole lattice steps. Sites in the overlap keep exactly the same seeded phase. Sets with no sites in common have zero ensemble covariance, but two finite recorded maps need not have zero Pearson correlation. The mint curve is computed from the recorded maps. The gold dashed curve is the ensemble reference; it is not a fit and is never used to alter the detector image.

#### Correlated frames do not follow the independent-frame rule

$$
\begin{aligned}K_{\mathrm{ensemble}}^2&=\frac1{M^2}\sum_{j,k}\Gamma_I(d_j-d_k)\\K_{\mathrm{independent}}&=\sqrt{\frac{1-1/N}{M}}\\K_{\mathrm{stationary}}&=\sqrt{1-1/N}\end{aligned}
$$

When four frames are spaced a full illuminated width apart, they share no phase sites, and the ensemble contrast halves. Packing sixteen frames into the same travel generally does not cut the contrast to a quarter. With zero travel, all frames are identical and no amount of repetition helps. The frames are taken at stopped positions with equal durations; they do not approximate an exposure during continuous motion. The familiar covariance integral for a time exposure rests on the same weighting idea, but the Lab does not present it as this camera simulation.

#### The exponential curve is the limit for a static screen with many sites

$$
p(I)=\frac1{\langle I\rangle}e^{-I/\langle I\rangle},\quad N\to\infty
$$

Many independent contributions with uniformly random phase add up to a circular complex Gaussian field, so a single record has an exponential intensity distribution. The histogram uses all of the unclipped averaged records and reports its tail separately. The dashed exponential is a static reference; it is not the distribution of a correlated average. The model leaves out vector scattering, integration over finite pixels, a form factor for each site, finite laser coherence, polarization diversity, photon noise and material calibration. It does not measure blood flow.

### Common difficulties

#### More frames do not automatically mean independent speckle

**Typical misconception** Sixteen frames always divide speckle contrast by four.

**Better mental model** That limit needs intensity records that are uncorrelated. Frames that repeat or share phase sites stay correlated, and adding complex amplitudes coherently is a different operation altogether. Check the actual sequence of frames before you apply a square-root rule.

### Run the experiment

1. 01

   #### Scene 1: Fully developed speckle

   In the static preset, enlarge the illumination and change the focal length. Check that the apparatus really moves while the grain scale set by field coherence changes.

   **What to observe:** Grain size follows the optical scale, and the detector does not show a direct image of the phase screen.

2. 02

   #### Scene 2: Moving-diffuser averaging

   In the averaging scene, choose eight sites per side, four frames and a total travel of 24 sites. Then set the travel to zero and keep four frames.

   **What to observe:** The mean discrete intensity stays fixed. Averaging correlated frames smooths the fluctuations less than averaging independent ones.

3. 03

   #### Scene 3: Displacement correlation

   In the correlation scene, use the diffuser detail view and drag the illuminated centre. Compare the recorded and ensemble correlations across different screen samples.

   **What to observe:** Deviations caused by the finite screen show up in the data instead of being forced onto the ideal reference curve.

Physical conclusion

A speckle grain is interference. To suppress it you need recorded intensities that differ from one another, not a prettier random texture.

Waves & optics · Starter path

## From one ray to interference measurement

Start with refraction, find where the ray picture stops working, then use interference to measure tiny distances.

[Start here → **Optical Boundary Explorer** Turn the incident angle and watch reflected and transmitted power trade off. Then switch to the critical-angle scene. Observe · 11 min](https://sandboxphysics.com/labs/optical-boundary-explorer/)

1. [1 Optical Boundary Explorer](https://sandboxphysics.com/labs/optical-boundary-explorer/)
2. [2 Rainbow Caustic Observatory](https://sandboxphysics.com/labs/rainbow-laboratory/)
3. [3 Camera Obscura](https://sandboxphysics.com/labs/camera-obscura/)
4. [4 Coherent Wave Composer](https://sandboxphysics.com/labs/coherent-wave-composer/)
5. [5 Young Double-Slit Bench](https://sandboxphysics.com/labs/young-double-slit-bench/)
6. [6 Michelson Precision Lab](https://sandboxphysics.com/labs/michelson-precision-lab/)

[View the full path →](https://sandboxphysics.com/topics/waves-and-optics/#starter-path)
