DSPark 1.6.1
Header-only audio DSP framework in pure C++20 — zero dependencies
Loading...
Searching...
No Matches
FFT.h File Reference

Fast Fourier Transform (Cooley-Tukey radix-2) with SIMD acceleration. More...

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <numbers>
#include <type_traits>
#include <utility>
#include <vector>
#include <stdexcept>
Include dependency graph for FFT.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  dspark::FFTComplex< T >
 In-place Cooley-Tukey radix-2 DIT FFT for complex data. More...
 
class  dspark::FFTReal< T >
 FFT optimised for real-valued input signals (the common audio case). More...
 

Namespaces

namespace  dspark
 Main namespace for the DSPark framework.
 

Detailed Description

Fast Fourier Transform (Cooley-Tukey radix-2) with SIMD acceleration.

Provides forward and inverse FFT for both complex and real-valued signals. Optimised for power-of-two sizes typical in audio.

Performance features:

  • SIMD-accelerated butterflies: SSE on x86-64 (float and double, with an SSE3 addsub fast path), NEON on ARM64.
  • Unaligned-safe: forward()/inverse() accept pointers of any alignment; the SIMD paths use unaligned loads/stores, which cost the same as the aligned forms on every x86 CPU of the last decade.
  • Dedicated first stage: the stride-2 stage has a twiddle of exactly 1, so it runs as a multiply-free pass.
  • Zero allocations after construction; forward()/inverse() are noexcept.

Minimum x86-64 requirement: SSE2 (the x86-64 baseline). When SSE3 is available (any CPU from ~2005 onwards, or -msse3) the butterfly uses the native addsub instruction; otherwise a bit-identical XOR+add fallback runs.

Definition in file FFT.h.