Question: how fft2 works in matlab?
Answer: Y = fft2( X ) returns the two-dimensional Fourier transform of a matrix using a fast Fourier transform algorithm, which is equivalent to computing fft(fft(X). ... If X is a multidimensional array, then fft2 takes the 2-D transform of each dimension higher than 2. The output Y is the same size as X .