Inverse fast Fourier transform (IFFT) of input
DSP System Toolbox / Transforms
The IFFT block computes the inverse fast Fourier transform (IFFT) across the
first dimension of an ND input array. The block uses one of two
possible FFT implementations. You can select an implementation based on the FFTW library
or an implementation based on a collection of Radix2 algorithms. To allow the block to
choose the implementation, you can select Auto
. For more
information about the FFT implementations, see Algorithms.
When you specify an FFT length not equal to the length of the input vector (or first dimension of the input array), the block implements zeropadding, truncating, or moduloM (FFT length) data wrapping. This occurs before the IFFT operation. For an IFFT with P ≤ M:
y = ifft(u,M) % P ≤ M
Wrapping:
y(:,L) = ifft(datawrap(u(:,L),M)) % P > M; L = 1,...,N
Truncating:
y (:,L) = ifft(u,M) % P > M; L = 1,...,N
When the input length, P, is greater than the FFT length, M, you may see magnitude increases in your IFFT output. These magnitude increases occur because the IFFT block uses moduloM data wrapping to preserve all available input samples.
To avoid such magnitude increases, you can truncate the length of your input sample, P, to the FFT length, M. To do so, place a Pad block before the IFFT block in your model.
Port_1
— Input signalInput signal for computing the IFFT. The block computes the IFFT along the first dimension of the ND input signal. The input can be floatingpoint or fixedpoint, real, or complex, and conjugate symmetric.
For more information on how the block computes the IFFT, see Description and Algorithms.
Data Types: single
 double
 int8
 int16
 int32
 uint8
 uint16
 uint32
 fixed point
Complex Number Support: Yes
Port_1
— IFFT of inputThe IFFT, computed across the first dimension of an ND input array. For more information on how the block computes the IFFT, see Description and Algorithms.
The kth entry of the Lth output channel, y(k,L), is equal to the kth point of the Mpoint inverse discrete Fourier transform (IDFT) of the Lth input channel:
$$y(k,L)=\frac{1}{M}{\displaystyle \sum _{p=1}^{P}u(p,L){e}^{j2\pi (p1)(k1)/M}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}\text{\hspace{0.17em}}k=1,\dots ,M$$
The output has the same dimensions as the input. If the input signal has a floatingpoint data type, the data type of the output signal uses the same floatingpoint data type. Otherwise, the output can be any signed fixedpoint data type. The block computes scaled and unscaled versions of the IFFT.
Data Types: single
 double
 int8
 int16
 int32
 fixed point
FFT implementation
— FFT implementationAuto
(default)  Radix2
 FFTW
Set this parameter to FFTW
to support an
arbitrary length input signal. The block restricts generated code with
FFTW implementation to MATLAB^{®} host computers.
Set this parameter to Radix2
for bitreversed processing,
fixed or floatingpoint data, or portable Ccode generation using the
Simulink^{®} Coder™. The dimension M of the
MbyN input matrix, must be a
power of two. To work with other input sizes, use the Pad block to pad or truncate
these dimensions to powers of two, or if possible choose the FFTW
implementation. For more information about the algorithms used by the
Radix2
mode, see Radix2 Implementation.
Set this parameter to Auto
to let the block
choose the FFT implementation. For floatingpoint inputs with
nonpoweroftwo transform lengths, the FFTW algorithm is automatically
chosen. Otherwise a Radix2 algorithm is automatically chosen. For
nonpoweroftwo transform lengths, the block restricts generated code
to MATLAB host computers.
Input is in bitreversed order
— Input is in bitreversed orderoff
(default)  on
Select or clear this check box to designate the order of the input channel elements. Select this check box when the input is in bitreversed order, and clear it when the input is in linear order. The block yields invalid outputs when you do not set this parameter correctly.
You cannot select this check box if you have cleared the
Inherit FFT length from input dimensions check
box, and you are specifying the FFT length using the FFT
length parameter. Also, it cannot be selected when you
set the FFT implementation parameter to
FFTW
.
For more information on ordering of the output, see Linear and BitReversed Output Order.
To enable this parameter, set FFT
implementation to Auto
or
Radix2
.
Input is conjugate symmetric
— Input is conjugate symmetricoff
(default)  on
Select this option when the block inputs conjugate symmetric data and you want realvalued outputs. Selecting this check box optimizes the block's computation method.
The FFT block yields conjugate symmetric output when you input realvalued data. Taking the IFFT of a conjugate symmetric input matrix produces realvalued output. Therefore, if the input to the block is both floating point and conjugate symmetric, and you select this check box, the block produces realvalued outputs.
You cannot select this check box if you have cleared the Inherit FFT length from input dimensions check box, and you are specifying the FFT length using the FFT length parameter.
If you input conjugate symmetric data to the IFFT block and do not select this check box, the IFFT block outputs a complexvalued signal with small imaginary parts. The block outputs invalid data if you select this option with non conjugate symmetric input data.
Divide output by FFT length
— Divide output by FFT lengthon
(default)  off
When you select this check box, the block computes its output according to the IDFT equation, discussed in the Description section.
When you clear this check box, the block computes the output using a modified version of the IDFT: $$M\cdot y(k,l)$$, which is defined by the following equation:
$$\begin{array}{cc}M\cdot y(k,l)={\displaystyle \sum _{p=1}^{P}u(p,l){e}^{j2\pi (p1)(k1)/M}}& k=1,\mathrm{...},M\end{array}$$
The modified IDFT equation does not include the multiplication factor of 1/M.
Inherit FFT length from input dimensions
— Inherit FFT length from input dimensionson
(default)  off
Select to inherit the FFT length from the input dimensions. If you do not select this parameter, the FFT length parameter becomes available to specify the length. You cannot clear this parameter when you select either the Input is in bitreversed order or the Input is conjugate symmetric parameter.
FFT length
— FFT length64
(default)  integerSpecify FFT length as an integer greater than or equal to two.
When you set the FFT implementation parameter to
Radix2
, or when you check the Output
in bitreversed order check box, this value must be a
power of two.
To enable this parameter, clear the Inherit FFT length from input dimensions check box.
Wrap input data when FFT length is shorter than input length
— Wrap or truncate the inputon
(default)  off
Choose to wrap or truncate the input, depending on the FFT length. If you select this parameter, modulolength data wrapping occurs before the FFT operation when the FFT length is shorter than the input length. If you clear this parameter, truncation of the input data to the FFT length occurs before the FFT operation.
To enable this parameter, clear the Inherit FFT length from input dimensions check box.
Rounding mode
— Rounding methodFloor
(default)  Ceiling
 Convergent
 Nearest
 Round
 Simplest
 Zero
