DSP Blockset Previous page   Next Page
IFFT

Compute the IFFT of the input

Library

Transforms

Description

The IFFT block computes the inverse fast Fourier transform (IFFT) of each channel of an M-by-N or length-M input, u, where M must be a power of two. To work with other input sizes, use the Zero Pad block to pad or truncate the length-M dimension to a power-of-two length.

The output of the IFFT block is equivalent to the MATLAB ifft function:

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.

Sections of This Reference Page

For information on block output characteristics and how to configure the block computation methods, see other sections of this reference page:

Input and Output Characteristics

The following table describes valid inputs to the IFFT block, their corresponding outputs, and the dimension along which the block computes the IDFT.

Valid Block Inputs
  • Real- or complex-valued
  • M must be a power of two
  • In linear or bit-reversed order

Dimension Along Which Block Computes IDFT
Corresponding Block Output Characteristics
Output port rate = input port rate

Frame-based M-by-N matrix
Column
The following output characteristics apply to all valid block inputs:
  • Frame based
  • Complex valued, unless you select the Input is conjugate symmetric check box when your input is conjugate symmetric, in which case the output is real valued. The Input is conjugate symmetric check box cannot be used for fixed-point signals.
  • Same dimension as input (for 1-D inputs, output is a length-M column)
  • Each column (each row for sample-based row inputs) contains the M-point IDFT of the corresponding input channel in linear order. If the Skip normalization by transform length, N check box is selected, rather than computing the IDFT, the block computes a scaled version of the IDFT. This scaled version of the IDFT does not include the multiplication factor of 1/M.

Sample-based M-by-N matrix,  
Column
Sample-based 1-by-M row vector
Row
1-D length-M vector
Vector

The following diagram shows the effects of the input size, dimension, and frame status on the output of the IFFT block (see also ifft_ins_outs.mdl).

Selecting the Twiddle Factor Computation Method

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. Note that only Table lookup mode is supported for fixed-point signals.

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 below.
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.

Optimizing the Table of Trigonometric Values

When you set the Twiddle factor computation parameter to Table lookup, you need to also 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 FFT
Memory Required for Single-Precision 512-Point FFT
Speed
3N/4 -- floating point
N -- fixed point
1536 bytes
Memory
N/4 + 1 -- floating point
Not supported for fixed point
516 bytes

Input Order

You must select the Input is in bit-reversed order check box to designate whether the ordering of the column elements of the input is linear or bit-reversed.

Two numbers are bit-reversed values of each other when the binary representation of one is the mirror image of the binary representation of the other. For example, in a three-bit system, one and four are bit-reversed values of each other, since the three-bit binary representation of one, 001, is the mirror image of the three-bit binary representation of four, 100.

In the diagram below, the sequence 0, 1, 2, 3, 4, 5, 6, 7 is in linear order. To put the sequence in bit-reversed order, replace each element in the linearly ordered sequence with its bit-reversed counterpart. You can do this by translating the sequence into its binary representation with the minimum number of bits, then finding the mirror image of each binary entry, and finally translating the sequence back to its decimal representation. The resulting sequence is the original linearly ordered sequence in bit-reversed order.

Set the Input is in bit-reversed order parameter as follows to indicate the ordering of the input's column elements.

Parameter Setting
Ordering of Input Channel Elements

Linear order

Bit-reversed order

Conjugate Symmetric Input

When the block input is both floating point and conjugate symmetric and you want real-valued outputs, select the Input is conjugate symmetric check box. This optimizes the block's computation method. A common source of conjugate symmetric data is the FFT block, which yields conjugate symmetric output when its input is real valued.

If the IFFT block input is conjugate symmetric but you do not select the Input is conjugate symmetric check box, you do not get a real-valued output. Instead, you get a complex-valued output with small imaginary parts. The block output is invalid if you set this parameter when the input is not conjugate symmetric.

Note that the Input is conjugate symmetric parameter cannot be used for fixed-point signals.

Scaled Output

You can choose to output a scaled version of the input's IDFT, , by setting the Skip normalization by transform length, N parameter.

Algorithms Used for IFFT Computation

Depending on whether the block input is floating point or fixed point, real or complex valued, and conjugate symmetric, the block uses one or more of the following algorithms as summarized in the following tables:

For floating-point signals: 

Input Complexity
Other Parameter Settings
Algorithms Used for FFT Computation
Complex
Not applicable
Radix-2 DIT
Real

Radix-2 DIT
Real

Radix-2 DIT in conjunction with the half-length and double-signal algorithms when possible

For fixed-point signals:

Input Complexity
Other Parameter Settings
Algorithms Used for FFT Computation
Real or complex
Not applicable
Radix-2 DIT

Fixed-Point Data Types

The diagrams below 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 mask as discussed in Dialog Box.

