how do i simulate a 4f correlator

조회 수: 15 (최근 30일)
eden london
eden london 2016년 6월 9일
답변: eden london 2016년 6월 9일
im trying to simulate a 4f correlator, and for some reason i cant get it to work. The code that simulates the 4f correlator is this:
[xgrid ygrid]=meshgrid(1:1024);
grid=(xgrid-512).^2 +(ygrid-512).^2;
lens=exp((1i*pi*(pixsize^2)/((-f)*w)).*grid);
move=fft2(exp((1i*pi*(pixsize^2)/(f*w)).*grid));
img=padarray(h1cof,[pf pf]);
bl1=ifftshift(ifft2(fft2(img).*move));
al1=bl1.*lens;
bh2=ifftshift(ifft2(fft2(al1).*move));
ah2=bh2.*padarray(h2ft,[pf pf]);
bl2=ifftshift(ifft2(fft2(ah2).*move));
al2=bl2.*lens;
rescof=ifftshift(ifft2(fft2(al2).*move));
where f is the focal length and w the wavelength

답변 (1개)

eden london
eden london 2016년 6월 9일
I think the problem might be due to scaling in the fourier domain. can't seem to solve it though..

카테고리

Help CenterFile Exchange에서 Optics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by