I want to add a noise made of harmonic functions to my 2D matrix. I thought it could be made by adding random amplitudes to modes in Fourier domain. I keep Hermitian symmetry of the matrix so that the IFFT gave me a real matrix (I iterate N/2 times over each positive and its conjugate negative frequency).
Why is the first element of the final matrix always the maximum?
If I, however, not only add but add or subtract a random number then the maximum is placed in a random place.
I've written an example in MATLAB:
N = 16; %dimensions x2d = ones(N); %basic 2D N*N matrix y2d = fft2(x2d); %its FFT %adding a random number to the spectrum paying attention to its conjugate %part so the basic matrix remains real upfreq = N/2; for chn1=2:upfreq for chn2 = 2:upfreq % N/2+1 is skipped rnd = rand; %if changed to rand-0.5 it gives random maximum point y2d(chn1,chn2)=y2d(chn1,chn2) +rnd ; y2d(N-chn1+2,N-chn2+2)=y2d(N-chn1+1+1,N-chn2+1+1)+rnd; end end imagesc(ifft2(y2d)) colorbar
Could you explain me why is it so?