有会相位恢复算法的吗?能帮我看看下面的代码错哪儿了吗?不胜感激 O>DS%6/G
y`oj\
2d centered Fourier transform,居中的傅里叶变换 uX-^9t
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% a#]V|1*O
% Citation for this code and algorithm: ^iONC&r
% Tatiana Latychevskaia and Hans-Werner Fink `t/j6e]
% "Practical algorithms for simulation and reconstruction of digital in-line holograms", C+'-TLeu
% Appl. Optics 54, 2424 - 2434 (2015) aL:|Dr3SX
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1%_RXQVG
% The code is written by Tatiana Latychevskaia, 2002 $.D)Llcq
% The version of Matlab for this code is R2010b cAN!5?D\
4`8s]X
function [out] = FT2Dc(u0); "mQp#d/'
}-fHS;/
[Nx, Ny] = size(1i,1j); /0\g!29l<
uzHMQp
f1 = zeros(Nx,Ny); B .y}S
L(|K{vH h]
for ii = 1:Nx S
TWH2_`
for jj = 1:Ny pFH.beY
f1(ii,jj) = exp(1i*pi*(ii + jj)); \a+Q5g
end ,\i*vJ#f
end {^1O
#TNjQNg@O
FT = fft2(f1.*in); ymm]+v5S.]
0J+WCm`
out = f1.*FT; CcUF)$kz
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%