kais
kais

Reputation: 33

Principle of FFT in multidimensional array

How can one explain the principle of fft in a multidimensional array?

Y = fft(X) 

If X is a multidimensional array, then fft(X) treats the values along the first array dimension whose size does not equal 1 as vectors and returns the Fourier transform of each vector.

I don't understand it very well.

X=[1 2 ; 3 4];

X(:,:,2)=[5 6 ; 7  8]

Upvotes: 0

Views: 1798

Answers (1)

DoMakeSayThink
DoMakeSayThink

Reputation: 165

Let's take the 2D case for simplicity.

Given a 2D matrix of data, X, one can treat each row vector individually and perform a one-dimensional discrete Fourier transform. This will decompose each row into one dimensional frequency components. No attention is given to whether the rows of the matrix are correlated, and so every row of the output matrix will have some non-zero components.

Alternatively, using fft2, one can decompose X into its constituent two-dimensional frequency components. I find this easiest to think about in analogy with the DCT, where you can visualize the 2D basis easily 2D DCT basis functions

With the 2D FFT, correlations between rows would affect the output of the FFT. It's possible a single 2D frequency component (which is more like a surface than a wave) could contain all the energy of the 2D FFT, and so the output matrix could be much sparser than when treating the rows individually.

This analogy can be continued in to n-dimensions, with higher dimensional frequency components potentially capturing the higher dimensional structure in your data.

Upvotes: 1

Related Questions