DSPark 1.9.0
Header-only C++20 DSP for real-time and offline audio
Loading...
Searching...
No Matches
dspark::FFTComplex< T > Class Template Reference

Complex FFT on interleaved data (Stockham radix-4 engine, SIMD). More...

#include <FFT.h>

Public Member Functions

 FFTComplex (size_t size)
 Constructs an FFT processor for the given size.
 
size_t getSize () const noexcept
 Returns the FFT size (number of complex points).
 
void forward (T *data) noexcept
 Performs a forward (time->frequency) FFT in-place.
 
void inverse (T *data) noexcept
 Performs an inverse (frequency->time) FFT in-place.
 

Static Public Member Functions

static size_t allocationBytes (size_t size) noexcept
 Upper bound of the heap bytes a constructor of this size requests, excluding the object itself, with up to 64 bytes per allocation for standard-library bookkeeping. Allocates nothing; use it to budget memory before constructing. The count depends on the build's kernel sets.
 

Detailed Description

template<typename T>
class dspark::FFTComplex< T >

Complex FFT on interleaved data (Stockham radix-4 engine, SIMD).

Data layout: interleaved [re0, im0, re1, im1, ...], total 2*N elements. The transform is in place from the caller's view (the engine works in its own buffers).

Template Parameters
TSample type (float or double).

Definition at line 1093 of file FFT.h.

Constructor & Destructor Documentation

◆ FFTComplex()

template<typename T >
dspark::FFTComplex< T >::FFTComplex ( size_t  size)
inlineexplicit

Constructs an FFT processor for the given size.

Parameters
sizeNumber of complex samples. Must be a power of two and >= 2.
Exceptions
std::invalid_argumentif size is invalid (with DSPARK_NO_EXCEPTIONS: asserts and degrades to the minimal valid size instead).

Definition at line 1102 of file FFT.h.

Member Function Documentation

◆ allocationBytes()

template<typename T >
static size_t dspark::FFTComplex< T >::allocationBytes ( size_t  size)
inlinestaticnoexcept

Upper bound of the heap bytes a constructor of this size requests, excluding the object itself, with up to 64 bytes per allocation for standard-library bookkeeping. Allocates nothing; use it to budget memory before constructing. The count depends on the build's kernel sets.

Parameters
sizeNumber of complex samples: a power of two >= 2 (other sizes return 0).
Returns
At least the sum of the constructor's allocation requests.

Definition at line 1123 of file FFT.h.

◆ forward()

template<typename T >
void dspark::FFTComplex< T >::forward ( T *  data)
inlinenoexcept

Performs a forward (time->frequency) FFT in-place.

Parameters
dataInterleaved complex data [re, im, ...], 2*N elements, any alignment.

Definition at line 1135 of file FFT.h.

◆ getSize()

template<typename T >
size_t dspark::FFTComplex< T >::getSize ( ) const
inlinenoexcept

Returns the FFT size (number of complex points).

Returns
The size provided at construction.

Definition at line 1111 of file FFT.h.

◆ inverse()

template<typename T >
void dspark::FFTComplex< T >::inverse ( T *  data)
inlinenoexcept

Performs an inverse (frequency->time) FFT in-place.

Parameters
dataInterleaved complex data, overwritten with time-domain result.
Note
The output is automatically scaled by 1/N. Unaligned-safe.

Definition at line 1142 of file FFT.h.


The documentation for this class was generated from the following file: