DSPark 1.8.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.
 

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 336 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 345 of file FFT.h.

Member Function Documentation

◆ 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 361 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 354 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 368 of file FFT.h.


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