有会相位恢复算法的吗?能帮我看看下面的代码错哪儿了吗?不胜感激 [y}0X^9,E
B9RB/vHH
2d centered Fourier transform,居中的傅里叶变换 sacaL4[_<
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% OXs-gC{b
% Citation for this code and algorithm: 2%'iTXF
% Tatiana Latychevskaia and Hans-Werner Fink .*N,x0B(
% "Practical algorithms for simulation and reconstruction of digital in-line holograms", C[ ehw
% Appl. Optics 54, 2424 - 2434 (2015) Fx.hti
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% w{t2Oo6Q0+
% The code is written by Tatiana Latychevskaia, 2002 w}<CH3cx
% The version of Matlab for this code is R2010b <=
xmJx-V
G02(dj
function [out] = FT2Dc(u0); =W6AUN/%p
8()L }@y
[Nx, Ny] = size(1i,1j); *.UM[Wo
WdGjvs
f1 = zeros(Nx,Ny); ~L G).
d+_wN2
for ii = 1:Nx &!uNN|W
for jj = 1:Ny ~@x@uY$5
f1(ii,jj) = exp(1i*pi*(ii + jj)); $W46!U3
end Y7yh0r_
end R)AFaP |
Rl7V~dUY
FT = fft2(f1.*in); d3fF|Wp1
n1n1}
out = f1.*FT; pv.0!a/M
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%