# Is matlab fft faster for real input?

I realize that matlab fft is twice as fast for real input. But does matlab fft take the fact that the transform will be conjugate symmetric into consideration? Since the input is real, it would have half as much information as a complex input, so this can explain the factor of 2. I was thinking that it perhaps should be a factor of 4. 2 for conjugate symmetry, 2 for having no complex component. Am I thinking wrong?

Matlab, like most computational packages, implement a pretty neat set of fast Fourier transform algorithms referred to as FFTW: fastest Fourier transform in the west. You can find more out about it here.

FFTW actually runs a preflight on your machine when it is first installed. At that time, it runs a bunch of test computations to figure out which prime factorization would be fastest given your processor speeds and cache sizes. Then, it uses a symbolic program to generate a bunch of FFT algorithms specific to your machine for a whole bunch of cases, like real valued, symmetric, etc. So, it's hard to say exactly what's going on under the hood except that if there's an efficiency to be had, FFTW will take advantage.

• Thanks for your interesting answer. I didn't know that about Matlab. Oct 2, 2015 at 10:37

You can perform a real valued FFT of N points using a complex FFT of N/2 points with some wrapper math.

Slightly more efficient: If you have two real valued signals you can make a complex signal out of them and then separate in the frequency domain in the even and odd parts.