fftwEngine¶
-
class fftwEngine : public kotekan::Stage¶
Kotekan Stage to Fourier Transform an input stream of samples.
Reads samples from an input buffer, FFTs them with FFTW, and writes the resulting complex spectra into an output buffer. Both input and output buffers’ frame lengths must be integer multiples of one FFT’s worth of data.
Two input formats are supported, selectable via
input_type:complex(default): packed int16 I/Q pairs. Each FFT consumesspectrum_lengthcomplex samples and emitsspectrum_lengthcomplex bins. The output is fftshifted — the two halves of the raw FFT are swapped (memcpy ofspectrum_length/2bins each way) so DC lands at indexspectrum_length/2and bins run monotonically from -Fs/2 up to +Fs/2.real:packed int16 real samples. Each FFT consumes2*spectrum_lengthreal samples and emitsspectrum_lengthcomplex bins (the first half of an r2c transform; Nyquist bin discarded). No fftshift here — bins run 0 (DC) up to just below Fs/2.
Depends on libfftw3.
- Buffers
in_bufInput kotekan buffer.Format: Array of
int16_t(real samples, or interleaved I/Q pairs)Metadata:
none
out_bufOutput kotekan buffer.Format: Array of
fftwf_complexMetadata:
none
- Author
Keith Vanderlinde
- Param spectrum_length:
Int (default 128). Number of complex bins per output spectrum.
- Param input_type:
String (default “complex”). One of “complex” or “real”.