有会相位恢复算法的吗?能帮我看看下面的代码错哪儿了吗?不胜感激 zpqGh
U5!f++
2d centered Fourier transform,居中的傅里叶变换 -fJ@R1]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1?|6odc
% Citation for this code and algorithm: y?n2`l7f
% Tatiana Latychevskaia and Hans-Werner Fink PgLS\_B
% "Practical algorithms for simulation and reconstruction of digital in-line holograms", UZP6x2:=
% Appl. Optics 54, 2424 - 2434 (2015) &_d/ciq1f
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |<-F|v9og
% The code is written by Tatiana Latychevskaia, 2002 =5~F6to
% The version of Matlab for this code is R2010b MJ,ZXJXs
6@q[tN7_^
function [out] = FT2Dc(u0); +xfW`[.{
.l+~)$
[Nx, Ny] = size(1i,1j); ?[VpN2*
@GQ8q]N:<
f1 = zeros(Nx,Ny); W Gw!Y1wq
kt{C7qpD
for ii = 1:Nx _/}Hqh
for jj = 1:Ny rEyz|k:
f1(ii,jj) = exp(1i*pi*(ii + jj)); 6_<s=nTX
end G4Kmt98I
end ]1d,O^S
;,=h59`
FT = fft2(f1.*in); F|l`YtZZd
F`0c?)
out = f1.*FT; "6N~2q,SW
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%