% Book: Laser Electronics by Verdeyen
% Problem: Chapter 7 problem 9
% Script Author: meg noah meg_noah@student.uml.edu
function Lasers_Ch7_Pr9
w=[-10,-8,-6,-4,-3,-2,-1,0,1,2,3,4,6,8,10];
g_bar=[0.005,0.009,0.016,0.037,0.066,0.140,0.305,...
        0.428,0.305,0.140,0.066,0.037,0.016,0.009,0.005];
g=exp(-w.^2);
hold off;
plot(w,g_bar,'-*r');
hold on;
v=-10:0.1:10;
%v=w;
g=exp(-v.^2);
plot(v,g);
legend(['Homogeneous '; 'Pure Doppler']);
g_bar = exp(-v.^2)-(2/sqrt(pi))*(1.0-2.0*v.*exp(-v.^2).*erfi(v))
plot(v,g_bar,'g');
% 
% v=-10:0.1:10;
% %v=w;
% g=exp(-v.^2);
% 
% 
% %g_bar = exp(-v.^2)-0.01*(2/sqrt(pi)+2*v.*exp(-v.^2).*erf(v))
% %hold off;
% %plot(v,g_bar);
% %hold on;
% %plot(v,g);

