OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
GSLFFT.h File Reference
#include <algorithm>
#include <cmath>
#include <complex>
#include <vector>
Include dependency graph for GSLFFT.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gsl_fft_real_wavetable
 GSL-compatible interface for FFT routines. More...
 
struct  gsl_fft_real_workspace
 Workspace for real FFT routines. More...
 
struct  gsl_fft_halfcomplex_wavetable
 Halfcomplex FFT types for inverse transforms. More...
 
struct  gsl_fft_halfcomplex_workspace
 Workspace for halfcomplex FFT routines. More...
 
struct  gsl_fft_complex_wavetable
 Complex FFT types. More...
 
struct  gsl_fft_complex_workspace
 Workspace for complex FFT routines. More...
 

Namespaces

namespace  FFT
 Simple FFT implementation using Cooley-Tukey algorithm.
 

Functions

void FFT::fft_real_transform (double *data, size_t stride, size_t n)
 Forward FFT for real data (packed output).
 
gsl_fft_real_wavetablegsl_fft_real_wavetable_alloc (size_t n)
 Allocate a real FFT wavetable of size \(n\).
 
gsl_fft_real_workspacegsl_fft_real_workspace_alloc (size_t n)
 Allocate a real FFT workspace of size \(n\).
 
void gsl_fft_real_transform (double *data, size_t stride, size_t n, gsl_fft_real_wavetable *, gsl_fft_real_workspace *)
 Forward real FFT with GSL-compatible packed output.
 
void gsl_fft_real_wavetable_free (gsl_fft_real_wavetable *w)
 Free a real FFT wavetable.
 
void gsl_fft_real_workspace_free (gsl_fft_real_workspace *w)
 Free a real FFT workspace.
 
gsl_fft_halfcomplex_wavetablegsl_fft_halfcomplex_wavetable_alloc (size_t n)
 Allocate a halfcomplex FFT wavetable of size \(n\).
 
gsl_fft_halfcomplex_workspacegsl_fft_halfcomplex_workspace_alloc (size_t n)
 Allocate a halfcomplex FFT workspace of size \(n\).
 
void gsl_fft_halfcomplex_transform (double *data, size_t stride, size_t n, gsl_fft_halfcomplex_wavetable *, gsl_fft_halfcomplex_workspace *)
 Inverse transform from halfcomplex packed data.
 
void gsl_fft_halfcomplex_wavetable_free (gsl_fft_halfcomplex_wavetable *w)
 Free a halfcomplex FFT wavetable.
 
void gsl_fft_halfcomplex_workspace_free (gsl_fft_halfcomplex_workspace *w)
 Free a halfcomplex FFT workspace.
 
void gsl_fft_halfcomplex_inverse (double *data, size_t stride, size_t n, gsl_fft_halfcomplex_wavetable *wavetable, gsl_fft_halfcomplex_workspace *workspace)
 Alias for halfcomplex inverse transform.
 
void gsl_fft_halfcomplex_inverse (double *data, size_t stride, size_t n, gsl_fft_halfcomplex_wavetable *, gsl_fft_real_workspace *)
 Allow real workspace to be used with halfcomplex (compat helper).
 
gsl_fft_complex_wavetablegsl_fft_complex_wavetable_alloc (size_t n)
 Allocate a complex FFT wavetable of size \(n\).
 
gsl_fft_complex_workspacegsl_fft_complex_workspace_alloc (size_t n)
 Allocate a complex FFT workspace of size \(n\).
 
void gsl_fft_complex_forward (double *data, size_t stride, size_t n, gsl_fft_complex_wavetable *, gsl_fft_complex_workspace *)
 Forward complex FFT.
 
void gsl_fft_complex_inverse (double *data, size_t stride, size_t n, gsl_fft_complex_wavetable *, gsl_fft_complex_workspace *)
 Inverse complex FFT (GSL scaling: multiplies by \(n\)).
 
