ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
FFT< fftSize > Class Template Reference

A templated class for performing Fast Fourier Transform (FFT) operations. More...

#include <FFT.h>

Static Public Member Functions

static void Radix2FFT (float *data)
 Performs a Radix-2 FFT on the provided data.
 
static void ComplexMagnitude (float *complexData, float *magnitude)
 Computes the magnitude of complex numbers from interleaved real and imaginary components.
 

Static Private Member Functions

static constexpr int CalculateBits (int size, int count=0)
 Calculates the number of bits required for bit reversal based on FFT size.
 
static void BitReverseOrder (float *data)
 Reorders the data array in bit-reversed order.
 
static int ReverseBits (int num)
 Reverses the bits of an integer.
 
static void Swap (float *a, float *b)
 Swaps two floating-point values.
 

Static Private Attributes

static const constexpr float twiddleCoefficients [fftSize *2]
 Precomputed twiddle coefficients for the FFT.
 
static const constexpr int bitCount = CalculateBits(fftSize)
 The number of bits needed for bit reversal for this FFT size.
 

Detailed Description

template<int fftSize>
class FFT< fftSize >

A templated class for performing Fast Fourier Transform (FFT) operations.

Template Parameters
fftSizeThe size of the FFT, must be a power of 2.

Definition at line 20 of file FFT.h.

Member Function Documentation

◆ BitReverseOrder()

template<int fftSize>
static void BitReverseOrder ( float data)
staticprivate

Reorders the data array in bit-reversed order.

Parameters
dataThe data array to reorder.

◆ CalculateBits()

template<int fftSize>
static constexpr int CalculateBits ( int  size,
int  count = 0 
)
staticconstexprprivate

Calculates the number of bits required for bit reversal based on FFT size.

Parameters
sizeThe FFT size.
countRecursive parameter to count the bits.
Returns
The number of bits required.

◆ ComplexMagnitude()

template<int fftSize>
static void ComplexMagnitude ( float complexData,
float magnitude 
)
static

Computes the magnitude of complex numbers from interleaved real and imaginary components.

Parameters
complexDataThe input array containing interleaved real and imaginary components.
magnitudeThe output array for storing computed magnitudes.

Referenced by MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().

◆ Radix2FFT()

template<int fftSize>
static void Radix2FFT ( float data)
static

Performs a Radix-2 FFT on the provided data.

Parameters
dataThe input array containing interleaved real and imaginary components.

Referenced by MicrophoneFourier::Update(), and MicrophoneFourier::UpdateDMA().

◆ ReverseBits()

template<int fftSize>
static int ReverseBits ( int  num)
staticprivate

Reverses the bits of an integer.

Parameters
numThe number whose bits are to be reversed.
Returns
The bit-reversed integer.

◆ Swap()

template<int fftSize>
static void Swap ( float a,
float b 
)
staticprivate

Swaps two floating-point values.

Parameters
aPointer to the first value.
bPointer to the second value.

Member Data Documentation

◆ bitCount

template<int fftSize>
const constexpr int bitCount = CalculateBits(fftSize)
staticconstexprprivate

The number of bits needed for bit reversal for this FFT size.

Definition at line 46 of file FFT.h.

◆ twiddleCoefficients

template<int fftSize>
const constexpr float twiddleCoefficients[fftSize *2]
staticconstexprprivate
Initial value:
= [] {
float temp[fftSize * 2];
for (int i = 0; i < fftSize * 2; ++i) {
}
return temp;
}()
A templated class for performing Fast Fourier Transform (FFT) operations.
Definition FFT.h:20
Implements a generic Kalman Filter for 1D data.

Precomputed twiddle coefficients for the FFT.

Definition at line 25 of file FFT.h.


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