Inverse discrete Fourier transform (IDFFT)
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:
To compute the IFFT of the input:
Starting in R2016b, instead of using the
to perform the operation defined by the System
object™, you can
call the object with arguments, as if it were a function. For example,
= step(obj,x) and
y = obj(x) perform
ift = dsp.IFFT returns
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
IFFT object computes a row of single-sample
IDFTs and issues a warning.
ift = dsp.IFFT(' returns an
with each property set to the specified value.
Specify the implementation used for the FFT as one of
Enable bit-reversed order interpretation of input elements
Set this property to
Enable conjugate symmetric interpretation of input
Set this property to
Enable dividing output by FFT length
Specify whether to divide the IFFT output by the FFT length.
The default is
Source of FFT length
Specify how to determine the FFT length as
Specify the FFT length as a numeric scalar. This property applies when you set the
This property must be a power of two when the input is a fixed-point data type, or when you
When you set the
Boolean value of wrapping or truncating input
Wrap input data when
|step||Inverse discrete Fourier transform of input|
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.
: If you are using R2016a or an earlier release, replace each call to the object with the equivalent
step syntax. For example,
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.
dsp.SineWave System object to generate a sine wave sampled at 44.1 kHz and has a frequency of 1000 Hz. Construct a
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);
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
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.
ans = 0.0431
plot(Input,'*'); hold on; plot(ReconstrSignal,'o'); hold off;
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 |
 FFTW (
 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.
Usage notes and limitations:
See System Objects in MATLAB Code Generation (MATLAB Coder).
When the following conditions apply, the executable
generated from this System
object relies on prebuilt dynamic library
.dll files) included with MATLAB®:
FFTImplementation is set to
FFTImplementation is set to
not a power of two.
packNGo function to package
the code generated from this System
object 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 System object.