zl程序教程

您现在的位置是:首页 >  其它

当前栏目

傅里叶变换全息图

变换 傅里叶
2023-09-11 14:15:33 时间

function [varagout]=C(varagin)
%傅里叶变换全息图

clc;
close all;
 
I=zeros(256);
I=imresize(double(rgb2gray(imread('20120810191738_K2fjT.jpeg'))),[256,256]);;
subplot(2,2,1);imshow(I);
title('256*256灰度图像')
%定义接收屏幕
L=500;
M=256;
[x,y]=meshgrid(linspace(-L/2,L/2,M));
%先设参考波为平面波
r0=1;b=800000;a=800000;
R=r0.*exp(j.*2.*pi.*(b.*y+a.*x));
%对I进行傅里叶变换,并平移
G=fftshift(fft2(fftshift(I)));
subplot(2,2,2);imshow(abs(G),[]);title('物体的频谱')
%记录面上的光场 U=G+R;
%记录面上的光强
I1=G.*conj(R)+conj(G).*R;
subplot(2,2,3);
imshow(I1);title('CCD靶面的干涉记录')
%假如显影后,复振幅的透过率正比于光强
t1=2;
%负片
r1=-1;
t=t1+r1.*(G.*conj(R)+conj(G).*R);
%全息再现过程
U=ifft2(I1);
subplot(2,2,4);imshow(abs(U));title('再现后的图像')