%The phase distribution of white noise clear; figure(1); clf; hold on; N=1000; x=randn(N,1); f=fftshift(fft(x)); f=f(1:end/2); ds=1/N; s=[0:ds:ds*(N/2-1)]'; axis tight; subplot(3,3,[1 2]); plot(x,'k'); h=ylabel('realization'); font(h,16); h=xlabel('time'); font(h,16); font(gca,16); axis tight; subplot(333); hist(x); h=ylabel('occurences'); font(h,16); h=xlabel('value'); font(h,16); font(gca,16); axis tight; subplot(3,3,[4 5]); hold on; plot(s,real(f),'k'); plot(s,imag(f),'r'); h=ylabel('Fourier coefficients'); font(h,16); h=xlabel('frequency'); font(h,16); font(gca,16); axis tight; subplot(336); hist(real(f)); h=ylabel('occurences'); font(h,16); h=xlabel('value'); font(h,16); font(gca,16); axis tight; subplot(3,3,[7 8]); theta=angle(f)*180/pi; plot(s,theta,'k'); axis tight; h=ylabel('Phase'); font(h,16); h=xlabel('frequency'); font(h,16); font(gca,16); axis tight; subplot(339); hist(theta); h=ylabel('occurences'); font(h,16); h=xlabel('value'); font(h,16); font(gca,16); axis tight;