    %% PRINCARG Function 
    
    % Wraps pahse to -pi to pi, 
    % For use with stretchtest.m function
    
    function phase_out = princarg(phase_in)
    phase_out = mod(phase_in+pi,-2*pi)+pi; 
    end 