# Understanding FFT through Matlab.

Suppose, I have the following matrix which represents a grayscale image in the spatial domain,

I = 91  192  155  218
99   99  201   99
99   99   99   99
99  198   99   99


I have obtained its FFT as follows which is the frequency domain representation of the image I,

J = fft2(I);

J = 1.0e+03 *

2.0450 + 0.0000i  -0.1660 - 0.0730i  -0.1610 + 0.0000i  -0.1660 + 0.0730i
0.2600 - 0.0030i   0.0350 + 0.1280i  -0.1640 - 0.2010i  -0.1630 + 0.0760i
0.0590 + 0.0000i   0.0380 + 0.1250i  -0.1670 + 0.0000i   0.0380 - 0.1250i
0.2600 + 0.0030i  -0.1630 - 0.0760i  -0.1640 + 0.2010i   0.0350 - 0.1280i


Now, my question is,

How do these complex numbers represent frequencies?

• They don't represent frequencies, they represent amplitude and phases at harmonic frequencies, i.e. when you decompose your signal as a sum of sinusoid. – Yves Daoust Jul 28 '17 at 12:45
• They represent the coefficients to complex exponential functions. It is a fixed frequency at each position. The values are just the coefficients for the complex exponential of that frequency. – mathreadler Jul 28 '17 at 12:45

If $x(n), n \in 0 \ldots N-1$ is a vector then $x(n ) = \frac{1}{N}\sum_{k=0}^{N-1} X(k) e^{2i \pi nk / N}$ where $X(k) = \sum_{n=0}^{N-1} x(n) e^{-2i \pi nk / N}$.
In the same way, if $x(n_1,n_2), n_i \in 0 \ldots N-1$ is a matrix then $x(n_1,n_2 ) = \frac{1}{N^2}\sum_{k_1,k_2=0}^{N-1} X(k_1,k_2) e^{2i \pi (n_1k_1+n_2k_2) / N}$ where $X(k_1,k_2) = \ldots$