Inputs to the IFFT block are first cast to the output data type and stored 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. A twiddle factor is multiplied in 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 since both of the inputs to the multiplier are complex. For details on the complex multiplication performed, refer to Multiplication Data Types.

Examples

For an example of how to optimize computations when using both the IFFT block and FFT block in the same model, see the FFT block reference page example, The Use of Bit-Reversed Outputs

Dialog Box

Twiddle factor computation
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.
Optimize table for
Select the optimization of the table of sine and cosine values for Speed or Memory. This parameter is only available when the Twiddle factor computation parameter is set to Table lookup. See Optimizing the Table of Trigonometric Values.
This parameter must be set to Speed for fixed-point signals.
Input is in bit-reversed order
Designate the order of the input channel elements. Select when the input is in bit-reversed order, and clear when the input is in linear order. The block yields invalid outputs if you do not set this parameter correctly. See Input Order.
Input is conjugate symmetric
Select when the input to the block is both floating point and conjugate symmetric, and you want real-valued outputs. The block output is invalid if you set this parameter when the input is not conjugate symmetric. This parameter cannot be used for fixed-point signals.
Skip scaling
When you select this check box, no scaling occurs. When this parameter is unselected, scaling does occur:
Show additional parameters
If selected, additional parameters specific to implementation of the block become visible as shown.

Allow overrides from DSP Fixed-Point Attributes blocks
If you select this parameter, fixed-point data types for this block may be set by DSP Fixed-Point Attributes blocks in your model. If this parameter is unselected, the data types are always set by the parameters in the block mask.
Fixed-point sine table attributes
Choose how you will specify the word length and fraction length of the values of the sine table. If you select Same as input, the word and fraction lengths of the sine table values are the same as those of the input of the block. If you select Same as output, they are the same as those of the output of the block. If you select User-defined, the Fixed-point sine table word length and Fixed-point sine table fraction length parameters become visible.
The sine table values do not obey the Round integer calculations toward and Saturate on integer overflow parameters; they are always saturated and rounded to Nearest.
Fixed-point sine table word length
Specify the word length, in bits, of the sine table values. This parameter is only visible if User-defined is specified for the Fixed-point sine table attributes parameter.
Fixed-point sine table fraction length
Specify the fraction length, in bits, of the sine table values. This parameter is only visible if User-defined is specified for the Fixed-point sine table attributes parameter.
Fixed-point output attributes
Choose how you will specify the output word length and fraction length. If you select Same as input, these characteristics will match those of the input to the block. If you select User-defined, the Output word length and Output fraction length parameters become visible.
Output word length
Specify the word length, in bits, of the output. This parameter is only visible if User-defined is specified for the Fixed-point output attributes parameter.
Output fraction length
Specify the fraction length, in bits, of the output. This parameter is only visible if User-defined is specified for the Fixed-point output attributes parameter.
Fixed-point accumulator attributes
Use this parameter to specify how you would like to designate the accumulator word and fraction lengths. Refer to Fixed-Point Data Types and Multiplication Data Types for illustrations depicting the use of the accumulator data type in this block.
If you select Same as input, the accumulator word and fraction lengths are the same as those of the input to the block. If you select Same as output, they are the same as those of the output of the block. If you select User-defined, the Accumulator word length and Accumulator fraction length parameters become visible.
Accumulator word length
Specify the word length, in bits, of the accumulator. This parameter is only visible if User-defined is specified for the Fixed-point accumulator attributes parameter.
Accumulator fraction length
Specify the fraction length, in bits, of the accumulator. This parameter is only visible if User-defined is specified for the Fixed-point accumulator attributes parameter.
Fixed-point product output attributes
Use this parameter to specify how you would like to designate the product output word and fraction lengths. Refer to Fixed-Point Data Types and Multiplication Data Types for illustrations depicting the use of the product output data type in this block.
If you select Same as input, Same as output, or Same as accumulator, the product output word and fraction lengths are the same as those of the input, output, or accumulator of the block, respectively. If you select User-defined, the Product output word length and Product output fraction length parameters become visible.
Product output word length
Specify the word length, in bits, of the product output. This parameter is only visible if User-defined is specified for the Fixed-point product output attributes parameter.
Product output fraction length
Specify the fraction length, in bits, of the product output. This parameter is only visible if User-defined is specified for the Fixed-point product output attributes parameter.
Round integer calculations toward
Select the rounding mode for fixed-point operations. The sine table values do not obey this parameter; they always round to Nearest.
Saturate on integer overflow
If selected, overflows saturate. The sine table values do not obey this parameter; they are always saturated.

Supported Data Types

To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.

See Also

FFT
DSP Blockset
IDCT
DSP Blockset
Pad
DSP Blockset
Zero Pad
DSP Blockset
bitrevorder
Signal Processing Toolbox
fft
Signal Processing Toolbox
ifft
Signal Processing Toolbox


Previous page  IDWT Inherit Complexity Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS