# What's the frequency transform of a random matrix?

Assume the following:

img = 255*rand(512); %Generating a 2D matrix with random numbers between 0 to 255.

fftimg = abs(fft2(img)); %FFT of the image.

The frequency transform of this image is a single high value at the top left corner of the image. This means the 'energy' or the frequency response is the highest and concentrated at the lowest frequency

Can you explain why this happens?

That is the DC offset (at zero frequency).

img = 255*randn(512);  % thanks @Jason's comment
img1=img-mean(img(:));
fftimg = abs(fft2(img1));
imagesc((fftshift(fftimg)))


gives you the spectrum of the normal distribution image. Note that white noise is flat in the frequency domain, but the Gaussian noise in the time domain is still Gaussian in the frequency domain. You may need to average a large number of FFTs of white noise to approach the average power spectral density.

• I saw the frequency transform and it appears as random as the original image. Why is that? What does it mean? I did not observe any spectrum as such. Feb 27, 2014 at 5:12
• answer updated, thx Feb 27, 2014 at 5:36
• I agree, with all you are saying, but I want to understand how to deduce the image frequency transform by looking at a simple image. I tried the same using randn and I observe the same noise pattern in my frequency transform. Feb 27, 2014 at 13:37