Select the rounding mode for fixedpoint operations.
The sine table values do not obey this parameter; instead, they
always round to Nearest
.
The Rounding mode parameter has no effect on numeric results when all these conditions are met:
Product output data type is
Inherit: Inherit via internal
rule
.
Accumulator data type is
Inherit: Inherit via internal
rule
.
With these data type settings, the block operates in fullprecision mode.
Saturate on integer overflow
— Saturate on integer overflowoff
(default)  on
When you select this parameter, the block saturates the result of its
fixedpoint operation. When you clear this parameter, the block wraps
the result of its fixedpoint operation. For details on
saturate
and wrap
, see overflow
mode for fixedpoint operations.
The Saturate on integer overflow parameter has no effect on numeric results when all these conditions are met:
Product output data type is
Inherit: Inherit via internal
rule
.
Accumulator data type is
Inherit: Inherit via internal
rule
.
With these data type settings, the block operates in fullprecision mode.
Sine table
— Data type of sine table valuesInherit: Same word length as
input
(default)  fixdt(1,16)
Choose how you specify the word length of the values of the sine table. The fraction length of the sine table values always equals the word length minus one. You can set this parameter to:
A rule that inherits a data type, for example,
Inherit: Same word length as
input
An expression that evaluates to a valid data type, for
example, fixdt(1,16)
Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Sine table parameter.
See Specify Data Types Using Data Type Assistant (Simulink) for more information.
The sine table values do not obey the Rounding
mode and Saturate on integer
overflow parameters; instead, they are always
saturated and rounded to Nearest
.
Product output
— Product output data typeInherit: Inherit via internal
rule
(default)  Inherit: Same as input
 fixdt(1,16,0)
Specify the product output data type. See Fixed Point and Multiplication Data Types for illustrations depicting the use of the product output data type in this block. You can set this parameter to:
A rule that inherits a data type, for example,
Inherit: Inherit via internal
rule
. For more information on this rule, see
Inherit via Internal Rule.
An expression that evaluates to a valid data type, for
example, fixdt(1,16,0)
Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Product output parameter.
See Specify Data Types Using Data Type Assistant (Simulink) for more information.
Accumulator
— Accumulator data typeInherit: Inherit via internal
rule
(default)  Inherit: Same as input
 Inherit: Same as product output
 fixdt(1,16,0)
Specify the accumulator data type. See Fixed Point for illustrations depicting the use of the accumulator data type in this block. You can set this parameter to:
A rule that inherits a data type, for example,
Inherit: Inherit via internal
rule
. For more information on this rule, see
Inherit via Internal Rule.
An expression that evaluates to a valid data type, for
example, fixdt(1,16,0)
Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Accumulator parameter.
See Specify Data Types Using Data Type Assistant (Simulink) for more information.
Output
— Output data typeInherit: Inherit via internal
rule
(default)  Inherit: Same as input
 fixdt(1,16,0)
