Embedded Target for Texas Instruments C6000 DSPs | ![]() ![]() |
Compute the radix-2 decimation-in-frequency forward FFT of a complex input vector
Library
Description
The Radix-2 FFT block computes the radix-2 decimation-in-frequency forward FFT of each channel of a complex input signal. The input length of each channel must be both a power of two and in the range 16 to 32,768, inclusive. The input must also be in natural (linear) order. The output of this block is a complex signal in bit-reversed order. Inputs and outputs are signed 16-bit fixed-point data types, and the output data type matches the input data type.
You can use the Bit Reverse block to reorder the output of the Radix-2 FFT block to natural order.
The Radix-2 FFT block supports both continuous and discrete sample times. This block supports little-endian code generation.
Dialog Box
Algorithm
In simulation, the Radix-2 FFT block is equivalent to the TMS320C62x DSP Library assembly code function DSP_radix2
. During code generation, this block calls the DSP_radix2
routine to produce optimized code.
Examples
The output of the Radix-2 FFT block is bit-reversed. This example shows you how to use the Bit Reverse block to reorder the output of the Radix-2 FFT block to natural order.
The following code calculates the same FFT as the above model in the workspace. The output from this calculation, y2
, is then displayed side-by-side with the output from the model, c
. The outputs match, showing that the Bit Reverse block does reorder the Radix-2 FFT block output to natural order:
k = 4;
n = 2^k;
xr = zeros(n, 1);
xr(2) = 0.5;
xi = zeros(n, 1);
x2 = complex(xr, xi);
y2 = fft(x2);
[y2, c]
0.5000 0.5000
0.4619 - 0.1913i 0.4619 - 0.1913i
0.3536 - 0.3536i 0.3535 - 0.3535i
0.1913 - 0.4619i 0.1913 - 0.4619i
0 - 0.5000i 0 - 0.5000i
-0.1913 - 0.4619i -0.1913 - 0.4619i
-0.3536 - 0.3536i -0.3535 - 0.3535i
-0.4619 - 0.1913i -0.4619 - 0.1913i
-0.5000 -0.5000
-0.4619 + 0.1913i -0.4619 + 0.1913i
-0.3536 + 0.3536i -0.3535 + 0.3535i
-0.1913 + 0.4619i -0.1913 + 0.4619i
0 + 0.5000i 0 + 0.5000i
0.1913 + 0.4619i 0.1913 + 0.4619i
0.3536 + 0.3536i 0.3535 + 0.3535i
0.4619 + 0.1913i 0.4619 + 0.1913i
See Also
Bit Reverse, FFT, Radix-2 IFFT
![]() | Matrix Transpose | Radix-2 IFFT | ![]() |