Project Ne10
An Open Optimized Software Library Project for the ARM Architecture
Modules | Functions
Float/Fixed point Complex FFT

Modules

 Float/Fixed point Complex FFT Destroy functions
 User-callable function to destroy all necessary storage space for the fft.
 

Functions

ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_neon (ne10_int32_t nfft)
 User-callable function to allocate all necessary storage space for the fft. More...
 
ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_neon (ne10_int32_t nfft)
 User-callable function to allocate all necessary storage space for the fft. More...
 
ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_c (ne10_int32_t nfft)
 User-callable function to allocate all necessary storage space for the fft. More...
 
void ne10_fft_c2c_1d_float32_c (ne10_fft_cpx_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_cfg_float32_t cfg, ne10_int32_t inverse_fft)
 Mixed radix-2/3/4/5 complex FFT/IFFT of float(32-bit) data. More...
 
void ne10_fft_c2c_1d_float32_neon (ne10_fft_cpx_float32_t *fout, ne10_fft_cpx_float32_t *fin, ne10_fft_cfg_float32_t cfg, ne10_int32_t inverse_fft)
 Mixed radix-2/3/4/5 complex FFT/IFFT of float(32-bit) data. More...
 
ne10_fft_cfg_int16_t ne10_fft_alloc_c2c_int16 (ne10_int32_t nfft)
 User-callable function to allocate all necessary storage space for the fft. More...
 
