# What are the advantages of using fft2 over fft

Assume we have a matrix x of size (8,8), . As known, FFT(x) performs 1D-FFT transformation, column wise. However, FFT2(x), performs 2D-FFT transformation.

In that case, what's the advantage of using 2D-FFT over 1D-FFT ?

• That's a bit like asking: What's the advantage of a hammer over a pair of scissors? It depends: if you need to cut a circle out of a piece of paper, your hammer will not be of use, vice versa for driving in a nail. – Florian Mar 2 '20 at 15:47
• The metaphor is closer to a utility knife vs a pair of scissors – Laurent Duval Mar 2 '20 at 16:48

They perform two different mathematical operations

1. FFT executes a 1-dimensional Discrete Fourier Transform one each column of the input matrix (or the first non-singleton dimension)
2. FFT2 executes a full 2-dimensional Discrete Fourier Transfrom on the entire matrix.

Which one you want to use depends on your specific application. One is not inherently "better" than the other, they are just two different things. In particular

$$\mathcal{F}_{2D}(X) = \mathcal{F}(\mathcal{F}(X)')'$$

• Perfect, I'd just propose you to add the notion of separability – Laurent Duval Mar 2 '20 at 14:31

For 2-d input that is of similar nature in both dimensions (ie spatial pixels) and where you want to achieve something similar in both (eg find low frequency components) you probably want fft2().

As noted above, fft2() is functionally equivalent to doing a 1-d fft on the rows, then another 1-d fft one the resulting columns.

-k

Caveat: @Hilmar's answer is neat, I just offer a talkative version.

A role of Fourier operations on data in any dimension is to provide an alternative (dual) description as "quantity of information" (let us say energy) per "frequency components". And frequency components can be defined in several ways (across each dimension, radially, etc.)

The role of FFTs in general is to perform the above calculations faster (fast, the first F of FFT) than the direct operations, at the expense of a few known side effects.

FFT often describes either the generic concept, or a standard fast Fourier transform in 1 dimension. To keep them faster in more dimensions, they are often implemented in a separable way: using a 1D FFT separably (independently) in each dimension (row, column, depth, etc.). One often call them FFT2 or FFT2D for 2D images (with horizontal and vertical frequencies), or FFT$$N$$, FFT-$$N$$D in more dimensions.