void gsl_fft_complex_wavetable_free (gsl_fft_complex_wavetable *w)
 Free a complex FFT wavetable.
 
void gsl_fft_complex_workspace_free (gsl_fft_complex_workspace *w)
 Free a complex FFT workspace.
 
void gsl_fft_complex_radix2_forward (double *data, size_t stride, size_t n)
 Radix-2 forward complex FFT (allocates temporary wavetable/workspace).
 
void gsl_fft_complex_radix2_inverse (double *data, size_t stride, size_t n)
 Radix-2 inverse complex FFT (GSL scaling, allocates temporaries).
 

Class Documentation

◆ gsl_fft_real_wavetable

struct gsl_fft_real_wavetable

GSL-compatible interface for FFT routines.

See also
https://www.gnu.org/software/gsl/doc/html/fft.html

Definition at line 115 of file GSLFFT.h.

Collaboration diagram for gsl_fft_real_wavetable:
Collaboration graph
Class Members
size_t n

◆ gsl_fft_real_workspace

struct gsl_fft_real_workspace

Workspace for real FFT routines.

See also
https://www.gnu.org/software/gsl/doc/html/fft.html

Definition at line 121 of file GSLFFT.h.

Collaboration diagram for gsl_fft_real_workspace:
Collaboration graph
Class Members
size_t n
vector< double > work

◆ gsl_fft_halfcomplex_wavetable

struct gsl_fft_halfcomplex_wavetable

Halfcomplex FFT types for inverse transforms.

See also
https://www.gnu.org/software/gsl/doc/html/fft.html

Definition at line 167 of file GSLFFT.h.

Collaboration diagram for gsl_fft_halfcomplex_wavetable:
Collaboration graph
Class Members
size_t n

◆ gsl_fft_halfcomplex_workspace

struct gsl_fft_halfcomplex_workspace

Workspace for halfcomplex FFT routines.

See also
https://www.gnu.org/software/gsl/doc/html/fft.html

Definition at line 173 of file GSLFFT.h.

Collaboration diagram for gsl_fft_halfcomplex_workspace:
Collaboration graph
Class Members
size_t n
vector< double > work

◆ gsl_fft_complex_wavetable

struct gsl_fft_complex_wavetable

Complex FFT types.

See also
https://www.gnu.org/software/gsl/doc/html/fft.html

Definition at line 269 of file GSLFFT.h.

Collaboration diagram for gsl_fft_complex_wavetable:
Collaboration graph
Class Members
size_t n

◆ gsl_fft_complex_workspace

struct gsl_fft_complex_workspace

Workspace for complex FFT routines.

See also
https://www.gnu.org/software/gsl/doc/html/fft.html

Definition at line 275 of file GSLFFT.h.

Collaboration diagram for gsl_fft_complex_workspace:
Collaboration graph
Class Members
size_t n
vector< complex< double > > work

Function Documentation

◆ gsl_fft_complex_forward()

void gsl_fft_complex_forward ( double *  data,
size_t  stride,
size_t  n,
gsl_fft_complex_wavetable ,
gsl_fft_complex_workspace  
)
inline

Forward complex FFT.

Input/output layout is interleaved: \([Re_0, Im_0, Re_1, Im_1, ...]\).

Parameters
dataInput/Output: interleaved complex data overwritten with spectrum.
strideInput: complex element stride.
nInput: number of complex samples.
wavetableInput: wavetable (unused).
workspaceInput: workspace (unused).

Definition at line 306 of file GSLFFT.h.

Referenced by gsl_fft_complex_radix2_forward(), TEST_F(), and TEST_F().

◆ gsl_fft_complex_inverse()

void gsl_fft_complex_inverse ( double *  data,
size_t  stride,
size_t  n,
gsl_fft_complex_wavetable ,
gsl_fft_complex_workspace  
)
inline

Inverse complex FFT (GSL scaling: multiplies by \(n\)).

Input/output layout is interleaved: \([Re_0, Im_0, Re_1, Im_1, ...]\).

