logo资料库

菲涅尔圆孔衍射matlab仿真.docx

第1页 / 共1页
资料共1页,全文预览结束
>> lamda=632.8e-6; >> k=2*pi/lamda; >> z=1000000; >> N=300; >> r=12;a=1;b=1; >> l=zeros(N,N); >> [m,n]=meshgrid(linspace(-N/2,N/2,N)); >> D=((m-a).^2+(n-b).^2).^(1/2); >> i=find(D<=r); >> l(i)=1; >> q=exp(j*k*(m.^2+n.^2)/2/z); >> subplot(2,2,1); >> imagesc(l) >> colormap([0 0 0;1 1 1]) >> axis image >> title('颜射屏形状') >> L=300; >> M=300; >> [x,y]=meshgrid(linspace(-L/2,L/2,M)); >> h=exp(j*k*z)*exp((j*k*(x.^2+y.^2))/(2*z))/(j*lamda*z); >> H=fftshift(fft2(h)); >> B=fftshift(fft2(l)); >> G=H.*B; >> U=fftshift(ifft2(G)); >> Br=(U/max(U)); >> subplot(2,2,2); >> imshow(abs(U)); >> axis image; >> colormap(hot) >> % figure,imshow(C); >> title('衍射后的图样'); >> subplot(2,2,3); >> mesh(x,y,abs(U)); >> subplot(2,2,4); >> plot(abs(Br))
分享到:
收藏