0
$\begingroup$

I am using Python to calculate the real FFT for a 2D array. I found that the real FFT function does not return an array with the same size as the input array, rather, it returns an array with the same size as the first axes and half of the size of the second axes or vise verse based on the axes order that we choose.

I attached the complex FFT, real FFT with axes order (0,1), and real FFT with axes order (1,0) of an array with size(1400x144). See the difference between the second and the third image. Any idea why that happens, and what does it mean in terms of the linear property of the FFT. Thanks enter image description here

$\endgroup$
0
$\begingroup$

A real, 1D DFT is fully described by the non-negative frequencies, since real DFTs are symmetric about the 0 frequency bin.

The function you linked is only computing the FFT along one dimension, and is only returning the non-negative frequency bins.

From the manual page:

"Notice how the final element of the fft output is the complex conjugate of the second element, for real input. For rfft, this symmetry is exploited to compute only the non-negative frequency terms."

You can use symmetry to fill in the other half of the result, if you need it.

$\endgroup$
  • $\begingroup$ thanks a lot, I updated the link to refer to 2the D function. I can understand that for 1D only positive frequencies is enough( thanks to the symmetry property), but for 2D thing become more complicated. I am not able to understand why the function returns positive frequencies only for one axes and return both positive and negative for the second axis. $\endgroup$ – Ahmed Oct 31 at 15:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.