void ne10_fft_c2c_1d_int16_c (ne10_fft_cpx_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_cfg_int16_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
 Mixed radix-2/4 complex FFT/IFFT of 16-bit fixed point data. More...
 
void ne10_fft_c2c_1d_int16_neon (ne10_fft_cpx_int16_t *fout, ne10_fft_cpx_int16_t *fin, ne10_fft_cfg_int16_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
 Mixed radix-2/4 complex FFT/IFFT of 16-bit fixed point data. More...
 
ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_c (ne10_int32_t nfft)
 User-callable function to allocate all necessary storage space for the fft. More...
 
void ne10_fft_c2c_1d_int32_c (ne10_fft_cpx_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_cfg_int32_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
 Mixed radix-2/4 complex FFT/IFFT of 32-bit fixed point data. More...
 
void ne10_fft_c2c_1d_int32_neon (ne10_fft_cpx_int32_t *fout, ne10_fft_cpx_int32_t *fin, ne10_fft_cfg_int32_t cfg, ne10_int32_t inverse_fft, ne10_int32_t scaled_flag)
 Mixed radix-2/4 complex FFT/IFFT of 32-bit fixed point data. More...
 

Detailed Description

A Fast Fourier Transform(FFT) is an efficient algorithm to compute the Discrete Fourier Transform(DFT) and its inverse. FFT is widely used for many applications in engineering, science and mathmatics.
Function list
This set of functions implements complex one-dimensional FFT/IFFT with 2^N(N>0) size. The function list is as follows:
  • fft_c2c_1d_float32
  • fft_c2c_1d_int32
  • fft_c2c_1d_int16
Note: The functions operate on out-of-place buffer which use different buffer for input and output. We need a temp buffer for internal usage. This buffer is allocated by the users and the size is (fftSize * sizeof (ne10_fft_cpx_float32_t)).
The format of input and output:
The input and output have the same format as follows:
 {real[0], imag[0], real[1], imag[1], real[2], imag[2].... real[fftSize-2], imag[fftSize-2], real[fftSize-1], imag[fftSize-1]} 
Lengths supported by the transform:
Internally, the functions utilize a mixed radix 2/4 algorithm and the size of the FFT supported is the lengths 2^N (N is 1, 2, 3, 4, 5, 6, ......).
Usage:
The basic usage of these functions is simple. We take float fft as an example and it looks like the code as follows.
#include "NE10.h"
...
{
    fftSize = 2^N; //N is 1, 2, 3, 4, 5, 6....
    in = (ne10_fft_cpx_float32_t*) NE10_MALLOC (fftSize * sizeof (ne10_fft_cpx_float32_t));
    out = (ne10_fft_cpx_float32_t*) NE10_MALLOC (fftSize * sizeof (ne10_fft_cpx_float32_t));
    ne10_fft_cfg_float32_t cfg;
    ...
    cfg = ne10_fft_alloc_c2c_float32 (fftSize);
    ...
    //FFT
    ne10_fft_c2c_1d_float32_c (out, in, cfg, 0);
    ...
    //IFFT
    ne10_fft_c2c_1d_float32_c (out, in, cfg, 1);
    ...
    NE10_FREE (in);
    NE10_FREE (out);
    NE10_FREE (cfg);
}

Note:

ne10_fft_cfg_float32_t cfg is the pointer which points to the buffer storing the twiddles and factors. It's generated in ne10_fft_alloc_c2c_float32(fftSize). If the fftSize is same, you needn't generate it again.
  • cfg->twiddles
    This is pointer to the twiddle factor table.
  • cfg->factors
    This is factors buffer: 0: stage number, 1: stride for the first stage, others: factors.
    For example, 128 could be split into 4x32, 4x8, 4x2, 2x1. The stage is 4, the stride of first stage is 128/2 = 64. So that the factor buffer is[4, 64, 4, 32, 4, 8, 4, 2, 2, 1]
  • cfg->buffer
    This is pointer to the temp buffer for FFT calculation. This buffer is allocated in init function and the size is (fftSize * sizeof (ne10_fft_cpx_float32_t)).

Function Documentation

§ ne10_fft_alloc_c2c_float32_c()

ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_c ( ne10_int32_t  nfft)

User-callable function to allocate all necessary storage space for the fft.

Parameters
[in]nfftlength of FFT
Returns
st point to the FFT config memory. This memory is allocated with malloc. The function allocate all necessary storage space for the fft. It also factors out the length of FFT and generates the twiddle coeff.

Definition at line 997 of file NE10_fft_float32.c.

§ ne10_fft_alloc_c2c_float32_neon()

ne10_fft_cfg_float32_t ne10_fft_alloc_c2c_float32_neon ( ne10_int32_t  nfft)

User-callable function to allocate all necessary storage space for the fft.

Parameters
[in]nfftlength of FFT
Returns
st point to the FFT config memory. This memory is allocated with malloc. The function allocate all necessary storage space for the fft. It also factors out the length of FFT and generates the twiddle coeff.

Definition at line 337 of file NE10_fft.c.

§ ne10_fft_alloc_c2c_int16()

ne10_fft_cfg_int16_t ne10_fft_alloc_c2c_int16 ( ne10_int32_t  nfft)

User-callable function to allocate all necessary storage space for the fft.

Parameters
[in]nfftlength of FFT
Returns
st point to the FFT config memory. This memory is allocated with malloc. The function allocate all necessary storage space for the fft. It also factors out the length of FFT and generates the twiddle coeff.

Definition at line 1030 of file NE10_fft_int16.c.

§ ne10_fft_alloc_c2c_int32_c()

ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_c ( ne10_int32_t  nfft)

User-callable function to allocate all necessary storage space for the fft.

Parameters
[in]nfftlength of FFT
Returns
st point to the FFT config memory. This memory is allocated with malloc. The function allocate all necessary storage space for the fft. It also factors out the length of FFT and generates the twiddle coeff.

Definition at line 1027 of file NE10_fft_int32.c.

§ ne10_fft_alloc_c2c_int32_neon()

ne10_fft_cfg_int32_t ne10_fft_alloc_c2c_int32_neon ( ne10_int32_t  nfft)

User-callable function to allocate all necessary storage space for the fft.

Parameters
[in]nfftlength of FFT
Returns
st point to the FFT config memory. This memory is allocated with malloc. The function allocate all necessary storage space for the fft. It also factors out the length of FFT and generates the twiddle coeff.

Definition at line 435 of file NE10_fft.c.

§ ne10_fft_c2c_1d_float32_c()

void ne10_fft_c2c_1d_float32_c ( ne10_fft_cpx_float32_t fout,
ne10_fft_cpx_float32_t fin,
ne10_fft_cfg_float32_t  cfg,
ne10_int32_t  inverse_fft 
)

Mixed radix-2/3/4/5 complex FFT/IFFT of float(32-bit) data.

Parameters
[out]*foutpoint to the output buffer (out-of-place)
[in]*finpoint to the input buffer (out-of-place)
[in]cfgpoint to the config struct
[in]inverse_fftthe flag of IFFT, 0: FFT, 1: IFFT
Returns
none. The function implements a mixed radix-2/3/4/5 complex FFT/IFFT. The length of 2^N*3^M*5^K(N,M,K is 1, 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, this FFT is an out-of-place algorithm. For the usage of this function, please check test/test_suite_fft_float32.c

Definition at line 1065 of file NE10_fft_float32.c.

§ ne10_fft_c2c_1d_float32_neon()

void ne10_fft_c2c_1d_float32_neon ( ne10_fft_cpx_float32_t fout,
ne10_fft_cpx_float32_t fin,
ne10_fft_cfg_float32_t  cfg,
ne10_int32_t  inverse_fft 
)

Mixed radix-2/3/4/5 complex FFT/IFFT of float(32-bit) data.

Parameters
[out]*foutpoint to the output buffer (out-of-place)
[in]*finpoint to the input buffer (out-of-place)
[in]cfgpoint to the config struct
[in]inverse_fftthe flag of IFFT, 0: FFT, 1: IFFT
Returns
none. The function implements a mixed radix-2/3/4/5 complex FFT/IFFT. The length of 2^N*3^M*5^K(N,M,K are 1, 2, 3, 4, 5, 6 ....etc, and length >= 4) is supported. Otherwise, this FFT is an out-of-place algorithm. When you want to get an in-place FFT, it creates a temp buffer as output buffer and then copies the temp buffer back to input buffer. For the usage of this function, please check test/test_suite_fft_float32.c

Definition at line 676 of file NE10_fft_float32.neon.c.

§ ne10_fft_c2c_1d_int16_c()

void ne10_fft_c2c_1d_int16_c ( ne10_fft_cpx_int16_t fout,
ne10_fft_cpx_int16_t fin,
ne10_fft_cfg_int16_t  cfg,
ne10_int32_t  inverse_fft,
ne10_int32_t  scaled_flag 
)

Mixed radix-2/4 complex FFT/IFFT of 16-bit fixed point data.

Parameters
[out]*foutpoint to the output buffer (out-of-place)
[in]*finpoint to the input buffer (out-of-place)
[in]cfgpoint to the config struct
[in]inverse_fftthe flag of IFFT, 0: FFT, 1: IFFT
[in]scaled_flagscale flag, 0 unscaled, 1 scaled
Returns
none. The function implements a mixed radix-2/4 complex FFT/IFFT. The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, this FFT is an out-of-place algorithm. For the usage of this function, please check test/test_suite_fft_int16.c

Definition at line 1110 of file NE10_fft_int16.c.

§ ne10_fft_c2c_1d_int16_neon()

void ne10_fft_c2c_1d_int16_neon ( ne10_fft_cpx_int16_t fout,
ne10_fft_cpx_int16_t fin,
ne10_fft_cfg_int16_t  cfg,
ne10_int32_t  inverse_fft,
ne10_int32_t  scaled_flag 
)

Mixed radix-2/4 complex FFT/IFFT of 16-bit fixed point data.

Mixed radix-2/4 complex FFT/IFFT of 32-bit fixed point data.

Parameters
[out]*foutpoint to the output buffer (out-of-place)
[in]*finpoint to the input buffer (out-of-place)
[in]cfgpoint to the config struct
[in]inverse_fftthe flag of IFFT, 0: FFT, 1: IFFT
[in]scaled_flagscale flag, 0 unscaled, 1 scaled
Returns
none. The function implements a mixed radix-2/4 complex FFT/IFFT. The length of 2^N(N is 1, 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, this FFT is an out-of-place algorithm. When you want to get an in-place FFT, it creates a temp buffer as output buffer and then copies the temp buffer back to input buffer. For the usage of this function, please check test/test_suite_fft_int16.c
Parameters
[out]*foutpoint to the output buffer (out-of-place)
[in]*finpoint to the input buffer (out-of-place)
[in]*twiddlespoint to the twiddle buffer
[in]*factorspoint to factors buffer. 0: stage number, 1: stride for the first stage, others: radix and stage's fft length/radix
[in]nfftlength of FFT
[in]inverse_fftthe flag of IFFT, 0: FFT, 1: IFFT
[in]scaled_flagscale flag, 0 unscaled, 1 scaled
Returns
none. The function implements a mixed radix-2/4 complex FFT/IFFT. The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, this FFT is an out-of-place algorithm. When you want to get an in-place FFT, it creates a temp buffer as output buffer and then copies the temp buffer back to input buffer. For the usage of this function, please check test/test_suite_fft_int32.c

Definition at line 746 of file NE10_fft_int16.neon.c.

§ ne10_fft_c2c_1d_int32_c()

void ne10_fft_c2c_1d_int32_c ( ne10_fft_cpx_int32_t fout,
ne10_fft_cpx_int32_t fin,
ne10_fft_cfg_int32_t  cfg,
ne10_int32_t  inverse_fft,
ne10_int32_t  scaled_flag 
)

Mixed radix-2/4 complex FFT/IFFT of 32-bit fixed point data.

Parameters
[out]*foutpoint to the output buffer (out-of-place)
[in]*finpoint to the input buffer (out-of-place)
[in]cfgpoint to the config struct
[in]inverse_fftthe flag of IFFT, 0: FFT, 1: IFFT
[in]scaled_flagscale flag, 0 unscaled, 1 scaled
Returns
none. The function implements a mixed radix-2/4 complex FFT/IFFT. The length of 2^N(N is 2, 3, 4, 5, 6 ....etc) is supported. Otherwise, this FFT is an out-of-place algorithm. For the usage of this function, please check test/test_suite_fft_int32.c

Definition at line 1072 of file NE10_fft_int32.c.

§ ne10_fft_c2c_1d_int32_neon()

void ne10_fft_c2c_1d_int32_neon ( ne10_fft_cpx_int32_t fout,
ne10_fft_cpx_int32_t fin,
ne10_fft_cfg_int32_t  cfg,
ne10_int32_t  inverse_fft,
ne10_int32_t  scaled_flag 
)

Mixed radix-2/4 complex FFT/IFFT of 32-bit fixed point data.

Parameters
[out]*foutpoint to the output buffer (out-of-place)
[in]*finpoint to the input buffer (out-of-place)
[in]cfgpoint to the config struct
[in]inverse_fftthe flag of IFFT, 0: FFT, 1: IFFT
[in]scaled_flagscale flag, 0 unscaled, 1 scaled
Returns
none. The function implements a mixed radix-2/4 complex FFT/IFFT. The length of 2^N(N is 3, 4, 5, 6 ....etc) is supported. Otherwise, this FFT is an out-of-place algorithm. When you want to get an in-place FFT, it creates a temp buffer as output buffer and then copies the temp buffer back to input buffer. For the usage of this function, please check test/test_suite_fft_int32.c

Definition at line 1220 of file NE10_fft_int32.neon.c.