Touch the wave.
See the transform.
Three small experiments, each on its own model: a time-domain wave you can poke, a Fourier-optics bench for apertures and filters, and the X-ray reflectivity of a thin film. Nothing here is precomputed.
Ripple tank
A ripple tank for light: a 2D scalar wave equation on an optical table. The slit jaws absorb by default, like the tungsten blades of an X-ray slit; switch them to reflecting to see the standing waves an ideal mirror sends back. Click to ripple. Double-click to pin a source, double-click it again to remove it. Drag the barrier by its mount on the rail, a slit up or down by its opening, or a jaw's knife edge to change the gap. With the lattice in place, drag its middle to move it and its rim to rotate it, and watch for the angle where the detector lights up: that is the Bragg condition. At the right edge a film strip darkens where intensity arrives; click it for fresh film. Beside it, the thin line is the intensity arriving now and the heavy one its running average.
Fourier bench
A separate model: a monochromatic complex field and its 2D Fourier transform, not a time-domain wave. Pick an aperture or draw one, block frequencies in the far field in the middle, and on the right see what survives when the phase is thrown away.
How it works
The aperture is a transmission function t(x,y) on a 256 × 256 grid, lit by a uniform coherent plane wave, so the exit wave is U = t. Under the scalar, paraxial, coherent Fraunhofer approximation the far-field amplitude is proportional to the 2D Fourier transform of U; the middle panel shows log(1 + α|F|²) purely for visibility.
The filter multiplies the complex spectrum by a mask H — like a stop in the Fourier plane of a 4f lens system — and the right panel is the intensity of the inverse transform. Because the phase of F is kept, an unfiltered round trip returns the aperture exactly. Inverting the intensity |F|² alone would not: recovering the lost phase is the phase-retrieval problem, which this page does not solve.
Paint stops lets you block any part of the spectrum by hand, as a mask cut for the Fourier plane would. The right panel can also show what the phase carries: Phase discarded keeps every |F| and sets the phase to zero (what you would rebuild from the detector alone), Phase only keeps the phase and sets every magnitude to one. The edges survive in the second, not in the first. Hovering the spectrum draws, over the aperture, the grating whose frequency is under the pointer.
Frequencies are in cycles per sample; the edge of the panel is 0.5. Propagation distance is not modeled here (that needs a Fresnel transfer function, not a bigger FFT).
X-ray reflectivity
A third model: specular reflection of X-rays from a thin film at grazing angles. Below the critical edge everything is reflected; above it, the waves reflected at the film's top and bottom interfere into Kiessig fringes. The fringe spacing gives the thickness, the edge the density (SLD), and how fast the fringes die away the roughness. Change the film and watch the curve move.
How it works
The curve is the Parratt recursion with Névot–Croce roughness (xrr.js), for one film between air and the substrate at Cu Kα (λ = 1.54 Å). Its numbers match ReflectoLearn's reference engine to 1e-10 in log10 R on seven test stacks. The dashed lines mark the critical edges qc = 4√(π·SLD) of film and substrate. Fringes are spaced by about 2π/d once q is well above the edges.
Counting noise samples the scan a diffractometer would take, 2θ = 0.2° to 6° in 0.02° steps, as Poisson counts with 107 in the plateau and a background of 10−7. The ideal curve has neither noise nor instrument resolution.
When a trained ReflectoLearn network is published next to this page, Estimate with the CNN runs it in the browser (ONNX Runtime, WebAssembly) on exactly that scan. The input is built as ReflectoLearn's own preprocessing builds it (xrr-input.js, checked against its reference to the bit). The dashed accent curve is the film the network reports, before any fitting. The network has never seen these curves; how far off it is, is the point.