# How to calculate autocorrelation function of an image noise

I am trying to calculate the autocorrelation function of an image noise. Specifically, I want to calculate the NCORR parameter in the function deconvwnr(). I have knowledge about the noise, which is gaussian with mean 0 and variance 1. I found the examples in this website calculate the NCORR as follows:

NP = abs(fftn(noise)).^2;
NPOW = sum(NP(:))/prod(size(noise)); % noise power
NCORR = fftshift(real(ifftn(NP))); % noise ACF, centered


I tried following this method, but to do that, I first need to create an image of certain size and then add the gaussian noise into it. But the problem is that if I initialize the pixel values to be all 0, then after the application of gaussian noise, the image elements will only have intensity values above 0, which does not reflect the shape of the gaussian noise. On the other hand, if I initialize the pixel values to be all 1, then the image elements will only have intensity values below 1, which also does not reflect the shape of gaussian. Another way is to initialize the values to be 0.5, but then I was afraid that 0.5 will affect the NCORR values because it increases the noise power. Can someone show me how to do this or is there another way to calculate the autocorrelation function?

I = zeros([m, n]);
I = imnoise(I, 'gaussian', 0, 1);
# then follow the steps above