how do i simulate a 4f correlator

12 ビュー (過去 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 Center および File ExchangeOptics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by