rfftplan_new

Creation of a FFT computing plan for real signals (to compute efficiently several FFT).

Namespace: dsp::fourier

Prototype

sptr<FilterGen<float, cfloat>> rfftplan_new(int n=-1)

Parameters

nVector length (optional parameter)

Returns

A filter block (float to cfloat).

Description

This function will create a structure which will be efficient to compute sereral FFT on real signals with the same data length (the twiddle factors are only computed once).

Note that the parameters n and forward can be left unspecified, or even changed later while calling the FFT plan.

Example

int N = 1024; // Bloc length
auto plan = rfftplan_new();
for(i = 0; i < n; i++)
{
   // Input signal must be real
   let x = Vecf::random(N);
   // X is the FFT of x
   let X = plan->step(x);
   // (equivalent to X = fft(x) or X = rfft(x), but more efficient)
}

See also

fftplan_new(), fft(), ifft()