I am evaluating the Fourier transform of an image multiplied with a random phase mask. The random phase is so adjusted that the values of the angle (i.e A1 in the following code) of the initial quantity lies between 0 to pi. On inverse Fourier transforming the value range changes to -pi to pi (i.e of A in the code), as because the angle function in MATLAB returns the values in -pi to pi range. Is there any way to restrict the value range of angles (i.e A) to 0 to pi? The code is attached. fft2 and ifft2 are the inbuilt function of MATLAB to generate the Fourier transform and inverse Fourier transform respectively.
clear all;
close all;
clc;
%generation of two concentric circles image
[x,y]=meshgrid(-64:1:63);
g0= (x.^2+y.^2<=25^2).*(x.^2+y.^2>=20^2)+(x.^2+y.^2>=50^2).*(x.^2+y.^2<=55^2);
figure;
imagesc(abs(g0));
colormap(gray);
axis off;
axis equal;
title('input image');
delta1=rand(128);%random phase generation
%generating initial quantity EL
EL=(g0/(sqrt(2))).*exp(1i*pi*delta1);
A1=angle(EL);
FT=fft2(EL);
IFT=ifft2(FT);
A=angle(IFT);