FFT
FFT component. Fast Fourier Transform functions:
Radix-2 DIF
Radix-4 DIF
Mix Radix DIT (5, 4, 3, 2)
Real, Complex
Direct, Inverse
Data types:
Int32
Float32
Float16 (coming soon)
- Data sizes:
For Real Direct FFT, the number of real input samples must be equal to NFFT and the number of complex output samples will be equal to NFFT/2 + 1 (including Nyquist frequency bin). The output data represent the first half of the spectrum. The second half can be obtained from this data by taking the complex conjugate of the flipped output data vector. For the Real Inverse FFT, the number of complex input samples must be equal to NFFT/2 + 1, resulting in NFFT real output samples. For Complex FFTs, the number of complex input samples and the number of complex output samples are identical and equals to NFFT.
- Scaling:
For Fix integers data type, scaling should be performed on input or output data. Scaling values depend on NFFT.
- Input Buffers:
Please note that most of calculations are done “In Place” so input buffering must use ping pong method.
Available implementations:
C model
FC
Cluster
Note: In the Cluster implementation the processing is currently also initiated from FC. The process function gap9_cluster_fft_process
sends the actual FFT computation task to the cluster for execution and handles returned results.
Parameters
nfft
- Number of FFT points (NFFT)Type: IntegerRange: [16, 16384] for FC, [16, 4096] for Cluster
real
- Define if FFT is computed on real (1) or complex (0) input samplesType: IntegerValues: [0, 1]
inverse
- Define if FFT is direct (0) or inverse (1)Type: IntegerValues: [0, 1]
arithmetic_type
- Data type of input samples. It can be INT32 (0), FLOAT16 (4), FLOAT32 (5)Type: IntegerValues: [0, 4, 5]
Tests
nonreg.py
found in each implementation’s respective test folder will run a single FFT test case on a short predefined file input and verify output against a predefined reference file (NOTE: Cluster nonreg.py
currently fails, test will be fixed).
The component test fft_test.py
found in fft/test
is used to test all implementations and allows multiple test cases via YAML configuration file.
For each test case a sequence og gaussian white noise is generated for input signal.
The input signal is processed by both the selected target implementation and the Python model.
Outputs are compared and a pass/fail verdict is returned for each test case.
fft_test.py
is also integrated into gaptest.
Use python fft_test.py -h
for help.