Parameters
dataInput/Output: interleaved complex spectrum overwritten with signal.
strideInput: complex element stride.
nInput: number of complex samples.
wavetableInput: wavetable (unused).
workspaceInput: workspace (unused).

Definition at line 327 of file GSLFFT.h.

Referenced by gsl_fft_complex_radix2_inverse(), TEST_F(), and TEST_F().

◆ gsl_fft_complex_radix2_forward()

void gsl_fft_complex_radix2_forward ( double *  data,
size_t  stride,
size_t  n 
)
inline

Radix-2 forward complex FFT (allocates temporary wavetable/workspace).

Parameters
dataInput/Output: interleaved complex data overwritten with spectrum.
strideInput: complex element stride.
nInput: number of complex samples.

Definition at line 356 of file GSLFFT.h.

References gsl_fft_complex_forward(), gsl_fft_complex_wavetable_alloc(), gsl_fft_complex_wavetable_free(), gsl_fft_complex_workspace_alloc(), and gsl_fft_complex_workspace_free().

Referenced by TEST_F().

Here is the call graph for this function:

◆ gsl_fft_complex_radix2_inverse()

void gsl_fft_complex_radix2_inverse ( double *  data,
size_t  stride,
size_t  n 
)
inline

Radix-2 inverse complex FFT (GSL scaling, allocates temporaries).

Parameters
dataInput/Output: interleaved complex spectrum overwritten with signal.
strideInput: complex element stride.
nInput: number of complex samples.

Definition at line 368 of file GSLFFT.h.

References gsl_fft_complex_inverse(), gsl_fft_complex_wavetable_alloc(), gsl_fft_complex_wavetable_free(), gsl_fft_complex_workspace_alloc(), and gsl_fft_complex_workspace_free().

Referenced by TEST_F().

Here is the call graph for this function:

◆ gsl_fft_complex_wavetable_alloc()

gsl_fft_complex_wavetable * gsl_fft_complex_wavetable_alloc ( size_t  n)
inline

Allocate a complex FFT wavetable of size \(n\).

Parameters
nInput: transform size.
Returns
Output: wavetable pointer.

Definition at line 283 of file GSLFFT.h.

References gsl_fft_complex_wavetable::n.

Referenced by gsl_fft_complex_radix2_forward(), gsl_fft_complex_radix2_inverse(), TEST_F(), TEST_F(), and TEST_F().

◆ gsl_fft_complex_wavetable_free()

void gsl_fft_complex_wavetable_free ( gsl_fft_complex_wavetable w)
inline

Free a complex FFT wavetable.

Parameters
wInput: wavetable to release (can be null).

Definition at line 346 of file GSLFFT.h.

Referenced by gsl_fft_complex_radix2_forward(), gsl_fft_complex_radix2_inverse(), TEST_F(), TEST_F(), and TEST_F().

◆ gsl_fft_complex_workspace_alloc()

gsl_fft_complex_workspace * gsl_fft_complex_workspace_alloc ( size_t  n)
inline

Allocate a complex FFT workspace of size \(n\).

Parameters
nInput: transform size.
Returns
Output: workspace pointer.

Definition at line 292 of file GSLFFT.h.

References gsl_fft_complex_workspace::n, and gsl_fft_complex_workspace::work.

Referenced by gsl_fft_complex_radix2_forward(), gsl_fft_complex_radix2_inverse(), TEST_F(), TEST_F(), and TEST_F().

◆ gsl_fft_complex_workspace_free()

void gsl_fft_complex_workspace_free ( gsl_fft_complex_workspace w)
inline

Free a complex FFT workspace.

Parameters
wInput: workspace to release (can be null).

Definition at line 350 of file GSLFFT.h.

Referenced by gsl_fft_complex_radix2_forward(), gsl_fft_complex_radix2_inverse(), TEST_F(), TEST_F(), and TEST_F().

◆ gsl_fft_halfcomplex_inverse() [1/2]

