有会相位恢复算法的吗?能帮我看看下面的代码错哪儿了吗?不胜感激 L qdzqq
UVj1nom
2d centered Fourier transform,居中的傅里叶变换 + 3%i7
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $ Ov#^wfA
% Citation for this code and algorithm: Z&Ao;=Gp1
% Tatiana Latychevskaia and Hans-Werner Fink TATH,Sz:x
% "Practical algorithms for simulation and reconstruction of digital in-line holograms", &p6^
% Appl. Optics 54, 2424 - 2434 (2015) fw+ VR.#2H
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9G"-~C"e3
% The code is written by Tatiana Latychevskaia, 2002 (043G[H'.
% The version of Matlab for this code is R2010b 4N{5i)
ruTj#tWSo
function [out] = FT2Dc(u0); ' &j]~m
d 0CFMy6
[Nx, Ny] = size(1i,1j); Od@<L
Cv;\cI"&
f1 = zeros(Nx,Ny); 8j<+ '
R
k:k!4
for ii = 1:Nx ;|H(_J=6k
for jj = 1:Ny ^":Dk5gl
f1(ii,jj) = exp(1i*pi*(ii + jj)); >
g=u Y{Rf
end 1?N$I}?
end k=8L hO
;$>wuc'L
FT = fft2(f1.*in); 9HJA:k*k|
[V _?`M
out = f1.*FT; sksop4gu5
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%