# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English version of the page.

# dsp.IFFT System object

Inverse discrete Fourier transform (IDFFT)

## Description

The `IFFT` object computes the inverse discrete Fourier transform (IDFFT) of the input. The object uses one or more of the following fast Fourier transform (FFT) algorithms depending on the complexity of the input and whether the output is in linear or bit-reversed order:

• Double-signal algorithm

• Half-length algorithm

• An algorithm chosen by FFTW [1], [2]

To compute the IFFT of the input:

1. Define and set up your IFFT object. See Construction.

2. Call `step` to compute the IFFT of the input according to the properties of `dsp.IFFT`. The behavior of `step` is specific to each object in the toolbox.

### Note

Starting in R2016b, instead of using the `step` method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, ```y = step(obj,x)``` and `y = obj(x)` perform equivalent operations.

## Construction

`ift = dsp.IFFT` returns an `IFFT` object, `ift`, that computes the IDFT of a column vector or N-D array. For column vectors or N-D arrays, the `IFFT` object computes the IDFT along the first dimension of the array. If the input is a row vector, the `IFFT` object computes a row of single-sample IDFTs and issues a warning.

```ift = dsp.IFFT('PropertyName',PropertyValue, ...)``` returns an `IFFT` object, `ift`, with each property set to the specified value.

## Properties

 `FFTImplementation` FFT implementation Specify the implementation used for the FFT as one of `Auto` | `Radix-2` | `FFTW`. When you set this property to `Radix-2`, the FFT length must be a power of two. `BitReversedInput` Enable bit-reversed order interpretation of input elements Set this property to`true` if the order of Fourier transformed input elements to the `IFFT` object are in bit-reversed order. This property applies only when the `FFTLengthSource` property is `Auto`. The default is `false`, which denotes linear ordering. `ConjugateSymmetricInput` Enable conjugate symmetric interpretation of input Set this property to `true` if the input is conjugate symmetric to yield real-valued outputs. The discrete Fourier transform of a real valued sequence is conjugate symmetric, and setting this property to `true` optimizes the IDFT computation method. Setting this property to `false` for conjugate symmetric inputs may result in complex output values with nonzero imaginary parts. This occurs due to rounding errors. Setting this property to `true` for nonconjugate symmetric inputs results in invalid outputs. This property applies only when the `FFTLengthSource` property is `Auto`. The default is `false`. `Normalize` Enable dividing output by FFT length Specify whether to divide the IFFT output by the FFT length. The default is `true` and each element of the output is divided by the FFT length. `FFTLengthSource` Source of FFT length Specify how to determine the FFT length as `Auto` or `Property`. When you set this property to `Auto`, the FFT length equals the number of rows of the input signal. This property applies only when both the `BitReversedInput` and `ConjugateSymmetricInput` properties are `false`. The default is `Auto`. `FFTLength` FFT length Specify the FFT length as a numeric scalar. This property applies when you set the `BitReversedInput` and `ConjugateSymmetricInput` properties to `false`, and the `FFTLengthSource` property to `Property`. The default is `64`. This property must be a power of two when the input is a fixed-point data type, or when you set the `FFTImplementation` property to `Radix-2`. When you set the `FFT implementation` property to `Radix-2`, or when you set the `BitReversedOutput` property to `true`, this value must be a power of two. `WrapInput` Boolean value of wrapping or truncating input Wrap input data when `FFTLength` is shorter than input length. If this property is set to true, modulo-length data wrapping occurs before the FFT operation, given `FFTLength` is shorter than the input length. If this property is set to false, truncation of the input data to the `FFTLength` occurs before the FFT operation. The default is `true`.

## Methods

 step Inverse discrete Fourier transform of input
Common to All System Objects
`clone`

Create System object with same property values

`getNumInputs`

Expected number of inputs to a System object

`getNumOutputs`

Expected number of outputs of a System object

`isLocked`

Check locked states of a System object (logical)

`release`

Allow System object property value changes

## Examples

expand all

Compute the FFT of a noisy sinusoidal input signal. The energy of the signal is stored as the magnitude square of the FFT coefficients. Determine the FFT coefficients which occupy 99.99% of the signal energy and reconstruct the time-domain signal by taking the IFFT of these coefficients. Compare the reconstructed signal with the original signal.

`Note``: `If you are using R2016a or an earlier release, replace each call to the object with the equivalent `step` syntax. For example, `obj(x)` becomes `step(obj(x).`

Consider a time-domain signal , which is defined over the finite time interval . The energy of the signal is given by the following equation:

FFT Coefficients, are considered as signal values in the frequency domain. The energy of the signal in the frequency-domain is hence the sum of the squares of the magnitude of the FFT coefficients:

According to Parseval's theorem, the total energy of the signal in time or frequency-domain is the same.

Initialization

Initialize a `dsp.SineWave` System object to generate a sine wave sampled at 44.1 kHz and has a frequency of 1000 Hz. Construct a `dsp.FFT` and `dsp.IFFT` objects to compute the FFT and the IFFT of the input signal.

The 'FFTLengthSource' property of each of these transform objects is set to 'Auto'. The FFT length is hence considered as the input frame size. The input frame size in this example is 1020, which is not a power of 2. Hence, select the 'FFTImplementation' as 'FFTW'.

```L = 1020; Sineobject = dsp.SineWave('SamplesPerFrame',L,'PhaseOffset',10,... 'SampleRate',44100,'Frequency',1000); ft = dsp.FFT('FFTImplementation','FFTW'); ift = dsp.IFFT('FFTImplementation','FFTW','ConjugateSymmetricInput',true); rng(1);```

Streaming

Stream in the noisy input signal. Compute the FFT of each frame and determine the coefficients which constitute 99.99% energy of the signal. Take IFFT of these coefficients to reconstruct the time-domain signal.

```numIter = 1000; for Iter = 1:numIter Sinewave1 = Sineobject(); Input = Sinewave1 + 0.01*randn(size(Sinewave1)); FFTCoeff = ft(Input); FFTCoeffMagSq = abs(FFTCoeff).^2; EnergyFreqDomain = (1/L)*sum(FFTCoeffMagSq); [FFTCoeffSorted, ind] = sort(((1/L)*FFTCoeffMagSq),1,'descend'); CumFFTCoeffs = cumsum(FFTCoeffSorted); EnergyPercent = (CumFFTCoeffs/EnergyFreqDomain)*100; Vec = find(EnergyPercent > 99.99); FFTCoeffsModified = zeros(L,1); FFTCoeffsModified(ind(1:Vec(1))) = FFTCoeff(ind(1:Vec(1))); ReconstrSignal = ift(FFTCoeffsModified); end```

99.99% of the signal energy can be represented by the number of FFT coefficients given by `Vec(1)`:

`Vec(1)`
```ans = 296 ```

The signal is reconstructed efficiently using these coefficients. If you compare the last frame of the reconstructed signal with the original time-domain signal, you can see that the difference is very small and the plots match closely.

`max(abs(Input-ReconstrSignal))`
```ans = 0.0431 ```
```plot(Input,'*'); hold on; plot(ReconstrSignal,'o'); hold off;```

## Algorithms

This object implements the algorithm, inputs, and outputs described on the IFFT block reference page. The object properties correspond to the block parameters, except:

 Output sampling mode parameter is not supported by `dsp.IFFT`.

## References

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