% % % script to describe a simple binary amplitude computer generated hologram % % read the desired image % targetImage=double(imread('ima.png')); targetImage=(1-sign(targetImage(1:512,50:700,2)-128))/2; yscale=linspace(1,651,512); targetImage=interp2(targetImage,yscale',(1:512)); % off set the image to separate it from the dc signal targetImage=[zeros(512),targetImage;zeros(512),zeros(512)]; figure(1);set(gcf,'color','white'); imagesc(targetImage);axis 'square'; colormap 'gray'; % create a binary amplitude hologram by assiging transmission value 1 to % positive phase and 0 to negative phase hologram=(sign(angle(fftshift(fft2(targetImage))))+1)/2; figure(2);set(gcf,'color','white'); imagesc(hologram);axis 'square'; colormap 'gray'; % % % The scene observed through the hologram will be the Fourier transform of % the holographic modulation % reconstruction=abs(fftshift(fft2(hologram))); reconstruction(513,513)=0; figure(3);set(gcf,'color','white'); imagesc(reconstruction);axis 'square'; colormap 'gray';