有会相位恢复算法的吗?能帮我看看下面的代码错哪儿了吗?不胜感激 DP *$@5
^?q(fK%
2d centered Fourier transform,居中的傅里叶变换 W?N+7_%'
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% bF;|0X$
x
% Citation for this code and algorithm: "N EKz
% Tatiana Latychevskaia and Hans-Werner Fink ]$.w
I~J%
% "Practical algorithms for simulation and reconstruction of digital in-line holograms", wsR\qq
% Appl. Optics 54, 2424 - 2434 (2015) -IDhK}C&T
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% N!tNRMTi
% The code is written by Tatiana Latychevskaia, 2002 S@
y! 0,
% The version of Matlab for this code is R2010b *. A-UoHa
YOfYa
function [out] = FT2Dc(u0); z)eNM}cF
5ff5M=M
[Nx, Ny] = size(1i,1j); XfEp_.~JM
@.dM1DN)
f1 = zeros(Nx,Ny); ;<cCT!A
*y+K{ fM1
for ii = 1:Nx
31]Vo;D
for jj = 1:Ny HFYe@ 2r
f1(ii,jj) = exp(1i*pi*(ii + jj)); 2]x,joB
end xvWP^Qkb
end .G<Or`K^i
r'|ei ,
FT = fft2(f1.*in); az}zoFl
C(KV5c
out = f1.*FT; *Hv d
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%