Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
% Calculate wrapped phase differences in a given direction
function wrapped_diff = wrapped_phase_difference(PHASE_ANGLE_REAL, DIM)
% Allocate the wrapped difference
wrapped_diff = zeros(size(PHASE_ANGLE_REAL));
% Differences of the complex array
phase_diff = diff(PHASE_ANGLE_REAL, 1, DIM);
% Wrap the differences with the angle operator
switch DIM
case 1
wrapped_diff(1:end - 1, :, :) = atan2(sin(phase_diff), cos(phase_diff));
case 2
wrapped_diff(:, 1 : end - 1, :) = atan2(sin(phase_diff), cos(phase_diff));
case 3
wrapped_diff(:, :, 1 : end - 1) = atan2(sin(phase_diff), cos(phase_diff));
end
end