有会相位恢复算法的吗?能帮我看看下面的代码错哪儿了吗?不胜感激 >=rniHs=?7
^x*J4jl
2d centered Fourier transform,居中的傅里叶变换 b"@-9ke5I
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9FC_B+7
% Citation for this code and algorithm: _\+0e:Ae
% Tatiana Latychevskaia and Hans-Werner Fink #2\M(5d
% "Practical algorithms for simulation and reconstruction of digital in-line holograms", *fd:(dN|
% Appl. Optics 54, 2424 - 2434 (2015) 5Th\wTh04
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% G~_eBy
% The code is written by Tatiana Latychevskaia, 2002 qDg`4yX.}
% The version of Matlab for this code is R2010b .rg "(I
+R$;LtR
function [out] = FT2Dc(u0); ^4JK4+!Zfq
rx]Q,;"
[Nx, Ny] = size(1i,1j); h`Ej>O7m
6qV1_M#
f1 = zeros(Nx,Ny); rY&lx}
MS2/<LD3d
for ii = 1:Nx ~D/Lo$K"
for jj = 1:Ny kyJKai
f1(ii,jj) = exp(1i*pi*(ii + jj)); CXu$0DQ(
end 3>5gh8!-
end V[^AV"V
1h162
FT = fft2(f1.*in); \Rt>U|%
#mM9^LJ
out = f1.*FT; "a _S7K
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%