how do i simulate a 4f correlator
15 views (last 30 days)
Show older comments
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
0 Comments
Answers (1)
See Also
Categories
Find more on Optics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!