|
|
|
|
@ -604,162 +604,6 @@ extern void arm_radix4_butterfly_f16(
|
|
|
|
|
@ingroup groupTransforms
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@defgroup ComplexFFT Complex FFT Functions
|
|
|
|
|
|
|
|
|
|
@par
|
|
|
|
|
The Fast Fourier Transform (FFT) is an efficient algorithm for computing the
|
|
|
|
|
Discrete Fourier Transform (DFT). The FFT can be orders of magnitude faster
|
|
|
|
|
than the DFT, especially for long lengths.
|
|
|
|
|
The algorithms described in this section
|
|
|
|
|
operate on complex data. A separate set of functions is devoted to handling
|
|
|
|
|
of real sequences.
|
|
|
|
|
@par
|
|
|
|
|
There are separate algorithms for handling floating-point, Q15, and Q31 data
|
|
|
|
|
types. The algorithms available for each data type are described next.
|
|
|
|
|
@par
|
|
|
|
|
The FFT functions operate in-place. That is, the array holding the input data
|
|
|
|
|
will also be used to hold the corresponding result. The input data is complex
|
|
|
|
|
and contains <code>2*fftLen</code> interleaved values as shown below.
|
|
|
|
|
<pre>{real[0], imag[0], real[1], imag[1], ...} </pre>
|
|
|
|
|
The FFT result will be contained in the same array and the frequency domain
|
|
|
|
|
values will have the same interleaving.
|
|
|
|
|
|
|
|
|
|
@par Floating-point
|
|
|
|
|
The floating-point complex FFT uses a mixed-radix algorithm. Multiple radix-8
|
|
|
|
|
stages are performed along with a single radix-2 or radix-4 stage, as needed.
|
|
|
|
|
The algorithm supports lengths of [16, 32, 64, ..., 4096] and each length uses
|
|
|
|
|
a different twiddle factor table.
|
|
|
|
|
@par
|
|
|
|
|
The function uses the standard FFT definition and output values may grow by a
|
|
|
|
|
factor of <code>fftLen</code> when computing the forward transform. The
|
|
|
|
|
inverse transform includes a scale of <code>1/fftLen</code> as part of the
|
|
|
|
|
calculation and this matches the textbook definition of the inverse FFT.
|
|
|
|
|
@par
|
|
|
|
|
For the MVE version, the new arm_cfft_init_f32 initialization function is
|
|
|
|
|
<b>mandatory</b>. <b>Compilation flags are available to include only the required tables for the
|
|
|
|
|
needed FFTs.</b> Other FFT versions can continue to be initialized as
|
|
|
|
|
explained below.
|
|
|
|
|
@par
|
|
|
|
|
For not MVE versions, pre-initialized data structures containing twiddle factors
|
|
|
|
|
and bit reversal tables are provided and defined in <code>arm_const_structs.h</code>. Include
|
|
|
|
|
this header in your function and then pass one of the constant structures as
|
|
|
|
|
an argument to arm_cfft_f32. For example:
|
|
|
|
|
@par
|
|
|
|
|
<code>arm_cfft_f32(arm_cfft_sR_f32_len64, pSrc, 1, 1)</code>
|
|
|
|
|
@par
|
|
|
|
|
computes a 64-point inverse complex FFT including bit reversal.
|
|
|
|
|
The data structures are treated as constant data and not modified during the
|
|
|
|
|
calculation. The same data structure can be reused for multiple transforms
|
|
|
|
|
including mixing forward and inverse transforms.
|
|
|
|
|
@par
|
|
|
|
|
Earlier releases of the library provided separate radix-2 and radix-4
|
|
|
|
|
algorithms that operated on floating-point data. These functions are still
|
|
|
|
|
provided but are deprecated. The older functions are slower and less general
|
|
|
|
|
than the new functions.
|
|
|
|
|
@par
|
|
|
|
|
An example of initialization of the constants for the arm_cfft_f32 function follows:
|
|
|
|
|
@code
|
|
|
|
|
const static arm_cfft_instance_f32 *S;
|
|
|
|
|
...
|
|
|
|
|
switch (length) {
|
|
|
|
|
case 16:
|
|
|
|
|
S = &arm_cfft_sR_f32_len16;
|
|
|
|
|
break;
|
|
|
|
|
case 32:
|
|
|
|
|
S = &arm_cfft_sR_f32_len32;
|
|
|
|
|
break;
|
|
|
|
|
case 64:
|
|
|
|
|
S = &arm_cfft_sR_f32_len64;
|
|
|
|
|
break;
|
|
|
|
|
case 128:
|
|
|
|
|
S = &arm_cfft_sR_f32_len128;
|
|
|
|
|
break;
|
|
|
|
|
case 256:
|
|
|
|
|
S = &arm_cfft_sR_f32_len256;
|
|
|
|
|
break;
|
|
|
|
|
case 512:
|
|
|
|
|
S = &arm_cfft_sR_f32_len512;
|
|
|
|
|
break;
|
|
|
|
|
case 1024:
|
|
|
|
|
S = &arm_cfft_sR_f32_len1024;
|
|
|
|
|
break;
|
|
|
|
|
case 2048:
|
|
|
|
|
S = &arm_cfft_sR_f32_len2048;
|
|
|
|
|
break;
|
|
|
|
|
case 4096:
|
|
|
|
|
S = &arm_cfft_sR_f32_len4096;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
@endcode
|
|
|
|
|
@par
|
|
|
|
|
The new arm_cfft_init_f32 can also be used.
|
|
|
|
|
@par Q15 and Q31
|
|
|
|
|
The floating-point complex FFT uses a mixed-radix algorithm. Multiple radix-4
|
|
|
|
|
stages are performed along with a single radix-2 stage, as needed.
|
|
|
|
|
The algorithm supports lengths of [16, 32, 64, ..., 4096] and each length uses
|
|
|
|
|
a different twiddle factor table.
|
|
|
|
|
@par
|
|
|
|
|
The function uses the standard FFT definition and output values may grow by a
|
|
|
|
|
factor of <code>fftLen</code> when computing the forward transform. The
|
|
|
|
|
inverse transform includes a scale of <code>1/fftLen</code> as part of the
|
|
|
|
|
calculation and this matches the textbook definition of the inverse FFT.
|
|
|
|
|
@par
|
|
|
|
|
Pre-initialized data structures containing twiddle factors and bit reversal
|
|
|
|
|
tables are provided and defined in <code>arm_const_structs.h</code>. Include
|
|
|
|
|
this header in your function and then pass one of the constant structures as
|
|
|
|
|
an argument to arm_cfft_q31. For example:
|
|
|
|
|
@par
|
|
|
|
|
<code>arm_cfft_q31(arm_cfft_sR_q31_len64, pSrc, 1, 1)</code>
|
|
|
|
|
@par
|
|
|
|
|
computes a 64-point inverse complex FFT including bit reversal.
|
|
|
|
|
The data structures are treated as constant data and not modified during the
|
|
|
|
|
calculation. The same data structure can be reused for multiple transforms
|
|
|
|
|
including mixing forward and inverse transforms.
|
|
|
|
|
@par
|
|
|
|
|
Earlier releases of the library provided separate radix-2 and radix-4
|
|
|
|
|
algorithms that operated on floating-point data. These functions are still
|
|
|
|
|
provided but are deprecated. The older functions are slower and less general
|
|
|
|
|
than the new functions.
|
|
|
|
|
@par
|
|
|
|
|
An example of initialization of the constants for the arm_cfft_q31 function follows:
|
|
|
|
|
@code
|
|
|
|
|
const static arm_cfft_instance_q31 *S;
|
|
|
|
|
...
|
|
|
|
|
switch (length) {
|
|
|
|
|
case 16:
|
|
|
|
|
S = &arm_cfft_sR_q31_len16;
|
|
|
|
|
break;
|
|
|
|
|
case 32:
|
|
|
|
|
S = &arm_cfft_sR_q31_len32;
|
|
|
|
|
break;
|
|
|
|
|
case 64:
|
|
|
|
|
S = &arm_cfft_sR_q31_len64;
|
|
|
|
|
break;
|
|
|
|
|
case 128:
|
|
|
|
|
S = &arm_cfft_sR_q31_len128;
|
|
|
|
|
break;
|
|
|
|
|
case 256:
|
|
|
|
|
S = &arm_cfft_sR_q31_len256;
|
|
|
|
|
break;
|
|
|
|
|
case 512:
|
|
|
|
|
S = &arm_cfft_sR_q31_len512;
|
|
|
|
|
break;
|
|
|
|
|
case 1024:
|
|
|
|
|
S = &arm_cfft_sR_q31_len1024;
|
|
|
|
|
break;
|
|
|
|
|
case 2048:
|
|
|
|
|
S = &arm_cfft_sR_q31_len2048;
|
|
|
|
|
break;
|
|
|
|
|
case 4096:
|
|
|
|
|
S = &arm_cfft_sR_q31_len4096;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
@endcode
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@addtogroup ComplexFFT
|
|
|
|
|
@{
|
|
|
|
|
|