MATLAB Scientific Academy
ADVANCED · 25 min

Explore optical diffraction

Connect wave optics with computation by examining how wavelength and aperture size determine a diffraction pattern.

What you will learn

  • Distinguish wavelength from slit width.
  • Interpret the single-slit intensity equation.
  • Use a model to explore parameter dependence.

The concept

For an ideal single slit under Fraunhofer conditions, normalized intensity is I/I₀ = (sin β / β)², where β = πa sin(θ)/λ. Here a is slit width, λ is wavelength and θ is the observation angle.

The first minima occur when a sin(θ) = ±λ. At small angles, the screen displacement is approximately proportional to λL/a, where L is the screen distance. This is an approximation; near-field diffraction requires a different model.

Scientific habit: Before running a program, predict what it will do. Then compare your prediction with the output and explain any difference.

Worked example

Calculate and plot the normalized single-slit diffraction intensity.

example.mMATLAB CODE
lambda = 550e-9; % wavelength (m)
a = 50e-6;       % slit width (m)
L = 1;            % screen distance (m)
x = linspace(-0.015, 0.015, 1000);
theta = atan(x/L);
beta = pi*a*sin(theta)/lambda;
I = ones(size(beta));
idx = abs(beta) > 1e-12;
I(idx) = (sin(beta(idx))./beta(idx)).^2;
plot(x*1e3, I, 'LineWidth', 2);
xlabel('Screen position (mm)'); ylabel('I / I_0'); grid on;

The model uses a small-angle-compatible screen geometry and the far-field single-slit expression. Real systems may include finite source size, detector response, aberrations and alignment errors.

Try it yourself

Predict the effect of changing the aperture.

Quick check

If wavelength and screen distance stay fixed, what happens to the central maximum when the slit becomes wider?

Reveal hint and answer
Hint: The first-minimum displacement is approximately λL/a.
Answer: The central maximum becomes narrower.

Where this is used

Diffraction models support optical system design, aperture analysis, imaging, spectroscopy and understanding resolution limits.

Academy homeNext: Optical & biomedical sensors