Contents

hg.m Plots a sample set of Hermite Gaussian Functions

Requires HERMITEP

By Chuck DiMarzio Northeastern University October 2001 Modified Nov 2008

!! This file may be copied, used, or modified for educational and
!! research purposes provided that this header information is not
!! removed or altered, and provided that the book is cited in
!! publications, as DiMarzio, Charles A., Optics for Engineers,
!! CRC Press, Boca Raton, FL, 2011.
!! http://www.crcpress.com
!! Other distribution is prohibited without permission.
%%start several modes for examples
gamma=0.5; % Gamma for display.  This looks good on my printer.
x=(-5:.1:5); % Coordinates x and y
y=(-5:.1:5);
gaussx=exp(-x.^2);  % Make the gaussian
gaussy=exp(-y.^2);
gaussian=gaussy'*gaussx;
count=0;
for n=[0,1,2,5];  % Plot various modes n,m
   for m=[0,1,3];
   	hx=hermitep(n,x);
		hy=hermitep(m,y);
		field=(hy'*hx).*gaussian;
      count=count+1;
      fig24hg(count)=figure;
      imagesc(x,y,((abs(field)).^2).^gamma);
      axis equal;
      axis off;
      title(strcat(num2str(n),':',num2str(m)));
      colormap(flipud(bone));
   end;
end;

The donut mode

hx=hermitep(1,x);
hy=hermitep(0,y);
field=(hy'*hx+1i*hx'*hy).*gaussian;
fig25=figure;imagesc(x,y,((abs(field)).^2).^gamma);
title('Donut');
axis equal;
axis off;
colormap(flipud(bone));