% % % This function displays the impulse response for a coherent % % % The first bit calculates the Fresnel diffraction to the lens % % In these simulations, we choose to work in units of wavelength*2*10^3 % % range=0.2; npoints=512; step=range/npoints; lamda=5*10^(-4); objectdistance=10; imagedistance=10; focallength=5; scale=-range/2:step:range/2-step; ftscale=(npoints/range^2)*scale; [x,y]=meshdom(scale,scale); [fx,fy]=meshdom(ftscale,ftscale); % Assume that the input is a delta function % fi=zeros(npoints); fi(npoints/2,npoints/2)=1; dt=fftshift(fft2(fftshift(fi))); ff=pup(-lamda*imagedistance*fx,-lamda*imagedistance*fy); ft=ff.*dt; fa=fftshift(ifft2(fftshift(ft))); figure(1); colormap('hot'); axis('square'); imagesc(scale,scale,abs(fa));