0% found this document useful (0 votes)
52 views1 page

On Axis Hologram

This document contains code to simulate digital holography. It loads an image, resizes it, and propagates it using angular spectrum method to simulate a hologram. It then simulates the interference and reconstructs the image.

Uploaded by

Roshini M S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views1 page

On Axis Hologram

This document contains code to simulate digital holography. It loads an image, resizes it, and propagates it using angular spectrum method to simulate a hologram. It then simulates the interference and reconstructs the image.

Uploaded by

Roshini M S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

close all;

I=imread('lena.png'); % 256_256 pixels, 8bit image


I = imresize(I,[256 256]);
I=double(I); % parameter setup
M=256;
deltax=0.001; % pixel pitch 0.001 cm (10 um)
w=633*10^-8; % wavelength 633 nm
z=25; % 25 cm, propagation distance

%Step 1: simulation of propagation using the ASM


r=1:M;
c=1:M;
[C,R]=meshgrid(c, r);
A0=fftshift(ifft2(fftshift(I)));
deltaf=1/M/deltax;% sampling period in the spectrum domain
%forward propgation
p=exp(-2i*pi*z.*((1/w)^2-((R-M/2- 1).*deltaf).^2-((C-M/2-1).*deltaf).^2).^0.5);
Az=A0.*p;
EO=fftshift(fft2(fftshift(Az)));

%Step 2: interference at the hologram plane


AV=4*(min(min(abs(EO)))+max(max(abs(EO)))); % amplitude of reference light % the
visibility can be controlled by modifying the amplitude
IH=(EO+AV).*conj(EO+AV);
subplot(2,2,1)
imshow(mat2gray(I));
title('Original Image')
axis off
subplot(2,2,2)
imshow(mat2gray(IH));
title('Hologram' )
axis off
SP=abs(fftshift(ifft2(fftshift(IH))));
subplot(2,2,3)
imshow(500.*mat2gray(SP));
title('Hologram spectrum' )
axis off

%Step 3: reconstruction
A1=fftshift(ifft2(fftshift(IH)));
Az1=A1.*conj(p);
EI=fftshift(fft2(fftshift(Az1)));
EI=mat2gray(EI.*conj(EI));
subplot(2,2,4)
imshow(EI);
title('Reconstructed image')
axis off

You might also like