3

I am stuck in this problem for a long time. I would really appreciate any help I can get. I have a complex equation which has branch cuts (4 of them, but in the attached code I just have one). This shows phase jumps across the y-axis. I am trying to use phase unwrapping so that I don't have any branch cuts in my contour plot. When I have the branch cut horizontally, the problem is easily solved by using the unwrap function of MATLAB. This I believe is because the branch cuts are in horizontal/vertical rows/columns so they are easily removed. When the branches are angled, I can't use the unwrap function anymore (as the branches will be angled at for example 30 degree, 45 degrees etc). So, I was wondering if there is anyway to unwrap the phase to get rid of the branch cuts. This is the case for horizontal with branch discontinuity with discontinuity horizontal:

This is the case for horizontal with no branch discontinuity after phase unwrapping, no discontinuity:

Angle 30 degrees, original, discontinuous:

Angle 30, wrapped phase, still discontinuous:

enter image description here

Please see the attached code. The angle and discontinuity is determined by gamma.

Since the unwrap function applies to column wise, and for cases with angles (other than 0) the discontinuity appears in gamma degrees (so for 30, it would appear at an angle of 30 , and so on), the discontinuity is not removed. Is there a way to extract the elements from a matrix from a mesh using an angle? I would really appreciate any help I could get.

%create mesh
x = [-10:0.1:10];
y = [-10:0.1:10];
[X,Y] = meshgrid(x,y);

%create plane
z =X+1i.*Y;

%constants

zc = [0 ];
xc= real(zc);
yc=imag(zc);
gamma =[30]./360*2*pi;   % this determines where the phase jump occurs
L = [ 4];
W = [ 2];
beta = [90]./360*2*pi;
STREN =4.7532e-08.*ones(size(zc,2),1)'; 

%constants

za1 =zc-exp(1i.*gamma).*(0.5.*L+0.5.*W.*exp(1i.*beta));

x1= real(za1); 
y1= imag(za1); 

A = -(-X.*cos(gamma)+x1.*cos(gamma)+y1.*sin(gamma)-Y.*sin(gamma));

%phase

f11 = angle(exp(-1i.*gamma).*(za1-z));

P_f_ =A.*f11+real(STREN.*z);

figure
contourf(X,Y,P_f_,25)
colorbar
hold on

anglef1_unwrapped = f11;

%Then sequentially unwrap all the columns one at a time
for i=1:length(A)
anglef1_unwrapped(:,i) = unwrap(f11(:,i));
end

P_single = real(STREN.*z)+A.*anglef1_unwrapped;
figure
contourf(X,Y,P_single,25)
colorbar
  • I would be grateful if someone could show me how to iterate through "anglef1_unwrapped " at an angle . The only way it seems to properly get rid of the the discontinuity is by using unwrap along gamma + 90° (for example, for horizontal case, through 90° or vertically, for 30° case through 120°) . – Tina Joseph May 08 '18 at 01:17
  • Hi Tina, I've deleted my previous answer, I was wrong. With the function `unwrap` you will unwrap your matrix on only 1 axis so if you phase jump don't go throug the whole matrix (like in your example) you will obtain another phase jump after applying `unwrap` perpendicular to the first phase jump... So here the 1D unwrap function can't be applied if you expect a robust result. But it can be solved with a specific 2D unwrap algorithm: check [that](https://ch.mathworks.com/matlabcentral/fileexchange/64630-2d-phase-unwrapping-using-srncp) – obchardon May 08 '18 at 08:22
  • Thank you! I will check it out and report back. I tried using other 2D unwrap algorithm such as this [link](https://www.mathworks.com/matlabcentral/fileexchange/22504-2d-phase-unwrapping-algorithms) and it didn't work. I really appreciate your reply. – Tina Joseph May 09 '18 at 01:27

0 Answers0