problem with MATLAB unwrap() function ?
显示 更早的评论
Hi,
Step 1: I created a 2D phase function.
x = -1:1/128:1-(1/128);
[X,Y] = meshgrid(x,x);
phi = 3*pi*X.^2 + 3*pi*Y.^2;
Step 2: I wrapped it from -pi tp +pi.
wrapped_phi = phi; % copy phase to another 2D array
for vrt = 1:1:256
for hrz = 1:1:256
x = phi(vrt,hrz);
if (x > pi)
k = round(x/(2*pi));
x = x - k*(2*pi);
wrapped_phi(vrt,hrz) = x;
end
if (x < -pi)
k = round(abs(x)/(2*pi));
x = x + k*(2*pi);
wrapped_phi(vrt,hrz) = x;
end
end
end
Step 3: I used MATLAB unwrap() function.
But I did not get same phase function.
Phase values also are different (please see colorbars).
figure
imagesc(unwrap(wrapped_phi));colorbar; title('Using MATLAB unwrap function')
Why ?
Please see attached jpg images (which are outcomes of the above code snippets).
Any help will be appreciated.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Signal Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

