Most sensor data is real-valued: audio samples, vibration measurements, ADC readings. A general complex FFT applied to such data wastes half its work because the imaginary input channel is identically zero. The real-input FFT exploits this structure to deliver roughly twice the throughput and half the memory of a complex FFT at the same transform length. On bandwidth- and RAM-limited embedded targets this difference is significant.
The RFFT is a specialisation of the length-$N$ Discrete Fourier Transform
for the case where every
Split
Their length-$(N/2)$ DFTs are
The twiddle factor
Given the
Two independent length-$(N/2)$ inverse DFTs then reconstruct
| Case | Time | Space | Notes |
|---|---|---|---|
| Forward |
|
Two half-length DFTs plus |
|
| Inverse |
|
Two half-length IDFTs plus interleave pass |
The constant factor is approximately half that of a complex
Input:
-
Split:
$x_e = [1, 0, 0, 0, 0, 0, 0, 0]$ ,$x_o = [0, 0, 0, 0, 0, 0, 0, 0]$ . -
Sub-DFTs:
$E[k] = 1$ for all$k$ ;$O[k] = 0$ for all$k$ . -
Combine:
$X[k] = E[k] + W_{16}^k \cdot 0 = 1$ for$k = 0, \dots, 8$ . -
Result:
$|X[k]| = 1$ — flat magnitude, the hallmark of a unit impulse.
-
N must be an even power of two. The underlying radix-2 engine imposes this; a
static_assertenforces it at compile time. - DC and Nyquist bins are exactly real. Floating-point errors in the sub-DFTs may introduce tiny imaginary residuals; downstream code should not rely on them being precisely zero.
-
Round-trip accumulation. Two forward and two inverse sub-DFTs compound rounding
errors. The round-trip error is
$O(\varepsilon \log N)$ where$\varepsilon$ is the floating-point machine epsilon. -
Spectrum aliasing at Nyquist. The bin at
$k = N/2$ is real and unique only when$N$ is even, which is always the case here.
- Split-radix RFFT: replaces the two half-length DFTs with a mixed radix-2/4 decomposition, reducing the arithmetic count by roughly 30% versus the radix-2 split used here.
-
In-place RFFT: packs the
$N/2 + 1$ complex output into the same$N$ -sample real buffer, halving memory further. -
Zero-padded RFFT: appending zeros to
$x$ before the transform gives finer frequency resolution at the cost of more compute.
- Spectrum analysis of real sensor signals (vibration, audio, pressure).
- Cross-correlation and convolution of real sequences via
ConvolutionCorrelation. - Power spectral density estimation via
PowerDensitySpectrum. - Feature extraction in embedded machine learning pipelines.
- FastFourierTransform / FastFourierTransformRadix2Impl: the injected complex engine that does the heavy butterfly work; RFFT adds only a linear-time split pass on top.
- PowerDensitySpectrum: consumes the output of the RFFT to estimate spectral power.
-
ConvolutionCorrelation: uses the FFT for
$O(N \log N)$ convolution; RFFT halves the cost when both operands are real. - HilbertTransform: also builds on the FFT engine with a frequency-domain manipulation pass, similar in structure to the RFFT split step.
- H. V. Sorensen, D. L. Jones, M. T. Heideman, C. S. Burrus, "Real-valued fast Fourier transform algorithms," IEEE Trans. Acoustics, Speech, and Signal Processing, 35(6), 849–863, 1987.
- A. V. Oppenheim, R. W. Schafer, Discrete-Time Signal Processing, 3rd ed., Ch. 9.
- S. W. Smith, The Scientist and Engineer's Guide to Digital Signal Processing, Ch. 12 (available at dspguide.com).