| Signal Processing Blockset™ | ![]() |
Transforms
dspxfrm3
The IFFT block computes the inverse fast Fourier transform (IFFT) of each row of a sample-based 1-by-P input vector, u, or across the first dimension (P) of an N-D input array, u. When you select the Inherit FFT length from input dimensions check box, P must be an integer power of two and the FFT length, M, gets set equal to P. If you do not select the check box, P can be any length, and the value of the FFT length parameter, M, must be a positive integer power of two. For user-specified FFT lengths, when M is not equal to P, zero padding or modulo-M data wrapping happens before the IFFT operation, as per Orfanidis [1].
y = ifft(u,M) % P ≤ M
y(:,l) = ifft(datawrap(u(:,l),M)) % P > M; l = 1,...,N
To get zero padding or truncation rather than zero padding or wrapping, use a Pad block before the IFFT block in your model to obtain a power-of-two input length.
The kth entry of the lth output channel, y(k, l), is equal to the kth point of the M-point inverse discrete Fourier transform (IDFT) of the lth input channel:

This block supports real and complex floating-point and fixed-point inputs.
The following table describes the input and output characteristics of the IFFT block. The table's columns provide the following information:
Valid inputs to the IFFT block. They can be real- or complex-valued, and they can be in linear or bit-reversed order.
The dimension along which the block computes the IDFT.
The corresponding block output characteristics. The output port rate must equal the input port rate.
Valid Block Inputs | Dimension Along Which Block Computes IDFT | Corresponding Block Output Characteristics |
|---|---|---|
N-D array | First dimension | The following output characteristics apply to all valid block inputs:
|
Sample-based 1-by-P row vector | Row | |
1-D length-P vector | Vector |
The Twiddle factor computation parameter
determines how the block computes the necessary sine and cosine terms
to calculate the term
,
shown in the first equation of this block reference page. This parameter
has two settings, each with its advantages and disadvantages, as described
in the following table. For fixed-point signals, only Table
lookup mode is supported.
| Twiddle Factor Computation Parameter Setting | Sine and Cosine Computation Method | Effect on Block Performance |
|---|---|---|
Table lookup | The block computes and stores the trigonometric values before the simulation starts and retrieves them during the simulation. When you generate code from the block, the processor running the generated code stores the trigonometric values computed by the block and retrieves the values during code execution. | The block usually runs much more quickly, but requires extra memory for storing the precomputed trigonometric values. You can optimize the table for memory consumption or speed, as described in Optimizing the Table of Trigonometric Values. |
Trigonometric fcn | The block computes sine and cosine values during the simulation. When you generate code from the block, the processor running the generated code computes the sine and cosine values while the code runs. | The block usually runs more slowly, but does not need extra data memory. For code generation, the block requires a support library to emulate the trigonometric functions, increasing the size of the generated code. |
When you set the Twiddle factor computation parameter to Table lookup, you also need to set the Optimize table for parameter. This parameter optimizes the table of trigonometric values for speed or memory by varying the number of table entries as summarized in the following table.
| Optimize Table for Parameter Setting | Number of Table Entries for N-Point IFFT | Memory Required for Single-Precision 512-Point IFFT |
|---|---|---|
Speed | 3N/4 — floating point N — fixed point |
|
Memory | N/4 — floating point Not supported for fixed point |
|
Select or clear the Input is in bit-reversed order check box to designate the ordering of the column elements of the block input. If you select the Input is in bit-reversed order check box, the block assumes the input is in bit-reversed order. If you clear the Input is in bit-reversed order check box, the block assumes the input is in linear order. For more information on ordering of the output, see Linear and Bit-Reversed Output Order.
The FFT block yields conjugate symmetric output when you input real-valued data. Taking the IFFT of a conjugate symmetric input matrix produces real-valued output. Therefore, if you input conjugate symmetric data and select the Input is conjugate symmetric check box, the block produces real-valued outputs. Selecting this check box optimizes the block's computation method.
If you input conjugate symmetric data to the IFFT block and do not select the Input is conjugate symmetric check box, the IFFT block outputs a complex-valued signal with small imaginary parts. If you select this check box and the input is not conjugate symmetric, the block output is invalid.
When you select the Divide output by FFT length check box, the block computes its output according to the IDFT equation, discussed in the Description section.
If you clear the Divide output by FFT length check
box, the block computes a modified version of the IDFT,
, which is defined
by the following equation:

Depending on whether the block input is in bit-reversed order, conjugate symmetric order, or both, the block uses one or more of the following algorithms as summarized in the subsequent table:
Bit-reversal operation
Double-signal algorithm
Half-length algorithm
Radix-2 decimation-in-time (DIT) algorithm
| Input Complexity | Other Parameter Settings | Algorithms Used for IFFT Computation |
|---|---|---|
Real or complex |
| Bit-reversal operation and radix-2 DIT |
Real or complex |
| Radix-2 DIF |
Real or complex |
| Bit-reversal operation and radix-2 DIT in conjunction with the half-length and double-signal algorithms |
Real or complex |
| Radix-2 DIF in conjunction with the half-length and double-signal algorithms |
When the Input is conjugate symmetric check box is selected, the efficiency of the IFFT algorithm can be enhanced in two ways:
By forming one length-M complex-valued sequence from two length-M conjugate symmetric input sequences
By forming one length-M complex-valued sequence from one length-2M conjugate symmetric input sequence
These optimizations correspond to the optimizations used in the FFT computation of real input signals.
When there are 2N+1 conjugate symmetric input channels and the Input is conjugate symmetric check box is selected, the IFFT block applies the double-signal algorithm to the first 2N input channels and the half-length algorithm to the last odd-numbered channel. If the input signals have fixed-point data types, it is possible to see different numerical results in the output of the last odd channel, even if all input channels are identical. This numerical difference results from differences in the double-signal algorithm and the half-length algorithm.
You can eliminate this numerical difference in two ways:
Using full precision arithmetic for fixed-point input signals
Changing the input data type to floating point
For more information on the double-signal and half-length algorithms, see Proakis [2]. "Efficient Computation of the DFT of Two Real Sequences" on page 475 describes the double signal algorithm. "Efficient Computation of the DFT of a 2N-Point Real Sequence" on page 476 describes the half-length algorithm.
The following diagrams show the data types used within the IFFT block for fixed-point signals. You can set the sine table, accumulator, product output, and output data types displayed in the diagrams in the IFFT block dialog, as discussed in Dialog Box.
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 decimation-in-time IFFT, and after each butterfly stage in a decimation-in-frequency 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.
See Transforming Frequency-Domain Data into the Time Domain in the Signal Processing Blockset User's Guide.
The Main pane of the IFFT block dialog appears as follows.

