Calculate ifft using only REAL forward FFT
EDIT: This answer is basically a more detailed version of Hilmar's answer, which I noticed too late. Below there are more details about the derivation and the rearrangement of the outputs of the real FFT.



I assume you use the definitions of the FFT and IFFT as commonly used in DSP:

$$\textrm{FFT: }\quad X[k]=\sum_{n=0}^{N-1}x[n]e^{-j2\pi nk/N}\tag{1}$$

$$\textrm{IFFT: }\quad x[n]=\frac{1}{N}\sum_{k=0}^{N-1}X[k]e^{j2\pi nk/N}\tag{2}$$

For a real FFT we assume that $x[n]$ is real-valued. We also assume that the FFT length $N$ is even (otherwise you don't get an FFT bin at Nyquist).

From $(1)$ and $(2)$ we see that

$$\text{IFFT}\big\{X[k]\big\}=\frac{1}{N}\left(\textrm{FFT}\big\{X^*[k]\big\}\right)^*\tag{3}$$

Since your FFT routine only accepts real-valued inputs, we need to write $X[k]$ in terms of its real and imaginary parts:

$$X[k]=X_R[k]+jX_I[k]\tag{4}$$

Furthermore, if we assume that the inverse FFT of $X[k]$ is real-valued, we can rewrite $(3)$ as

$$\begin{align}\text{IFFT}\big\{X[k]\big\}&amp;=\frac{1}{N}\textrm{Re}\Big(\textrm{FFT}\big\{X_R[k]\big\}-j\,\textrm{FFT}\big\{X_I[k]\big\}\Big)\\&amp;=\frac{1}{N}\Big[\textrm{Re}\big(\textrm{FFT}\big\{X_R[k]\big\}\big)+\textrm{Im}\big(\textrm{FFT}\big\{X_I[k]\big\}\big)\Big]\tag{5}\end{align}$$

A little extra inconvenience lies in the fact that a real FFT routine only computes $N/2+1$ values whereas Eq. $(5)$ assumes FFT results of length $N$. This Matlab/Octave script shows how to correctly arrange the results of the individual FFTs:


N = 64;     % must be even!
N2 = N/2;

x = randn(N,1);

X = realfft(x);
XR = real(X); XR = [XR;XR(N2:-1:2)];
XI = imag(X); XI = [XI;-XI(N2:-1:2)];

x2a = real(realfft(XR)) / N; x2b = imag(realfft(XI)) / N;
x2 = [x2a + x2b; x2a(N2:-1:2) - x2b(N2:-1:2)];


In the above script we assume that there's a function realfft.m defined by


function X = realfft(x)

N = length(x);
if rem(N,2), error('N must be even.'); end

X = fft(x,N);
X = X(1:N/2+1);

end