libdspl-2.0 Digital Signal Processing Algorithm Library

Fast Fourier Transform Object Data Structure. More...

#include <dspl.h>

## Data Fields

complex_tw

complex_tt0

complex_tt1

complex_t w32 [32]

complex_t w64 [64]

complex_t w128 [128]

complex_t w256 [256]

complex_t w512 [512]

complex_tw1024

complex_tw2048

complex_tw4096

int n

## Detailed Description

Fast Fourier Transform Object Data Structure.

The structure stores pointers to twiddle factors and arrays of intermediate data of the fast Fourier transform algorithm.

The libdspl-2.0 library uses an FFT algorithm for composite size.

Parameters
 n The size of the FFT vector for which memory is allocated in the structure arrays. The parameter n must be equal to an integer power of two (radix 2). w Pointer to the vector of twiddle factors. The size of the vector is [n x 1]. The memory must be allocated and an array of twiddle factors must be filled with the fft_create function. t0 Pointer to the vector of intermediate results of the FFT algorithm. The size of the vector is [n x 1]. Memory must be allocated by fft_create function. t1 Pointer to the vector of intermediate results. The size of the vector is [n x 1]. The memory must be allocated with the fft_create function. w32 Static twiddle factors vector for 32-points FFT. w64 Static twiddle factors vector for 32-points FFT. w128 Static twiddle factors vector for 32-points FFT. w256 Static twiddle factors vector for 32-points FFT. w512 Static twiddle factors vector for 32-points FFT. w1024 Dynamic twiddle factors vector for 32-points FFT. w2048 Dynamic twiddle factors vector for 32-points FFT. w4096 Dynamic twiddle factors vector for 32-points FFT. The structure is calculated with the fft_create function once before using the FFT algorithm. A pointer to an object of this structure may be reused when calling FFT functions. Before exiting the program, dedicated memory for twiddle factors and arrays of intermediate data must be cleared by the fft_free function.

For example:

fft_t pfft = {0}; // Structure fft_t and clear all fields
int n = 64; // FFT size
int err;
// Create and fill FFT structure for 64-points FFT
err = fft_create(&pfft, n);
// FFT calculation here
// FFT calculation here one more
// ...
// Clear fft structure
fft_free(&pfft);
Note
It is important to note that if the object fft_t was created for the FFT size equal ton, it can only be used for FFT of size n.

It’s also worth noting that the FFT functions independently control the size, and independently allocate the memory of the FFT object, if necessary. So if you call any function using the fft_t structure with filled data for the FFT length k for calculating the FFT of lengthn, then the structure arrays will be automatically recreated for the length n.

Definition at line 277 of file dspl.h.

## ◆ n

 int fft_t::n

Definition at line 292 of file dspl.h.

Referenced by fft_create().

## ◆ t0

 complex_t* fft_t::t0

Definition at line 280 of file dspl.h.

Referenced by fft_create(), fft_free(), and ifft_cmplx().

## ◆ t1

 complex_t* fft_t::t1

Definition at line 281 of file dspl.h.

Referenced by fft(), fft_cmplx(), fft_create(), fft_free(), and ifft_cmplx().

## ◆ w

 complex_t* fft_t::w

Definition at line 279 of file dspl.h.

Referenced by fft_create(), and fft_free().

## ◆ w1024

 complex_t* fft_t::w1024

Definition at line 289 of file dspl.h.

Referenced by fft_create(), and fft_free().

## ◆ w128

 complex_t fft_t::w128[128]

Definition at line 286 of file dspl.h.

Referenced by fft_create().

## ◆ w2048

 complex_t* fft_t::w2048

Definition at line 290 of file dspl.h.

Referenced by fft_create(), and fft_free().

## ◆ w256

 complex_t fft_t::w256[256]

Definition at line 287 of file dspl.h.

Referenced by fft_create().

## ◆ w32

 complex_t fft_t::w32[32]

Definition at line 284 of file dspl.h.

Referenced by fft_create().

## ◆ w4096

 complex_t* fft_t::w4096

Definition at line 291 of file dspl.h.

Referenced by fft_create(), and fft_free().

## ◆ w512

 complex_t fft_t::w512[512]

Definition at line 288 of file dspl.h.

Referenced by fft_create().

## ◆ w64

 complex_t fft_t::w64[64]

Definition at line 285 of file dspl.h.

Referenced by fft_create().

int n
Definition: dspl.h:292
int DSPL_API fft_create(fft_t *pfft, int n)
Function creates and fill fft_t structure.
Definition: fft.c:935
void DSPL_API fft_free(fft_t *pfft)
Free fft_t structure.
Definition: fft.c:1177
Fast Fourier Transform Object Data Structure.
Definition: dspl.h:278