Contents

class

SushiDSP::Fft

Power-of-two real FFT.

Declared in
include/SushiDSP/math/Fft.hpp

Precomputes twiddle factors and bit-reversal in the constructor.

Transforms are out-of-place: the three buffers passed to forward() or inverse() must be distinct and must not alias each other.

Public member functions

explicit Fft(std::uint32_t size)

Constructs an FFT plan for the given power-of-two size.

Parameters

size

Transform size; must be a power of two.

void forward(const float *time_domain, float *real_out, float *imag_out) const

Computes the forward DFT of a real time-domain signal.

Parameters

time_domain

Input, size() samples.

real_out

Output real part, size() bins.

imag_out

Output imaginary part, size() bins.

Note

The three buffers must not alias each other.

void inverse(const float *real_in, const float *imag_in, float *time_domain_out) const

Computes the inverse DFT back to a real time-domain signal.

Parameters

real_in

Input real part, size() bins.

imag_in

Input imaginary part, size() bins.

time_domain_out

Output, size() samples.

Note

The three buffers must not alias each other.

Note

Uses internal scratch buffers, so concurrent calls on one plan are not supported.

std::uint32_t size() const

The transform size this plan was constructed for.

Returns

The FFT size.