# 5.8: Numerical Experiment (Interference Patterns)

Let's add two sinusoids whose amplitudes and frequencies are identical and whose phases are different:

$x(t)=A\cos(ωt+φ)+A\cos(ωt+φ+ψ)$

Show analytically that this sum has the phasor representation

$X=2A\cos(\frac ψ 2)e^{j[φ+(ψ/2)]}$

Interpret this finding. Then write a MATLAB program that computes and plots complex $$X$$ on the complex plane as $$ψ$$ varies from 0 to $$2π$$ and that plots magnitude, $$|X|$$, and phase, $$\mathrm{arg}X$$, versus the phase angle $$ψ$$. (You will have to choose $$ψ=n\frac {2π} N$$, $$n=0,1,...,N−1$$, for a suitable $$N$$.) When do you get constructive interfelence and when do you get destructive interference? Now compute and plot $$x(t)$$ versus $$t$$ (you will need to discretize $$t$$) for several interesting values of $$ψ$$. Explain your interference results in terms of the amplitude and phase of $$x(t)$$ and the magnitude and phase of $$X$$. Use the subplots discussed in "An Introduction to MATLAB" to plot all of your results together.