IFFT - Compute inverse fast Fourier transform (IFFT) of input

Library

Transforms

dspxfrm3

Description

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.

Input and Output Characteristics

The following table describes the input and output characteristics of the IFFT block. The table's columns provide the following information:

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:

  • Frame based

  • Complex valued. If you input conjugate symmetric data and select the Input is conjugate symmetric check box, the block outputs a real-valued result.

  • Same dimension as input (for 1-D inputs, output is a length-M column).

  • Each output column (each row for sample-based row inputs) contains the M-point IDFT of the corresponding input channel in linear order. If you do not select the Divide output by FFT length check box, the block computes a modified version of the IDFT that does not include the multiplication factor of 1/M.

Sample-based 1-by-P row vector

Row

1-D length-P vector

Vector

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. For fixed-point signals, only Table lookup mode is supported.

Twiddle Factor Computation Parameter SettingSine and Cosine Computation MethodEffect 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.

Optimizing the Table of Trigonometric Values

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 SettingNumber of Table Entries for N-Point IFFTMemory 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

Input Order

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.

Conjugate Symmetric Input

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.

Scaled Output

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:

Algorithms Used for IFFT Computation

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:

Input ComplexityOther Parameter SettingsAlgorithms 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:

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:

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.

Fixed-Point Data Types

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.

Examples

See Transforming Frequency-Domain Data into the Time Domain in the Signal Processing Blockset User's Guide.

Dialog Box

The Main pane of the IFFT block dialog appears as follows.

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

Input is in bit-reversed order

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.

Input is conjugate symmetric

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.

Divide output by FFT length

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.

Inherit FFT length from input dimensions

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.

FFT length

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.

Rounding mode

Select the rounding mode for fixed-point operations. The sine table values do not obey this parameter; instead, they always round to Nearest.

Overflow mode

Select the overflow mode for fixed-point operations. The sine table values do not obey this parameter; instead, they are always saturated.

Sine table

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:

The sine table values do not obey the Rounding mode and Overflow mode parameters; instead, they are always saturated and rounded to Nearest.

Product output

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:

Accumulator

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:

Output

Choose how you specify the output word length and fraction length:

Lock scaling against changes by the autoscaling tool

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.

References

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

Supported Data Types

PortSupported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

Output

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

See Also

FFTSignal Processing Blockset
IDCTSignal Processing Blockset
PadSignal Processing Blockset
bitrevorderSignal Processing Toolbox
fftMATLAB
ifftMATLAB

  


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