Interference Simulation Using MATLAB
Interference Simulation Using MATLAB
Interference Simulation
using Matlab
Prepared by
Juana Hussein A. Hazha Mustefa A.
Supervised by
Dr. Omed Gh. Abdullah
2008 – 2009
Contents
Chapter One: Introduction.
1.1 Introduction.
1.2 Waves and wave fronts.
1.2.1 Plane wave.
1.2.2 Spherical wave.
1.2.3 Aberrated plane wave.
1.3 Electromagnetic spectrum.
1.4 Electromagnetic theory of light.
1.5 The wave properties of light.
1.5.1 Reflection.
1.5.2 Refraction(total internal reflection).
1.5.3 Diffraction.
1.5.4 Polarization.
1.5.5 Superposion and interference of wave.
Chapter Two: Young double slit experiment.
2.1 Introduction.
2.2 Interference condition.
2.3 Young double slit experiment.
2.4 Intensity in double slit experiment.
2.5 Effect of slit width.
2.6 Repetition.
2.7 Fourier series.
2.8 Fast flourier transform.
2
Chapter Three: Interference Simulation.
3.1 Introduction.
3.2 Double slit interference.
3.3 Interference in single slit.
3.4 Interference in three slits.
3.5 Interference in five slits.
3.6 Interference in seven slits.
References.
Appendix.
3
Acknowledgments
4
Abstract
5
Chapter One
Introduction
1.1 Introduction
In the early 20th century, experiments revealed that there were some
phenomena associated with light that could only be explained by a particle
picture. Thus, light as it is now understood, has attributes of both particles and
waves. In this Chapter we will deal mainly with the wave attributes of light.
The particle-like behavior of light is described by the modern theory of
quantum mechanics.
6
where r is the position vector and both the amplitude A and phase are
functions of the spatial coordinate and time. The polarization state of the field
is contained in the temporal variations in the amplitude vector.
This expression can be simplified if a linearly polarized monochromatic
wave is assumed:
E(x, y, z) = A(x, y, z)ei(wt−φ ( x, y, z)) (1.3)
Where w is the angular frequency in radians per second and is related to
the frequency v by
w = 2πv (1.4)
Some typical values for the optical frequency are 5 × 1014 Hz for the visible,
1013 HZ for the infrared, and 1016 Hz for the ultraviolet.
7
We see that the plane wave is periodic in both space and time. The spatial
period equals the wavelength in the medium, and the temporal period equals
1/v.
8
Figure (1.1): Examples of wave fronts: (a) plane wave; (b) spherical wave;
and (c) aberrated Plane wave.
Radio: We use the radio band of the spectrum for a wide range of uses,
including wireless communication, television and radio broadcasting,
navigation, radar and even cooking.
Infrared: Just below the range of human vision, infrared gives off heat.
About 75% of the radiation emitted by a light bulb is infrared.
9
Visible light: The range of frequencies that can be seen with the naked
eye.
Ultraviolet: Dangerous to living organisms, about 9% of the energy
radiated from the sun is ultraviolet light. Ultraviolet radiation is often used to
sterilize medical instruments because it kills bacteria and viruses.
X-Rays: An invisible form of light produced in the cosmos by gas heated
to millions of degrees. X-rays are absorbed depending on the atomic weight
of the matter they penetrate. Since x-rays affect photographic emulsion in the
same way visible light does, we can use them to take pictures of the insides of
things.
Gamma Rays: The product of radioactive decay, nuclear explosions and
violent cosmic phenomena such as supernovae. Earth's atmosphere shields us
from the cosmic rays.
The different types of radiation are distinguished by their wavelength, or
frequency, as shown in Table (1.1).
Wavelength Wavelength
Region
(Angstroms) (centimeters)
10
mo
m=
1− v2 / c2 (1.11)
Thus, since it has a finite relativistic mass m and since 0, it follows
that a photon can only exist at a speed c: the energy E is purely kinetic.
The fact that the photon possesses inertial mass leads to some rather
interesting results e.g. the gravitational red shift, and the deflection of starlight
by the sun .The red shift was actually observed under laboratory conditions in
1960 by R. V. Pound and G. A. Rebka Jr. at Harvard University. In brief if a
particle of mass m moves upward height d in the earth gravitational field it
will do work in overcoming the field and thus decrease in energy by an
amount mgd Therefore if the photons initial energy is hv its final energy after
traveling a vertical distance d will be given by:
hv = hv i − hgd
f
(1.12)
v f
< vi and so
Pound and ribka using gamma-ray photos were able to confirm that
quanta of the electromagnetic field behave as if they had a mass /
Form Eq.(1) the momentum of a photon can be written as
p = E / c = hv / c (1.13)
or
p = h/v (1.14)
If we had a perfectly monochromatic beam of light of wave length each
constituent photon would possess a momentum of / , equivalently
p = hk (1.15)
We can arrive at this some end by way of a some what different route.
Momentum quite generally is the product of mass and speed thus
p = mc = E / c (1.16)
The momentum relationship ( / )for photon was confirmed in 1923
by Arthur holly Compton (1892-1962). In a classic experiment he irradiated
12
electrons with x-ray quanta and studied the frequency of the scattered photon.
By applying the laws of conservation of momentum and energy
relativistically as if the collisions were between particles Compton was able to
account for an otherwise inexplicable decrease in the frequency of the
scattered radiant energy.
A few years later in Francw Louis Victor Prince De broglie (b.1891) in
his doctoral thesis drew a marvelous analogy between photons and matter
particles. He proposed that every particle and not just the photon should have
an associated wave nature. Thus since / the wavelength of a particle
having a momentum m v would then be:
λ = h / mv (1.17)
1.5.1 Reflection:
The first property of light we consider is reflection from a surface, such
as that of a mirror. This is illustrated in Figure (1.4).
13
Figuree (1.4): La
aw of refleection
When light is refflected offf any surrface, the angle off incidencce θ1 is
alwaays equal to the anngle of refflection θ2. The angles are aalways meeasured
mal to the surface.
withh respect too the norm
The law of reflecttion is alsoo consisteent with thhe particlee picture of
o light.
Tablle (1.2) shhows the variation
v o refractio
of on index of
o glass.
C
Color Wavelength Indexx of Refraaction
b
blue 4344 nm 1.528
1.5.22 Refracttion:
Refractioon is the bending of light as it passes betweeen materrials of
diffeerent opticcal densitty. While the index
x of Refraaction of a materiall is the
ratioo of the sppeed of ligght in vacuuum to thee speed of light in thhat materiaal:
(1.18)
(
where v is
i the speeed of lightt in the maaterial.
14
The more dense the material, the slower the speed of light in that
material. Thus 1 for all materials, and increases with increasing density.
1 in vacuum.
The frequency of light does not change when it passes from one medium
to another. According to the formula v = λf, the wavelength must change. The
index of refraction can therefore be written in terms of wavelengths as:
(1.19)
(1.20)
where v1 and are the speed and wavelength in medium 1, etc. This is
illustrated in Figure (1.5).
15
This relationship between the angles is called Snell's Law. The relation
between the two angles is the same whether the ray is moving from medium 1
to 2 (so that θ1 is the angle of incidence and θ2 is the angle of refraction) or
whether the ray moves from medium 2 to medium 1, so that θ2 is the angle of
incidence and θ1 is the angle of refraction.
16
In general shorter Wavelengths (i.e. light towards the blue end of the
spectrum) have higher indices of refraction and get bent more than light with
longer wavelengths (towards the red end).
1.5.3 Diffraction:
Huygens’ Principle tells us that a “new” wavefront of a traveling wave
may be constructed at a later time by the envelope of many wavelets
generated at the “old” wave front. One assumes that a primary wave generates
fictitious spherical waves at each point of the “old” wavefront. The fictitious
spherical wave is called Huygens’ wavelet and the superposition of all these
wavelets results in the “new” wavefront. This is schematically shown in
Figure (1.6). The distance between the generating source points is infinitely
small and therefore, integration has to be applied for their superposition.
17
A
Applying this division process to an
n open apperture, thhe inciden
nt wave
geneerates new
w waves inn the planne of the aperture,
a a these newly gen
and nerated
wavves have fixed phaase relatioons with the inciddent wavee and wiith one
anotther. We assume
a thhat all wavves generaated by thee incidentt wave pro
opagate
onlyy in the foorward dirrection, annd not bacckward to the sourcee of light.. Let us
n on a slitt (Figure 1.7). The observed pattern depends
conssider the diffraction
d d
t waveleength andd the size of the op
on the pening. A slit of a width of several
ordeers of maggnitude larrger than the
t wavellength of the
t incidennt light will
w give
us almost the geometriccal shadow
w (Figure 1.7-a). A slit of widdth of an order
o or
two larger thaan the wavvelength will
w bend the light and
a fringees will occcur; see
Figuure (1.7-b)). A slit sm
maller thann the wav w shown intensity pattern
velength will
withh no fringees and deccreasing intensity
i for
f larger angles;
a seee Figure (1.7-c).
w small deformations of thhe wavefront close to the
All openings will show
edgees of the slit.
18
19
1.5.4 Polarization:
Corresponding to the electromagnetic theory of light it is compound from
electric field and magnetic field, they vibrating in the plane perpendicular to
each other and perpendicular to the direction of light wave propagation, and
in the natural light the electric field will vibrate in all perpendicular direction
of the light. When the natural light is incident on a polarizer like Nicole prism
or same type crystals then the transmitted light will be polarized partially or
complete or the polarizer will allow only to the electric field compound that
vibration parallel to the polarizer axis ,and when the polarized light passed
through another polarizer (analyzer) the intensity of outer light will depend on
the angle between the transmission direction of polarizer and analyzer ( ) and
the amplitude of the transmitted light (A) will give by:
(1.22)
then the intensity of the light from the second polarizer (analyzer) will give
by
(1.23)
and this is the maul’s law
A retarder can be made from any birefringent material, that is, any
material whose refractive index depends on direction. As an example, let us
take the uniaxial crystal characterized by refractive indices ne and no. The
orthogonal linearly polarized component waves are the e-wave and the o-
wave. It is further assumed that the front and back surfaces of the retarder are
parallel to the optic axis of the crystal, and the propagation direction of the
incident light is normal to the front surface of the retarder. In this situation,
the directions of the component e-wave and o-wave do not separate as they
propagate through the retarder; rather, they emerge together. Depending on
which is smaller, ne or no, one of the component waves moves through the
retarder faster than the other, as shown in Figure (1.8).
20
21
22
| | 55
| | 55
and the corresponding real expressions are
cos (1.27)
cos ∆ (1.28)
The phasor circle C1 in Figure (1.9) represents Eq. (1.27) and C2
represents Eq. (1.28). As time progresses, both phasors rotate at the same
angular velocity as (exp jωt) (for now a fixed z), or clockwise as indicated by
0, 1, 2, 3, . . . , 11. The phase of however, lags by because of the retarder.
The projection from the circumference of circle C1 onto the x axis represents
Ex, and that from the C2 circle onto the y axis represents Ey. It should be noted
that the phase angle ωt in C1 is with respect to the horizontal axis and ωt + ∆
in C2 is with respect to the vertical axis.
By connecting the cross points of the projections from 0, 1, 2, 3, . . . , 11
on each phasor circle, the desired vectorial sum of Ex and Ey is obtained. The
emergent light is elliptically polarized with left-handed or counterclockwise
rotation. Next, the case when the fast axis is not necessarily along the x axis
will be treated. For this example, a retarder with ∆ = 90o will be used.
23
24
F
Figure (1..12): A schematic of helson interferometter.
o the Mich
Chapter Two
Young double slit Experiment
2.1 Introduction:
In 1801, an English physicist named Thomas Young performed an
experiment that strongly inferred the wave-like nature of light. Because he
believed that light was composed of waves, Young reasoned that some type of
interaction would occur when two light waves met. This interactive tutorial
explores how coherent light waves interact when passed through two closely
spaced slits.
The tutorial initializes with rays from the sun being passed through a
single slit in a screen to produce coherent light. This light is then projected
onto another screen that has twin (or double) slits, which again diffracts the
incident illumination as it passes through. The results of interference between
the diffracted light beams can be visualized as light intensity distributions on
the dark film, as shown in Figure (2.1). The slider labeled distance between
slits can be utilized to vary the distance between the slits and produce
corresponding variations in the interference intensity distribution patterns.
Young's experiment was based on the hypothesis that if light were wave-
like in nature, then it should behave in a manner similar to ripples or waves on
a pond of water. Where two opposing water waves meet, they should react in
a specific manner to either reinforce or destroy each other. If the two waves
are in step (the crests meet), then they should combine to make a larger wave.
In contrast, when two waves meet that are out of step (the crest of one meets
the trough of another) the waves should cancel and produce a flat surface in
that area.
27
28
If d < < L then the difference in path length traveled by the two
rays is approximately:
(2.1)
Where θ is approximately equal to the angle that the rays make relative to
a perpendicular line joining the slits to the screen.
If the rays were in phase when they passed through the slits, then the
condition for constructive interference at the screen is:
, 1, 2, 3, … … (2.2)
whereas the condition for destructive interference at the screen is:
, 1, 2, 3, … … (2.3)
The points of constructive interference will appear as bright bands on the
screen and the points of destructive interference will appear as dark bands.
These dark and bright spots are called interference fringes.
29
In the case that y (the distance from the interference fringe to the point of
the screen opposite the center of the slits) is much less than L ( y < < L ), one
can use the approximate formula:
/ (2.4)
so that the formulas specifying the y - coordinates of the bright and dark
spots, respectively are:
∆ (2.7)
If d < < L then the spacing between the interference can be large even
when the wavelength of the light is very small (as in the case of visible light).
This gives a method for (indirectly) measuring the wavelength of light.
The above formulas assume that the slit width is very small compared to
the wavelength of light, so that the slits behave essentially like point sources
of light.
Finally, the uses of Young’s double slit experiment are:
1. Young’s double slit experiment provides a method for measuring
wavelength of light.
2. This experiment gave the wave model of light a great deal of
credibility.
3. It is inconceivable that particles of light could cancel each other.
F
Figure (2..4): Actuaal (non-ideeal) doublle-slit interrference ppattern.
31
1 cos (2.10)
sinc (2.11)
where the zeros of the function occur when the argument is an integer.
The intensity variation in the y direction is due to diffraction only and is not
shown. Since the two slits are assumed to be illuminated by a single source,
there are no coherence effects introduced by using a pinhole or slit of finite
size. The term is included in Eq. (2.10) to account for variations in the
fringe visibility. These could be due to unequal illumination of the two slits, a
phase difference of the light reaching the slits, or a lack of temporal or spatial
coherence of the source .
32
2.6 Repetition:
By replacing a double slit with a triple slit, Figure (2.5-a). We can think of
this as a third repetition of the structures that were present in the double slit,
as can be shown in Figures (2.5-b) and (2.5-c). For ease of visualization, we
have violated our usual rule of only considering points very far from the
diffracting object. The scale of the drawing is such that a wavelengths is one
cm. In (2.5-b), all three waves travel an integer number of wavelengths to
reach the same point, so there is a bright central spot, as one would expect
from the experience with the double slit. In Figure (2.5-c), it shows the path
lengths to a new point. This point is farther from slit A by a quarter of a
wavelength, and correspondingly closer to slit C. The distance from slit B has
hardly changed at all. Because the paths lengths traveled from slits A and C
differ from half a wavelength, there will be perfect destructive interference
between these two waves. There is still some un canceled wave intensity
because of slit B, but the amplitude will be three times less than in Figure
(2.5-b), resulting in a factor of 9 decrease in brightness.
Thus, by moving off to the right a little, one can gone from the bright
central maximum to a point that is quite dark.
33
(a)
(b)
(c)
Figure (2.5): (a) A triple slit.
(b) There is a bright central maximum.
(c) At this point just off the central maximum, the path
Lengths traveled by the three waves have changed.
Now let’s compare with what would have happened if slit C had been
covered, creating a plain old double slit. The waves coming from slits A and
B would have been out of phase by 0.23 wavelengths, but this would not have
caused very severe interference. The point in Figure (2.5-c) would have been
quite brightly lit up.
To summarize, by adding a third slit narrows down the central fringe
dramatically. The same is true for all the other fringes as well, and since the
same amount of energy is concentrated in narrower diffraction fringes, each
fringe is brighter and easier to see, Figure (2.6).
34
35
sin 0 2.15
cos 0 2.16
where
2.18
cos 2.19
sin 2.20
36
and 1,2,3, …. Note that the coefficient of the constant term has
been written in a special form compared to the general form for a generalized
Fourier series in order to preserve symmetry with the definitions of and
.
A Fourier series converges to the function (equal to the original
function at points of continuity or to the average of the two limits at points of
discontinuity)
(2.21)
́
2.23
37
∞ ∞
́ ́
́ cos sin 2.24
Therefore,
́ ́ 2.25
́
́ cos ́ 2.26
́
́ sin ́ 2.27
́ ́ 2.28
́
́ cos ́ 2.29
́
́ sin ́ 2.30
38
2.31
39
40
41
Chapter Three
Interference Simulation
3.1 Introduction:
The first serious challenge to the particle theory of light was made by the
English scientist Thomas Young in 1803. He reasoned that if light were
actually a wave phenomenon, as he suspected, then a phenomenon of
interference effect should occur for light. This line of reasoning lead Young to
perform an experiment which is nowadays referred to as Young's double-slit
experiment.
The present works is an attempt to study the interference pattern
produced by Young’s experiment of coherence light field using the Fast
Fourier Transformation Matlab commend, hopefully to be clear. However, the
Young’s double slit experiment is connect to so many basic concepts in
optical physics (and still provides surprising new results to this day) that one
post is hardly enough to describe all the interesting insights that can be gained
by studying the experiment and its implications.
Simulation is an important feature in physics systems or any system that
involves many processes. Most engineering simulations entail mathematical
modeling and computer assisted investigation. There are many cases,
however, where mathematical modeling is not reliable. Simulation of fluid
dynamics problems often require both mathematical and physical simulations.
In these cases the physical models require dynamic similitude. Physical and
chemical simulations have also direct realistic uses, rather than research uses.
The power of simulation is that (even for easily solvable linear systems)
a uniform model execution technique can be used to solve a large variety of
systems without resorting to choose special-purpose and sometimes arcane
solution methods to avoid simulation.
42
43
10
20
30
40
50
60
10 20 30 40 50 60
10
20
30
40
50
60
10 20 30 40 50 60
44
16
14
12
10
0
0 10 20 30 40 50 60 70
Fig(3.3): The intensity of fringes in the center of the screen for double slit.
Fig(3.4): The intensity of fringes for the double slit on the screen.
An attempted has been made to study the effect of width of the slits on
the interference pattern. The sketch of the two different width slits was shown
in Figure (3.5). The interference pattern that obtained for this configuration
45
was shown in Figure (3.6). While Figures (3.7) and (3.8) shows the intensity
as a function of distance. It was clear from these figures the intensity of all the
bright fringes increases due to increase of the width of one slit.
10
20
30
40
50
60
10 20 30 40 50 60
10
20
30
40
50
60
10 20 30 40 50 60
40
35
30
25
20
15
10
0
0 10 20 30 40 50 60 70
Fig(3.7): The intensity of fringes in the center of the screen for different width
double slit.
Fig(3.8): The intensity of fringes for the double slit of different width on the
screen.
47
10
20
30
40
50
60
10 20 30 40 50 60
48
10
20
30
40
50
60
10 20 30 40 50 60
70
60
50
40
30
20
10
0
0 10 20 30 40 50 60 70
Fig(3.11): The intensity of fringes in the center of the screen for diagonal
double slit.
49
50
An attempted has been made to study the interference pattern for a single
slit. Due to the assumption that the slit have constant values, the intensity of
the interference pattern obtained for single slit shows also constant value
everywhere, which is contrary to the theoretical aspects. This contravention
can be corrected by taken the values of the slit as a Gaussian configuration
instead of constant values. By this assumption, the effect of diffraction is
taking in to account as well as the interference phenomena.
51
10
20
30
40
50
60
10 20 30 40 50 60
10
20
30
40
50
60
10 20 30 40 50 60
52
40
35
30
25
20
15
10
0
0 10 20 30 40 50 60 70
Fig(3.15): The intensity of fringes in the center of the screen for a three slits.
53
10
20
30
40
50
60
10 20 30 40 50 60
54
10
20
30
40
50
60
10 20 30 40 50 60
100
90
80
70
60
50
40
30
20
10
0
0 10 20 30 40 50 60 70
Fig(3.19): The intensity of fringes in the center of the screen for five slits.
55
56
10
20
30
40
50
60
10 20 30 40 50 60
10
20
30
40
50
60
10 20 30 40 50 60
57
200
180
160
140
120
100
80
60
40
20
0
0 10 20 30 40 50 60 70
Fig(3.23): The intensity of fringes in the center of the screen for seven slits.
58
3.7 Conclusions:
An attempted has been made to describe the interference of two waves in
a simple way, using command FFT from MATLAB. The classical experiment
by Young was performed to demonstrate the wave interference theory of
light. The result of the double-slit and motley-slits experiment shows the same
tendency as that of theoretical. Whereas, the diffraction due to single slit can
not be represented in this study, until the program to be modified by
considering the value of the slit as a Gaussian configuration instead of
constant values.
The simulation of double-slit experiment shows the intensity of the
central fringe is some larger than the other, if away from the central fringe the
intensity of fringes decrease. While the progression to a larger number of slits
shows a pattern of narrowing the high intensity peaks and a relative increase
in their peak intensity.
The result of this project shows that the FFT is a powerful technique to
studies the interference and diffraction of the wave. For more reliability
simulation the Gaussian function could be used to express the slits instead of
the constant values which was established in present work.
59
References
1 Keigolizuka, “Element of Photonics”, Wily‐Interscince, Ajohn Wiley &
Sons, INC, University of Toranto, (2000).
2 K. D. Moller, “Optics Learning by Computing, with Examples Using
Mathcad, Matlab, Mathematica, and Maple”, Second Edition, Springer
Science‐Business Media, LLC, (2007).
3 Joseph W. Goodman, “Introduction to Fourier Optics”, second edition,
The McGraw‐Hill Companies, Inc., (1996).
4 Eugene Hecht, and Alfred Zajac, “Optics”, Adelphi University, Addison‐
Wesley Publishing Company, Inc., (1994).
5 http://farside.ph.utexas.edu/teaching/316/lectures/node151.html
6 http://skullsinthestars.com/2009/03/28/optics‐basics‐youngs‐double‐
slit‐experiment/
7 http://en.wikipedia.org/wiki/Double‐slit_experiment
8 http://theory.uwinnipeg.ca/physics/light/node9.html
9 http://www.matter.org.uk/schools/content/interference/laserinterfere
nce.html
10 http://hyperphysics.phy‐astr.gsu.edu/hbase/ems1.html
11 http://class.phys.psu.edu/251Labs/10_Interference_&_Diffraction/Sin
gle_and_Double‐Slit_Interference.pdf
60
Appendix
clear all
%sep=input(' slit separation value ');
sep=4;
% Duble slits
g1=zeros(64,64);
g1(33‐sep,33)=1;
g1(34‐sep,33)=1;
g1(33+sep,33)=1;
g1(34+sep,33)=1;
colormap('gray');
imagesc(g1);
pause
gf1=fft2(g1,64,64);
for j=1:64
for i=1:64
rv=real(gf1(i,j));
iv=imag(gf1(i,j));
mod1(i,j)=(rv*rv+iv*iv);
end
end
mod11=fftshift(mod1);
colormap('gray')
imagesc(mod11);
pause
plot(mod11(:,33));
pause
surf(mod11);
pause
% Effect of width of the slits
g2=zeros(64,64);
g2(33‐sep,33)=1;
g2(34‐sep,33)=1;
g2(33+sep,33)=1;
g2(34+sep,33)=1;
g2(33+sep,32)=1;
g2(34+sep,32)=1;
imagesc(g2);
pause
gf2=fft2(g2,64,64);
for j=1:64
61
for i=1:64
rv=real(gf2(i,j));
iv=imag(gf2(i,j));
mod2(i,j)=(rv*rv+iv*iv);
end
end
mod22=fftshift(mod2);
imagesc(mod22);
pause
plot(mod22(:,33));
pause
surf(mod22);
pause
% Diagonal double slits
g3=zeros(64,64);
g3(33‐sep,33‐sep)=1;
g3(33‐sep,32‐sep)=1;
g3(32‐sep,32‐sep)=1;
g3(32‐sep,33‐sep)=1;
g3(33+sep,33+sep)=1;
g3(33+sep,32+sep)=1;
g3(32+sep,32+sep)=1;
g3(32+sep,33+sep)=1;
imagesc(g3);
pause
gf3=fft2(g3,64,64);
k=0;
for j=1:64
for i=1:64
vr=real(gf3(i,j));
vi=imag(gf3(i,j));
mod3(i,j)=vr*vr+vi*vi;
end
end
mod33=fftshift(mod3);
for j=1:64
for i=1:64
if i==j;
k=k+1;
v(k)=mod33(i,j);
end
end
end
62
imagesc(mod33);
pause
plot(v);
pause
surf(mod33);
pause
% Single slit
g4=zeros(64,64);
g4(33,33)=1;
imagesc(g4);
pause
fg4=fft2(g4,64,64);
for j=1:64
for i=1:64
rv=real(fg4(i,j));
vi=imag(fg4(i,j));
mod4(i,j)=rv*rv+vi*vi;
if j==33;
v(i)=mod4(i,j);
end
end
end
imagesc(mod4);
pause
plot(v);
pause
surf(mod4);
pause
% Multiple slits (three slits)
g5=zeros(64,64);
g5(33‐sep,33)=1;
g5(34‐sep,33)=1;
g5(33,33)=1;
g5(34,33)=1;
g5(33+sep,33)=1;
g5(34+sep,33)=1;
imagesc(g5);
pause
fg5=fft2(g5,64,64);
fg55=fftshift(fg5);
for j=1:64
for i=1:64
rv=real(fg55(i,j));
63
vi=imag(fg55(i,j));
mod5(i,j)=rv*rv+vi*vi;
if j==33;
v(i)=mod5(i,j);
end
end
end
imagesc(mod5);
pause
plot(v);
pause
surf(mod5);
pause
% Five slits
g6=zeros(64,64);
g6(33‐2*sep,33)=1;
g6(33‐sep,33)=1;
g6(33,33)=1;
g6(33+sep,33)=1;
g6(33+2*sep,33)=1;
g6(34‐2*sep,33)=1;
g6(34‐sep,33)=1;
g6(34,33)=1;
g6(34+sep,33)=1;
g6(34+2*sep,33)=1;
imagesc(g6);
pause
fg6=fft2(g6,64,64);
fg66=fftshift(fg6);
for j=1:64
for i=1:64
rv=real(fg66(i,j));
vi=imag(fg66(i,j));
mod6(i,j)=rv*rv+vi*vi;
if j==33;
v(i)=mod6(i,j);
end
end
end
imagesc(mod6);
pause
plot(v);
pause
surf(mod6);
64
pause
% Seven slits
g7=zeros(64,64);
g7(33‐3*sep,33)=1;
g7(33‐2*sep,33)=1;
g7(33‐sep,33)=1;
g7(33,33)=1;
g7(33+sep,33)=1;
g7(33+2*sep,33)=1;
g7(33+3*sep,33)=1;
g7(34‐3*sep,33)=1;
g7(34‐2*sep,33)=1;
g7(34‐sep,33)=1;
g7(34,33)=1;
g7(34+sep,33)=1;
g7(34+2*sep,33)=1;
g7(34+3*sep,33)=1;
imagesc(g7);
pause
fg7=fft2(g7,64,64);
fg77=fftshift(fg7);
for j=1:64
for i=1:64
rv=real(fg77(i,j));
vi=imag(fg77(i,j));
mod7(i,j)=rv*rv+vi*vi;
if j==33;
v(i)=mod7(i,j);
end
end
end
imagesc(mod7);
pause
plot(v);
pause
surf(mod7);
pause
65