Main Content


Demodulate using OFDM method


The OFDMDemodulator object demodulates using the orthogonal frequency division demodulation method. The output is a baseband representation of the modulated signal, which was input into the OFDMModulator companion object.

To demodulate an OFDM signal:

  1. Define and set up the OFDM demodulator object. See Construction.

  2. Call step to demodulate a signal according to the properties of comm.OFDMDemodulator. The behavior of step is specific to each object in the toolbox.


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.


H = comm.OFDMDemodulator creates a demodulator System object, H, that demodulates an input signal by using the orthogonal frequency division demodulation method.

H = comm.OFDMDemodulator(Name,Value) creates an OFDM demodulator object, H, with each specified property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).

H = comm.OFDMDemodulator(hMod) creates an OFDM demodulator object, H, whose properties are determined by the corresponding OFDM modulator object, hMod.



The length of the FFT, NFFT, is equivalent to the number of subcarriers used in the modulation process. FFTLength must be ≥ 8.

Specify the number of subcarriers. The default is 64.


The number of guard band subcarriers allocated to the left and right guard bands.

Specify the number of left and right subcarriers as nonnegative integers in [0,NFFT/21] where you specify the left, NleftG, and right, NrightG, guard bands independently in a 2-by-1 column vector. The default values are [6; 5].


A logical variable that when true, mandates removal of a DC subcarrier. The default value is false.


A logical property that controls whether to separate the pilot signals and make them available at an additional output port. The location of each pilot output symbol is determined by the pilot subcarrier indices specified in the PilotCarrierIndices property. When false, pilot symbols may be present but embedded in the data. The default value is false.


If the PilotOutputPort property is true, output separate pilot signals located at the indices specified by the PilotCarrierIndices property. If the indices are a 2-D array, the pilot carriers across all the transmit antennas per symbol are the same. If there is more than one transmit antenna (this information is not known by the demodulator), the pilots from different transmit antennas may interfere with each other. To avoid this, specify the pilot carrier indices as a 3-D array with different pilot indices for each symbol across the antennas. This avoids interference between pilots from different transmit antennas, since, on a per-symbol basis, each transmit antenna has different pilot carriers and the OFDM modulator creates custom nulls at the appropriate locations. The size of the third dimension of the PilotCarrierIndices property gives the number of transmit antennas.


The cyclic prefix length property specifies the length of the OFDM cyclic prefix. If you specify a scalar, the prefix length is the same for all symbols through all antennas. If you specify a row vector of length Nsym, the prefix length can vary across symbols but remains the same length through all antennas. The default value is 16.


This property specifies the number of symbols, Nsym. Specify Nsym as a positive integer. The default value is 1.


This property determines the number of antennas, NR, used to receive the OFDM modulated signal. Specify NR as a positive integer. The default value is 1.


infoProvide dimensioning information for the OFDM method
resetReset states of the OFDMDemodulator System object
showResourceMappingShow the subcarrier mapping of the OFDM symbols created by the OFDM demodulator System object
stepDemodulate using OFDM method
Common to All System Objects

Allow System object property value changes


collapse all

Construct an OFDM demodulator System object™ with default properties. Modify some of the properties.

Construct the OFDM demodulator.

demod = comm.OFDMDemodulator
demod = 
  comm.OFDMDemodulator with properties:

               FFTLength: 64
    NumGuardBandCarriers: [2x1 double]
         RemoveDCCarrier: false
         PilotOutputPort: false
      CyclicPrefixLength: 16
              NumSymbols: 1
      NumReceiveAntennas: 1

Modify the number of subcarriers and symbols.

demod.FFTLength = 128;
demod.NumSymbols = 2;

Verify that the number of subcarriers and the number of symbols changed.

demod = 
  comm.OFDMDemodulator with properties:

               FFTLength: 128
    NumGuardBandCarriers: [2x1 double]
         RemoveDCCarrier: false
         PilotOutputPort: false
      CyclicPrefixLength: 16
              NumSymbols: 2
      NumReceiveAntennas: 1

Create an OFDM demodulator System object™ from an existing OFDM modulator System object.

Construct an OFDM modulator using default parameters.

mod = comm.OFDMModulator('NumTransmitAntennas',4);

Construct the corresponding OFDM demodulator from the modulator, mod.

demod = comm.OFDMDemodulator(mod);

Display the properties of the modulator and verify that they match those of the demodulator.

