各位大佬帮忙看看我写的一个离轴全息的程序,不知道错在哪里了
首先是输入一个球面波
lamda = 4.25e-6;
x_min=10e-5;
y_min=10e-5;
D=1;
N=1280;
M=1024;
x=linspace(-(N/2)*x_min,(N/2)*x_min,N);
y=linspace(-(M/2)*y_min,(M/2)*y_min,M);
[X,Y]=meshgrid(x,y);
r=sqrt(D^2+X.^2+Y.^2);
object_wave=exp(1i*2*pi/lamda.*r)./r;
然后加入一个参考波进去
reference_wave=exp(1i*2*pi/lamda.*(x_dot.*cosd(theta)+y_dot.*sind(theta)));
hologram=reference_wave+object_wave;
I_holo=hologram.*conj(hologram);
再重建
function [restruction] = off_restruction(hologram,lamda,D,theta,x_min,y_min,N,M)
x=linspace(-640*x_min,640*x_min,N);
y=linspace(-512*y_min,512*y_min,M);
[X_dot,Y_dot]=meshgrid(x,y);
reference_wave=exp(1i*2*pi/lamda.*(x.*cosd(theta)+D*sind(theta)));
r_hologram=reference_wave.*hologram;
phase_one = exp(1i*2*pi/lamda*D)/1i/lamda/D*exp(1i*2*pi/lamda/2/D.*(X_dot.^2+Y_dot.^2));
phase_two = exp(1i*2*pi/lamda/2/D.*(X_dot.^2+Y_dot.^2));
restruction = fftshift(fft2(r_hologram.*phase_two)).*phase_one;