void gsl_fft_halfcomplex_inverse ( double *  data,
size_t  stride,
size_t  n,
gsl_fft_halfcomplex_wavetable ,
gsl_fft_real_workspace  
)
inline

Allow real workspace to be used with halfcomplex (compat helper).

Parameters
dataInput/Output: packed spectrum overwritten with real sequence.
strideInput: element stride in data.
nInput: number of samples.
wavetableInput: wavetable (unused).
workspaceInput: workspace (unused).

Definition at line 257 of file GSLFFT.h.

References gsl_fft_halfcomplex_transform(), gsl_fft_halfcomplex_wavetable_alloc(), gsl_fft_halfcomplex_wavetable_free(), gsl_fft_halfcomplex_workspace_alloc(), and gsl_fft_halfcomplex_workspace_free().

Here is the call graph for this function:

◆ gsl_fft_halfcomplex_inverse() [2/2]

void gsl_fft_halfcomplex_inverse ( double *  data,
size_t  stride,
size_t  n,
gsl_fft_halfcomplex_wavetable wavetable,
gsl_fft_halfcomplex_workspace workspace 
)
inline

Alias for halfcomplex inverse transform.

Parameters
dataInput/Output: packed spectrum overwritten with real sequence.
strideInput: element stride in data.
nInput: number of samples.
wavetableInput: wavetable (unused).
workspaceInput: workspace (unused).

Definition at line 245 of file GSLFFT.h.

References gsl_fft_halfcomplex_transform().

Referenced by FixedFFTLowPassFilter::apply(), RelativeFFTLowPassFilter::apply(), FixedFFTLowPassFilter::calc_derivative(), RelativeFFTLowPassFilter::calc_derivative(), and convlv().

Here is the call graph for this function:

◆ gsl_fft_halfcomplex_transform()

void gsl_fft_halfcomplex_transform ( double *  data,
size_t  stride,
size_t  n,
gsl_fft_halfcomplex_wavetable ,
gsl_fft_halfcomplex_workspace  
)
inline

Inverse transform from halfcomplex packed data.

Parameters
dataInput/Output: packed spectrum overwritten with real sequence.
strideInput: element stride in data.
nInput: number of samples.
wavetableInput: wavetable (unused).
workspaceInput: workspace (unused).

Definition at line 203 of file GSLFFT.h.

Referenced by gsl_fft_halfcomplex_inverse(), and gsl_fft_halfcomplex_inverse().

◆ gsl_fft_halfcomplex_wavetable_alloc()

gsl_fft_halfcomplex_wavetable * gsl_fft_halfcomplex_wavetable_alloc ( size_t  n)
inline

Allocate a halfcomplex FFT wavetable of size \(n\).

Parameters
nInput: transform size.
Returns
Output: wavetable pointer.

Definition at line 181 of file GSLFFT.h.

References gsl_fft_halfcomplex_wavetable::n.

Referenced by FixedFFTLowPassFilter::apply(), RelativeFFTLowPassFilter::apply(), FixedFFTLowPassFilter::calc_derivative(), RelativeFFTLowPassFilter::calc_derivative(), convlv(), and gsl_fft_halfcomplex_inverse().

◆ gsl_fft_halfcomplex_wavetable_free()

void gsl_fft_halfcomplex_wavetable_free ( gsl_fft_halfcomplex_wavetable w)
inline

Free a halfcomplex FFT wavetable.

Parameters
wInput: wavetable to release (can be null).

Definition at line 233 of file GSLFFT.h.

Referenced by FixedFFTLowPassFilter::apply(), RelativeFFTLowPassFilter::apply(), FixedFFTLowPassFilter::calc_derivative(), RelativeFFTLowPassFilter::calc_derivative(), convlv(), and gsl_fft_halfcomplex_inverse().

◆ gsl_fft_halfcomplex_workspace_alloc()

gsl_fft_halfcomplex_workspace * gsl_fft_halfcomplex_workspace_alloc ( size_t  n)
inline