mod = 
  comm.OFDMModulator with properties:

               FFTLength: 64
    NumGuardBandCarriers: [2x1 double]
            InsertDCNull: false
          PilotInputPort: false
      CyclicPrefixLength: 16
               Windowing: false
              NumSymbols: 1
     NumTransmitAntennas: 4

demod = 
  comm.OFDMDemodulator with properties:

               FFTLength: 64
    NumGuardBandCarriers: [2x1 double]
         RemoveDCCarrier: false
         PilotOutputPort: false
      CyclicPrefixLength: 16
              NumSymbols: 1
      NumReceiveAntennas: 1

Note that the number of transmit antennas is independent of the number of receive antennas.

The showResourceMapping method shows the time-frequency resource mapping for each transmit antenna.

Construct an OFDM demodulator.

demod = comm.OFDMDemodulator;

Apply the showResourceMapping method.


Remove the DC subcarrier.

demod.RemoveDCCarrier = true;

Show the resource mapping after removing the DC subcarrier.


Construct an OFDM modulator with an inserted DC null, seven guard-band subcarriers, and two symbols that have different pilot indices for each symbol.

mod = comm.OFDMModulator('NumGuardBandCarriers',[4;3],...
'PilotInputPort',true,'PilotCarrierIndices',cat(2,[12; 26; 40; 54],...
[11; 27; 39; 55]),'NumSymbols',2,'InsertDCNull',true);

Determine input data, pilot, and output data dimensions.

modDim = info(mod)
modDim = struct with fields:
     DataInputSize: [52 2]
    PilotInputSize: [4 2]
        OutputSize: [160 1]

Generate random data symbols for the OFDM modulator. Determine the number of data symbols by using the structure variable, modDim.

dataIn = complex(randn(modDim.DataInputSize),randn(modDim.DataInputSize));

Create a pilot signal that has the correct dimensions.

pilotIn = complex(rand(modDim.PilotInputSize),rand(modDim.PilotInputSize));

Apply OFDM modulation to the data and pilot signals.

modSig = step(mod,dataIn,pilotIn);

Use the OFDM modulator object to create the corresponding OFDM demodulator.

demod = comm.OFDMDemodulator(mod);

Demodulate the OFDM signal and output the data and pilot signals.

[dataOut,pilotOut] = step(demod,modSig);

Verify that the input data and pilot symbols match the output data and pilot symbols.

isSame = (max(abs([dataIn(:) - dataOut(:); ...
    pilotIn(:) - pilotOut(:)])) < 1e-10)
isSame = logical


The Orthogonal Frequency Division Modulation (OFDM) Demodulator System object demodulates an OFDM input signal by using an FFT operation that results in N parallel data streams.

The figure shows an OFDM demodulator. It consists of a bank of N correlators with one assigned to each OFDM subcarrier followed by a parallel-to-serial conversion.

Guard Bands and Intervals

There are three types of OFDM subcarriers: data, pilot, and null. Data subcarriers are used for transmitting data while pilot subcarriers are used for channel estimation. There is no transmission on null subcarriers, which are used to provide a DC null as well as to provide buffers between OFDM resource blocks. These buffers are referred to as guard bands whose purpose is to prevent inter-symbol interference. The allocation of nulls and guard bands varies depending upon the standard, e.g., 802.11n differs from LTE. Consequently, the OFDM modulator object allows the user to assign subcarrier indices as required.

Analogous to the concept of guard bands, the OFDM modulator object supports guard intervals that provide temporal separation between OFDM symbols so that the signal does not lose orthogonality due to time-dispersive channels. As long as the guard interval is longer than the delay spread, each symbol does not interfere with other symbols. Guard intervals are created by using cyclic prefixes in which the last part of an OFDM symbol is copied and inserted as the first part of the OFDM symbol. The benefit of cyclic prefix insertion is maintained as long as the span of the time dispersion does not exceed the duration of the cyclic prefix. The OFDM modulator object enables the cyclic prefix length to be set. The drawback in using a cyclic prefix is increased overhead.

Selected Bibliography

[1] Dahlman, E., S. Parkvall, and J. Skold. 4G LTE/LTE-Advanced for Mobile Broadband.London: Elsevier Ltd., 2011.

[2] Andrews, J. G., A. Ghosh, and R. Muhamed, Fundamentals of WiMAX, Upper Saddle River, NJ: Prentice Hall, 2007.

[3] I. E. E. E., “IEEE Standard 802.16TM-2009.”

Extended Capabilities

Introduced in R2014a