fft

Fast Fourier Transform (FFT) and inverse (plan) object

Public Functions

void * fft_malloc(unsigned int _n)
void fft_free(void * _x)
FFT(plan) fft_create_plan(unsigned int _n, float complex * _x, float complex * _y, int _dir, int _flags)
FFT(plan) fft_create_plan_r2r_1d(unsigned int _n, float * _x, float * _y, int _type, int _flags)
int fft_destroy_plan(FFT(plan) _p)
int fft_print_plan(FFT(plan) _p)
int fft_execute(FFT(plan) _p)
int fft_run(unsigned int _n, float complex * _x, float complex * _y, int _dir, int _flags)
int fft_r2r_1d_run(unsigned int _n, float * _x, float * _y, int _type, int _flags)
int fft_shift(float complex * _x, unsigned int _n)

Interfaces

void * fft_malloc(unsigned int _n)

Allocate a one-dimensional array similar to the ordinary malloc. The implementation may internally align the allocated memory to support some optimizations. Use the result as the input or output array argument to one of the fft_create* methods. As with the ordinary malloc, the result must be typecast to the proper type. Memory allocated by this function must be deallocated by fft_free and not by the ordinary free.

  • _n : array size

void fft_free(void * _x)

Free the one-dimensional array allocated by fft_malloc.

  • _x : pointer to array

FFT(plan) fft_create_plan(unsigned int _n, float complex * _x, float complex * _y, int _dir, int _flags)

Create regular complex one-dimensional transform

  • _n : transform size
  • _x : pointer to input array, shape: (_n, 1)
  • _y : pointer to output array, shape: (_n, 1)
  • _dir : direction (e.g. LIQUID_FFT_FORWARD)
  • _flags : options, optimization

FFT(plan) fft_create_plan_r2r_1d(unsigned int _n, float * _x, float * _y, int _type, int _flags)

Create real-to-real one-dimensional transform

  • _n : transform size
  • _x : pointer to input array, shape: (_n, 1)
  • _y : pointer to output array, shape: (_n, 1)
  • _type : transform type (e.g. LIQUID_FFT_REDFT00)
  • _flags : options, optimization

int fft_destroy_plan(FFT(plan) _p)

Destroy transform and free all internally-allocated memory

  • _p :

int fft_print_plan(FFT(plan) _p)

Print transform plan and internal strategy to stdout. This includes information on the strategy for computing large transforms with many prime factors or with large prime factors.

  • _p :

int fft_execute(FFT(plan) _p)

Run the transform

  • _p :

int fft_run(unsigned int _n, float complex * _x, float complex * _y, int _dir, int _flags)

Perform n-point FFT allocating plan internally

  • _n :
  • _x : input array, shape: (_nfft, 1)
  • _y : output array, shape: (_nfft, 1)
  • _dir : fft direction: LIQUID_FFT_{FORWARD,BACKWARD}
  • _flags : fft flags

int fft_r2r_1d_run(unsigned int _n, float * _x, float * _y, int _type, int _flags)

Perform n-point real one-dimensional FFT allocating plan internally

  • _n :
  • _x : input array, shape: (_nfft, 1)
  • _y : output array, shape: (_nfft, 1)
  • _type : fft type, e.g. LIQUID_FFT_REDFT10
  • _flags : fft flags

int fft_shift(float complex * _x, unsigned int _n)

Perform _n-point fft shift

  • _x : input array, shape: (_n, 1)
  • _n : input array size