Vital
Loading...
Searching...
No Matches
vital::FourierTransform Class Reference

A Fourier transform implementation using KissFFT for platforms where other accelerations are unavailable. More...

#include <fourier_transform.h>

Public Member Functions

 FourierTransform (size_t bits)
 Constructs a FourierTransform with the given bits using KissFFT.
 
 ~FourierTransform ()
 Default destructor.
 
void transformRealForward (float *data)
 Performs an in-place forward real FFT using KissFFT.
 
void transformRealInverse (float *data)
 Performs an in-place inverse real FFT using KissFFT.
 

Detailed Description

A Fourier transform implementation using KissFFT for platforms where other accelerations are unavailable.

KissFFT is a simple, universally compatible FFT library. This implementation manually arranges real-only data into a complex form before performing forward and inverse transforms, and includes logic to manipulate the Nyquist component.

Note
This class is used as a fallback when no other specialized FFT backends are available.

Constructor & Destructor Documentation

◆ FourierTransform()

vital::FourierTransform::FourierTransform ( size_t bits)
inline

Constructs a FourierTransform with the given bits using KissFFT.

Parameters
bitsThe exponent defining the FFT size. The FFT size is 2^bits.

◆ ~FourierTransform()

vital::FourierTransform::~FourierTransform ( )
inline

Default destructor.

Member Function Documentation

◆ transformRealForward()

void vital::FourierTransform::transformRealForward ( float * data)
inline

Performs an in-place forward real FFT using KissFFT.

The method rearranges the input array to form a complex array and then calls the forward KissFFT transform. After the transform, it sets the Nyquist and DC components to handle the real-only FFT format.

Parameters
dataPointer to the input/output data buffer.

◆ transformRealInverse()

void vital::FourierTransform::transformRealInverse ( float * data)
inline

Performs an in-place inverse real FFT using KissFFT.

This method reconstructs the complex data from the given frequency-domain buffer, calls the inverse transform, and then extracts the real data. It also normalizes the resulting time-domain samples appropriately.

Parameters
dataPointer to the input/output data buffer in frequency-domain format.

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