### Computational holography

#### by alex

For quite some years during high school and some of my early bachelor years, I used to work on holography, sometimes doing it from a more scientifically perspective (interferometry, …) and sometimes doing it more for the fun of it (just as people do photography, but in this case you can get a nice 3D image out of it ðŸ™‚ ).

In 2006 while I was a bachelor student, I decided to do something with computer generated holograms (CGH). Here’s some basic stuff based on T. Walker, *Holography without photography*, A. J. Phys **67**(9), Sep. 1999.

The diffraction patterns were generated using this code (Matlab) using a slow DFT (nowadays I would completely change this, but unfortunately I have no time):

%-------------------------------

% CGH

%

% Created by Alexandre Lopes

% Universidade de Aveiro

%

% Based on Walker, Holography without photography

% 2006

%-------------------------------

```
```clear all

hi = clock

R = 75;

N = 300;

thr = 0.6;

f = 0.15; %m

lambda = 633*10^(-9); % m

tobj = 0.0004; % object size (m)

tholo = 0.0254; % hologram size (m)

o = tobj/R;

h = tholo/N;

% A - matrix with initial image:

% 1 for white

% 0 for black

% A,B -> RxR matrix

% Holo -> NxN matrix

A=imread('A preto.bmp');

Holo = zeros(N);

% DFT

for row=0:R-1

for col=0:R-1

randphi = rand*2*pi;

for X=0:N-1

for Y=0:N-1

Holo(X+1,Y+1)= Holo(X+1,Y+1)+ A(row+1,col+1)*cos(2*pi ...

/(lambda*f)*(o*h)*(X*row+Y*col)+ randphi);

end

end

end

end

maxholo = max(max(Holo));

minholo = min(min(Holo));

for I=1:N;

for J =1:N;

if ((Holo(I,J)-minholo)/(maxholo-minholo))>thr %Threshold

B(I,J) = 1; % White pixel

else

B(I,J) = 0; % Black pixel

end

end

end

`imwrite(B,'C:\out.bmp','bmp')`

hfinal = clock

and printed on transparencies using a laser printer.

The setup consisted of a HeNe laser, plus a spatial filter (which is not really necessary) and a plano-convex lens (see this).

That we can reconstruct the original image, is explained by Fourier optics and the Fraunhofer diffraction produced by the transparency (see this, I won’t go into details right now, maybe I will do this if I ever find the time).

Note that as the image is projected on a wall, there’s no 3D image (and it was anyway not encoded in the diffraction pattern).