FFT
Fast Fourier transform (FFT) of the input signal.
blockType: FFT
Path in the library:
|
Description
Block FFT calculates the fast Fourier transform (FFT) from the first dimension of a multidimensional input array .
The block uses one of two possible FFT implementations. You can choose an implementation based on the library. FFTW, or an implementation based on an algorithm Radix-2. For more information, see Algorithms.
|
When the input signal length is longer FFT length you can observe an increase in the amplitude of the output signal. This is due to the fact that the block FFT uses data reset modulo length to save all available input samples. To avoid such an increase in amplitude, you can truncate the length of the input sample. up to the length of the FFT . To do this, place a block in the model Pad before the block FFT. |
Ports
Input
#
IN_1
—
Input signal
vector | the matrix| multidimensional array
Details
The input signal for calculating the FFT is in the form of a vector, matrix, or multidimensional array.
The unit calculates the FFT from the first measurement of the multidimensional input signal.
| Data types |
|
| Complex numbers support |
Yes |
Output
#
OUT_1
—
FFT of the input signal
vector | the matrix| multidimensional array
Details
The FFT calculated from the first dimension of a multidimensional input array, returned as a vector, matrix, or multidimensional array.
- I’m recording -th output channel equal to -th point -point discrete Fourier transform (DFT) -th input channel:
| Data types |
|
| Complex numbers support |
Yes |
Parameters
Main
#
FFT implementation —
implementation of the FFT
Radix-2 | FFTW
Details
Implementation of the FFT:
-
FFTW— support for arbitrary length input signal; -
Radix-2— implementation of bitwise data processing. Dimension input matrix size on it must be equal to a power of two. To work with other input data sizes, use the block Pad to align or truncate these dimensions to a power of two, or, if possible, select an implementationFFTW.
| Values |
|
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Output in bit-reversed order —
output in bit-reverse order
Logical
Details
Specifies the order of the output channel elements relative to the order of the input channel elements. When this check box is selected, the output channel elements are displayed in bit-reverse order relative to the order of the input sequence. If you uncheck this option, the output channel elements will be displayed in linear order relative to the order of the input sequence.
| Block FFT calculates its output in bit-reverse order. Linear ordering of block output data FFT requires an additional reverse bit conversion operation. In many situations, you can increase the block speed. FFT by checking the box Output in bit-reversed order. |
Dependencies
To use this parameter, set for the parameter FFT implementation meaning Radix-2.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Divide output by FFT length —
divide the output by the length of the FFT
Logical
Details
If this option is selected, the block divides the FFT output by the length of the FFT. This option is useful when you want the FFT output to remain in the same amplitude range as the input.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
Inherit FFT length from input dimensions —
inherit the length of the FFT from the input dimensions
Logical
Details
Choose to inherit the length of the FFT from the input dimensions. When this option is selected, the length of the input data must be a power of two.
Dependencies
If this option is not selected, the parameter becomes available for setting the length. FFT length.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
#
FFT length —
FFT length
Int64 integer
Details
Specify the length of the FFT as an integer that is a power of two.
If for the parameter FFT implementation the value is set Radix-2 or a check box is selected Output in bit-reversed order, this value must be equal to the power of two.
Dependencies
To use this option, uncheck the box. Inherit FFT length from input dimensions.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
Yes |
#
Wrap input data when FFT length is shorter than input length —
convolution or truncation of input data
Logical
Details
The choice of convolution or truncation of the input data depending on the length of the FFT. If you select this parameter, before the FFT operation, a modulo convolution occurs when the length of the FFT is less than the length of the input. If you uncheck this box, the input data is truncated to the length of the FFT before the FFT operation.
Dependencies
To use this option, uncheck the box. Inherit FFT length from input dimensions.
| Default value |
|
| Program usage name |
|
| Tunable |
No |
| Evaluatable |
No |
Algorithms
FFTW Implementation
The FFTW implementation provides optimized FFT calculation, including support for transform lengths equal to and not equal to powers of two, as in simulation. The input data type must be floating point.
Radix-2 implementation
The Radix-2 implementation supports bit-reverse processing and allows the block to generate C code. Dimension input matrix size on it must be equal to a power of two. To work with other input data sizes, use the block Pad to complement or truncate these dimensions to the power of two.
When selecting Radix-2, the block implements one or more of the following algorithms:
-
Operation butterfly;
-
the dual signal algorithm;
-
the half-length algorithm;
-
time dilution Algorithm (DIT) Radix-2;
-
the frequency decimation algorithm (DIF) Radix-2.
Radix-2 algorithms for real and complex signals
| Complexity of input data | The order of the output data | Algorithms used to calculate the FFT |
|---|---|---|
Comprehensive |
Linear |
Bit-reversal operation and Radix-2 DIT algorithm |
Comprehensive |
Bit-reverse |
Radix-2 DIF |
Material |
Linear |
Bit-reversal and Radix-2 DIT operation combined with half-length and double-signal algorithms |
Material |
Bit-reverse |
Radix-2 DIF in combination with half-length and double-signal algorithms |
The efficiency of the FFT algorithm can be improved for real input signals by forming complex sequences from real sequences before calculating the DFT. If available Using the real input channels, the FFT block generates these complex sequences by applying the dual signal algorithm to the first ones. the input channels, and the half—length algorithm is applied to the last odd channel.
Radix-2 optimization for a table of trigonometric values
In some situations, the Radix-2 block algorithm calculates all possible trigonometric values of the twiddle factor:
where
-
— the larger value of the two values: or ;
-
.
The block stores these values in a table and retrieves them during simulation. The number of floating point entries is .
Literature
-
Orfanidis, S. J. Introduction to Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1996, p. 497.
-
Proakis, John G. and Dimitris G. Manolakis. Digital Signal Processing, 3rd ed. Upper Saddle River, NJ: Prentice Hall, 1996.
-
FFTW (https://www.fftw.org)
-
Frigo, M. and S. G. Johnson, FFTW: An Adaptive Software Architecture for the FFT, Proceedings of the International Conference on Acoustics, Speech, and Signal Processing, Vol. 3, 1998, pp. 1381-1384.