Specify the output data type. See Fixed Point for illustrations depicting the use of the output data type in this block. You can set this parameter to:
A rule that inherits a data type, for example,
Inherit: Inherit via internal
rule
.
When you select Inherit: Inherit via internal
rule
, the block calculates the output word
length and fraction length automatically. The equations that the
block uses to calculate the ideal output word length and
fraction length depend on the setting of the Divide
output by FFT length check box.
When you select the Divide output by FFT length check box, the ideal output word and fraction lengths are the same as the input word and fraction lengths.
When you clear the Divide output by FFT length check box, the block computes the ideal output word and fraction lengths according to the following equations:
$$W{L}_{idealoutput}=W{L}_{input}+\text{floor}({\mathrm{log}}_{2}(FFTlength1))+1$$
$$F{L}_{idealoutput}=F{L}_{input}$$
Using these ideal results, the internal rule then selects word lengths and fraction lengths that are appropriate for your hardware. For more information, see Inherit via Internal Rule.
An expression that evaluates to a valid data type, for
example, fixdt(1,16,0)
Click the Show data type assistant button to display the Data Type Assistant, which helps you set the Output parameter.
See Control Signal Data Types (Simulink) for more information.
Output Minimum
— Minimum value block should output[]
(default)  scalarSpecify the minimum value that the block should output. The default
value is []
(unspecified). Simulink software uses this value to perform:
Simulation range checking (see Signal Ranges (Simulink))
Automatic scaling of fixedpoint data types
Output Maximum
— Maximum value block should output[]
(default)  scalarSpecify the maximum value that the block should output. The default
value is []
(unspecified). Simulink software uses this value to perform:
Simulation range checking (see Signal Ranges (Simulink))
Automatic scaling of fixedpoint data types
Lock data type settings against changes by the fixedpoint tools
— Prevent fixedpoint tools from overriding data typesoff
(default)  on
Select this parameter to prevent the fixedpoint tools from overriding the data types you specify on the block dialog box.
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

^{[a]} Variablesize signals are only supported when the Inherit FFT length from input dimensions checkbox is selected. 
The FFTW implementation provides an optimized FFT calculation including support for poweroftwo and nonpoweroftwo transform lengths in both simulation and code generation. Generated code using the FFTW implementation will be restricted to MATLAB host computers. The data type must be floatingpoint. Refer to Simulink Coder for more details on generating code.
The Radix2 implementation supports bitreversed processing, fixed or floatingpoint data, and allows the block to provide portable Ccode generation using the Simulink Coder. The dimension M of the MbyN input matrix must be a power of two. To work with other input sizes, use the Pad block to pad or truncate these dimensions to powers of two, or if possible choose the FFTW implementation.
With Radix2 selected, the block implements one or more of the following algorithms:
Butterfly operation
Doublesignal algorithm
Halflength algorithm
Radix2 decimationintime (DIT) algorithm
Radix2 decimationinfrequency (DIF) algorithm
Parameter Settings  Algorithms Used for IFFT Computation 

 Bitreversal operation and radix2 DIT 
 Radix2 DIT 
 Bitreversal operation and radix2 DIT in conjunction with the halflength and doublesignal algorithms 
 Radix2 DIT in conjunction with the halflength and doublesignal algorithms 
In certain situations, the block’s Radix–2 algorithm computes all the possible trigonometric values of the twiddle factor
$${e}^{j\frac{2\pi k}{K}}$$
where K is the greater value of either M or N and $$k=0,\cdots ,K1$$. The block stores these values in a table and retrieves them during simulation. The number of table entries for fixedpoint and floatingpoint is summarized in the following table:
Number of Table Entries for NPoint FFT  

floatingpoint  3N/4 
fixedpoint  N 
[1] Orfanidis, S. J. Introduction to Signal Processing. Upper Saddle River, NJ: Prentice Hall, 1996, p. 497.
[2] Proakis, John G. and Dimitris G. Manolakis. Digital Signal Processing, 3rd ed. Upper Saddle River, NJ: Prentice Hall, 1996.
[3] FFTW (http://www.fftw.org
)
[4] 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. 13811384.
Usage notes and limitations:
When the following conditions apply, the executable generated from
this block relies on prebuilt dynamic library files
(.dll
files) included with MATLAB:
FFT implementation is set to
FFTW
.
Inherit FFT length from input dimensions is cleared, and FFT length is set to a value that is not a power of two.
Use the packNGo
function to package
the code generated from this block and all the relevant files in a
compressed zip file. Using this zip file, you can relocate, unpack, and
rebuild your project in another development environment where
MATLAB is not installed. For more details, see How To Run a Generated Executable Outside MATLAB.
When the FFT length is a power of two, you can generate standalone C and C++ code from this block.
The following diagrams show the data types used within the IFFT block for fixedpoint signals. You can set the sine table, accumulator, product output, and output data types displayed in the diagrams in the IFFT block dialog box, as discussed in Parameters.
The IFFT block first casts input to the output data type and then stores it in the output buffer. Each butterfly stage then processes signals in the accumulator data type, with the final output of the butterfly being cast back into the output data type. The block multiplies in a twiddle factor before each butterfly stage in a decimationintime IFFT, and after each butterfly stage in a decimationinfrequency IFFT.
The output of the multiplier is in the accumulator data type because both of the inputs to the multiplier are complex. For details on the complex multiplication performed, see Multiplication Data Types.
When the block input is fixed point, all internal data types are signed fixed point.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.