Allocate a halfcomplex FFT workspace of size \(n\).

Parameters
nInput: transform size.
Returns
Output: workspace pointer.

Definition at line 190 of file GSLFFT.h.

References gsl_fft_halfcomplex_workspace::n, and gsl_fft_halfcomplex_workspace::work.

Referenced by gsl_fft_halfcomplex_inverse().

◆ gsl_fft_halfcomplex_workspace_free()

void gsl_fft_halfcomplex_workspace_free ( gsl_fft_halfcomplex_workspace w)
inline

Free a halfcomplex FFT workspace.

Parameters
wInput: workspace to release (can be null).

Definition at line 237 of file GSLFFT.h.

Referenced by gsl_fft_halfcomplex_inverse().

◆ gsl_fft_real_transform()

void gsl_fft_real_transform ( double *  data,
size_t  stride,
size_t  n,
gsl_fft_real_wavetable ,
gsl_fft_real_workspace  
)
inline

Forward real FFT with GSL-compatible packed output.

Parameters
dataInput/Output: real input sequence overwritten with packed spectrum.
strideInput: element stride in data.
nInput: number of samples.
wavetableInput: wavetable (unused).
workspaceInput: workspace (unused).

Definition at line 151 of file GSLFFT.h.

References FFT::fft_real_transform().

Referenced by FixedFFTLowPassFilter::apply(), RelativeFFTLowPassFilter::apply(), FixedFFTLowPassFilter::calc_derivative(), RelativeFFTLowPassFilter::calc_derivative(), convlv(), and TEST_F().

Here is the call graph for this function:

◆ gsl_fft_real_wavetable_alloc()

gsl_fft_real_wavetable * gsl_fft_real_wavetable_alloc ( size_t  n)
inline

Allocate a real FFT wavetable of size \(n\).

Parameters
nInput: transform size.
Returns
Output: wavetable pointer.

Definition at line 129 of file GSLFFT.h.

References gsl_fft_real_wavetable::n.

Referenced by FixedFFTLowPassFilter::apply(), RelativeFFTLowPassFilter::apply(), FixedFFTLowPassFilter::calc_derivative(), RelativeFFTLowPassFilter::calc_derivative(), convlv(), and TEST_F().

◆ gsl_fft_real_wavetable_free()

void gsl_fft_real_wavetable_free ( gsl_fft_real_wavetable w)
inline

Free a real FFT wavetable.

Parameters
wInput: wavetable to release (can be null).

Definition at line 159 of file GSLFFT.h.

Referenced by FixedFFTLowPassFilter::apply(), RelativeFFTLowPassFilter::apply(), FixedFFTLowPassFilter::calc_derivative(), RelativeFFTLowPassFilter::calc_derivative(), convlv(), and TEST_F().

◆ gsl_fft_real_workspace_alloc()

gsl_fft_real_workspace * gsl_fft_real_workspace_alloc ( size_t  n)
inline

Allocate a real FFT workspace of size \(n\).

Parameters
nInput: transform size.
Returns
Output: workspace pointer.

Definition at line 138 of file GSLFFT.h.

References gsl_fft_real_workspace::n, and gsl_fft_real_workspace::work.

Referenced by FixedFFTLowPassFilter::apply(), RelativeFFTLowPassFilter::apply(), FixedFFTLowPassFilter::calc_derivative(), RelativeFFTLowPassFilter::calc_derivative(), convlv(), and TEST_F().

◆ gsl_fft_real_workspace_free()

void gsl_fft_real_workspace_free ( gsl_fft_real_workspace w)
inline

Free a real FFT workspace.

Parameters
wInput: workspace to release (can be null).

Definition at line 163 of file GSLFFT.h.

Referenced by FixedFFTLowPassFilter::apply(), RelativeFFTLowPassFilter::apply(), FixedFFTLowPassFilter::calc_derivative(), RelativeFFTLowPassFilter::calc_derivative(), convlv(), and TEST_F().