Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is a "2D fft" the same as two 1D fft's?

Tags:

c++

cuda

fft

I have a cuda code that I have implemented several C2C 2D FFT's in. They all use the same plan, but for some reason, the times on the 2D FFT's are large, and seem to vary quite a bit. Same data size FFT's seem to take anywhere from 0.4s to 1.8s

This is for a 1920x1080 FFT. Do those times seem reasonable?

Anyhow - I have had good experience with CUDA 1-D batched FFTs being fast. is it the same to take a 1D FFT across the rows, and then again across the columns of a matrix to give the same results as this 2D FFT? I have experience FFTs happening in a few hundreths of a second across larger data sets for 1D FFTs before, so I was hoping to maybe fix some of these results.

Thanks

like image 611
Derek Avatar asked May 19 '11 15:05

Derek


People also ask

What is 1D FFT and 2D FFT?

Just look at the math for 1D vs 2D FFT. In the 1D case, there is only 1 independent variable (x[n]). In 2D, there are two. It doesn't make sense to apply a 2D signal (i.e. two independent variables such as rows&columns in your image example) to a function that only takes one independent variable.

What is a 2D FFT?

2D FFT (2-dimensional Fast Fourier Transform) can be used to analyze the frequency spectrum of 2D signal (matrix) data. Conversely, 2D IFFT (2-dimension Inverse Fast Fourier Transform) is able to reconstruct a 2D signal from a 2D frequency spectrum.

What is fft2 Matlab?

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 .


1 Answers

A 2D transform of a 1K by 1K image requires 2K 1D transforms. Therefore those times seem reasonable.

For more information have a look at: http://paulbourke.net/miscellaneous/dft/

like image 118
csupnig Avatar answered Sep 17 '22 16:09

csupnig