We show that diffraction patterns can be directly simulated by a computer program implementing a lock-in algorithm. The two distinct physical topics, namely, single-slit diffraction and lock-in detection, are juxtaposed to highlight the common underlying physical principle in the context of the power spectrum of source signals arising from Fourier analysis.

1.
D. C.
Giancoli
,
Physics for Scientists and Engineers with Modern Physics
, 4th ed. (
Pearson Prentice Hall
,
Upper Saddle River, NJ
,
2008
), Chap. 35, pp.
903
909
.
2.
D. T.
Chuss
, “
A software-based lock-in measurement for student laboratories
,”
Am. J. Phys.
86
(
2
),
154
158
(
2018
).
3.
K. G.
Libbrecht
,
E. D.
Black
, and
C. M.
Hirata
, “
A basic lock-in amplifier experiment for the undergraduate laboratory
,”
Am. J. Phys.
71
(
11
),
1208
1213
(
2003
).
4.
Note that physical employment of a data acquisition card is not necessary in the present study; the sampling time (or sampling frequency) is directly related to the number of data points.
5.
W. H.
Press
,
S. A.
Teukolsky
,
W. T.
Vetterling
, and
B. P.
Flannery
,
Numerical Recipes: The Art of Scientific Computing
, 3rd ed. (
Cambridge U. P
.,
New York, NY
,
2007
), Chap. 12.
6.
G.
Heinzel
,
A.
Rüdiger
, and
R.
Schilling
,
Spectrum and Spectral Density Estimation by the Discreet Fourier Transform (DFT) Including a Comprehensive List of Window Functions and Some New Flat-Top Windows
(
Max-Planck Institut für Gravitationphysik
,
Hannover
,
2002
).
7.
E.
Hecht
,
Optics
, 4th ed. (
Pearson Addison Wesley
,
San Francisco, CA
,
2001
), Chap. 11.
AAPT members receive access to the American Journal of Physics and The Physics Teacher as a member benefit. To learn more about this member benefit and becoming an AAPT member, visit the Joining AAPT page.