Specify the computation method of the term
shown in the first
equation of this block reference page.
In Table lookup mode, the block computes and stores the sine and cosine values before the simulation starts.
In Trigonometric fcn mode, the block computes the sine and cosine values during the simulation. See Selecting the Twiddle Factor Computation Method.
This parameter must be set to Table lookup for fixed-point signals.
Select this option to optimize the table of sine and cosine values for either Speed or Memory. This parameter becomes available only when you set the Twiddle factor computation parameter to Table lookup. See Optimizing the Table of Trigonometric Values.
This parameter must be set to Speed for fixed-point signals.
Designate the order of the input channel elements. Select this check box when the input is in bit-reversed order, and clear this check box when the input is in linear order. The block yields invalid outputs when you do not set this parameter correctly. See Input Order.
You cannot select this parameter if you have cleared the Inherit FFT length from input dimensions parameter, and you are specifying the FFT length using the FFT length parameter.
Select this option when the input to the block is conjugate symmetric and you want real-valued outputs. If you select this option and the input is not conjugate symmetric, the block output is invalid.
You cannot select this parameter if you have cleared the Inherit FFT length from input dimensions parameter, and you are specifying the FFT length using the FFT length parameter.
When you select this check box, the block computes the 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. The modified IDFT equation does not include the multiplication factor of 1/M. For the full equation, see Scaled Output.
Select to inherit the FFT length from the input dimensions. When you select this parameter, the input length P must be a power of two. If you do not select this parameter, the FFT length parameter becomes available.
You cannot clear this parameter when you select either the Input is in bit-reversed order or the Input is conjugate symmetric parameter.
Specify a power-of-two FFT length. This parameter only becomes available if you do not select the Inherit FFT length from input dimensions parameter.
The Fixed-point pane of the IFFT block dialog appears as follows.

Select the rounding mode for fixed-point operations. The sine table values do not obey this parameter; instead, they always round to Nearest.
Select the overflow mode for fixed-point operations. The sine table values do not obey this parameter; instead, they are always saturated.
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:
When you select Same word length as input, the word length of the sine table values match that of the input to the block.
When you select Specify word length, you can enter the word length of the sine table values, in bits.
The sine table values do not obey the Rounding mode and Overflow mode parameters; instead, they are always saturated and rounded to Nearest.
Use this parameter to specify how you would like to designate the product output word and fraction lengths. See Fixed-Point Data Types and Multiplication Data Types for illustrations depicting the use of the product output data type in this block:
When you select Inherit via internal rule, the product output word length and fraction length are calculated automatically. For information about how the block calculates the product output word and fraction lengths when an internal rule is used, see Inherit via Internal Rule.
When you select Same as input, these characteristics match those of the input to the block.
When you select Binary point scaling, you can enter the word length and the fraction length of the product output, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the product output. This block requires power-of-two slope and a bias of zero.
Use this parameter to specify how you would like to designate the accumulator word and fraction lengths. See Fixed-Point Data Types and Multiplication Data Types for illustrations depicting the use of the accumulator data type in this block:
When you select Inherit via internal rule, the block calculates the accumulator word length and fraction length automatically. For information about how block calculates the accumulator word and fraction lengths when an internal rule is used, see Inherit via Internal Rule.
When you select Same as product output, these characteristics match those of the product output.
When you select Same as input, these characteristics match those of the input to the block.
When you select Binary point scaling, you can enter the word length and the fraction length of the accumulator, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the accumulator. This block requires power-of-two slope and a bias of zero.
Choose how you specify the output word length and fraction length:
When you select Inherit via internal rule, the block calculates the output word length and fraction length automatically. The internal rule first calculates an ideal output word length and fraction length using the following equations:
![]()
![]()
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.
When you select Same as input, these characteristics match those of the input to the block.
When you select Binary point scaling, you can enter the word length and the fraction length of the output, in bits.
When you select Slope and bias scaling, you can enter the word length, in bits, and the slope of the output. This block requires power-of-two slope and a bias of zero.
Select this parameter to prevent any fixed-point scaling you specify in this block mask from being overridden by the autoscaling feature of the Fixed-Point Tool. See the fxptdlg reference page for more information.
[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.
| Port | Supported Data Types |
|---|---|
Input |
|
Output |
|
| FFT | Signal Processing Blockset |
| IDCT | Signal Processing Blockset |
| Pad | Signal Processing Blockset |
| bitrevorder | Signal Processing Toolbox |
| fft | MATLAB |
| ifft | MATLAB |
![]() | IDWT | Inherit Complexity | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |