Understanding FFT through Matlab.

236 Views Asked by At

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?

2

There are 2 best solutions below

0
On

You need to understand the one-dimensional DFT (whose implementation is with the FFT algorithm).

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$

0
On

FFT basically decomposed the image into its basic frequency components, the non imaginary part represents the DC(constant) components and the imaginary part represent the frequency components.