% % Optical Imaging and Spectroscopy % % David J. Brady % Duke University % www.opticalimaging.org % % Figure 3.7 % % % % DFT analysis of Fresnel transform of Gaussian fn % figure(1);set(gcf,'color','white'); X=20; N=4096; xrange=linspace(-X,X,N); xStep=xrange(3)-xrange(2); urange=(-N/(4*X)):(1/(2*X)):(N/2-1)/(2*X); gx=exp(-pi*(xrange.^2)); subplot(6,1,1);plot(xrange,gx,'-k');set(gca,'XTick',[]); tau=.5; gxp=exp(i*pi/4)*exp(-pi*(xrange.^2)/(1+i*tau^2))/sqrt(1+i*tau^2); fresnelT=exp(i*pi/4)*exp(i*pi*tau^2*(urange.^2)); ftG=ifft(fftshift(fresnelT).*fft(gx)); subplot(6,1,2);plot(xrange,[abs(ftG);real(ftG);imag(ftG)],'-k'); set(gca,'XTick',[]); tau=1; gxp=exp(i*pi/4)*exp(-pi*(xrange.^2)/(1+i*tau^2))/sqrt(1+i*tau^2); fresnelT=exp(i*pi/4)*exp(i*pi*tau^2*(urange.^2)); ftG=ifft(fftshift(fresnelT).*fft(gx)); subplot(6,1,3);plot(xrange,[abs(ftG);real(ftG);imag(ftG)],'-k'); tau=2;set(gca,'XTick',[]); gxp=exp(i*pi/4)*exp(-pi*(xrange.^2)/(1+i*tau^2))/sqrt(1+i*tau^2); fresnelT=exp(i*pi/4)*exp(i*pi*tau^2*(urange.^2)); ftG=ifft(fftshift(fresnelT).*fft(gx)); subplot(6,1,4);plot(xrange,[abs(ftG);real(ftG);imag(ftG)],'-k'); tau=4;set(gca,'XTick',[]); gxp=exp(i*pi/4)*exp(-pi*(xrange.^2)/(1+i*tau^2))/sqrt(1+i*tau^2); fresnelT=exp(i*pi/4)*exp(i*pi*tau^2*(urange.^2)); ftG=ifft(fftshift(fresnelT).*fft(gx)); subplot(6,1,5);plot(xrange,[abs(ftG);real(ftG);imag(ftG)],'-k'); tau=8;set(gca,'XTick',[]); gxp=exp(i*pi/4)*exp(-pi*(xrange.^2)/(1+i*tau^2))/sqrt(1+i*tau^2); fresnelT=exp(i*pi/4)*exp(i*pi*tau^2*(urange.^2)); ftG=ifft(fftshift(fresnelT).*fft(gx)); subplot(6,1,6);plot(xrange,[abs(ftG);real(ftG);imag(ftG)],'-k'); %title(['\tau=' num2str(tau)]);