XCORE SDK
XCORE Software Development Kit
|
When computing DFTs this library relies on one or both of a pair of look-up tables which contain portions of the Discrete Fourier Transform matrix. Longer FFT lengths require larger look-up tables. When building using CMake, the maximum FFT length can be specified as a CMake option, and these tables are auto-generated at build time.
If not using CMake, you can manually generate these files using a python script included with the library. The script is located at lib_xs3_math/scripts/gen_fft_table.py
. If generated manually, you must add the generated .c file as a source, and the directory containing xs3_fft_lut.h
must be added as an include directory when compiling the library's files.
Note that the header file must be named xs3_fft_lut.h
as it is included via #include "xs3_fft_lut.h"
.
By default the tables contain the coefficients necessary to perform forward or inverse DFTs of up to 1024 points. If larger DFTs are required, or if the maximum required DFT size is known to be less than 1024 points, the MAX_FFT_LEN_LOG2
CMake option can be modified from its default value of 10
.
The two look-up tables correspond to the decimation-in-time and decimation-in-frequency FFT algorithms, and the run-time symbols for the tables are xs3_dit_fft_lut
and xs3_dif_fft_lut
respectively. Each table contains \(N-4\) complex 32-bit values, with a size of \(8\cdot (N-4)\) bytes each.
To manually regenerate the tables for amaximum FFT length of \(16384\) ( \(=2^{14}\)), supporting only the decimation-in-time algorithm, for example, use the following:
Use the --help
flag with gen_fft_table.py
for a more detailed description of its syntax and parameters.