# comm.OFDMModulator

Modulate using OFDM method

## Description

The `comm.OFDMModulator`

System object™ modulates a frequency domain signal by using the orthogonal frequency division
multiplexing (OFDM) method. For more information, see Orthogonal Frequency Division Multiplexing. The output is a baseband
representation of the OFDM-modulated signal.

To modulate a signal using OFDM:

Create the

`comm.OFDMModulator`

object and set its properties.Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

## Creation

### Syntax

### Description

creates an OFDM
modulator System object.`ofdmMod`

= comm.OFDMModulator

specifies Properties using one or more
name-value arguments. For example, `ofdmMod`

= comm.OFDMModulator(`Name`

=`Value`

)`comm.OFDMModulator(NumSymbols=8)`

specifies eight OFDM symbols in the time-frequency grid.

sets the OFDM modulator object properties based on the specified `ofdmMod`

= comm.OFDMModulator(`ofdmDemod`

)`comm.OFDMDemodulator`

object.

## Properties

Unless otherwise indicated, properties are *nontunable*, which means you cannot change their
values after calling the object. Objects lock when you call them, and the
`release`

function unlocks them.

If a property is *tunable*, you can change its value at
any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

`FFTLength`

— Number of FFT points

`64`

(default) | positive integer

Number of FFT points, specified as a positive, integer scalar. The length of the FFT must be greater than or equal to 8 and is equivalent to the number of subcarriers.

`NumGuardBandCarriers`

— Number of subcarriers allocated to left and right guard bands

`[6; 5]`

(default) | 2-by-1 integer vector

Number of subcarriers allocated to the left and right guard bands, specified as a
2-by-1 integer vector. The number of left and right guard-band subcarriers,
[*N*_{leftG};
*N*_{rightG}], must fall within [0,⌊*N*_{FFT} / 2 ⌋ − 1], where *N*_{FFT} is the total
number of subcarriers in the OFDM signal specified by `FFTLength`

.
For more information, see Subcarrier Allocation, Guard Bands, and Guard Intervals.

`InsertDCNull`

— Option to insert null DC subcarrier

`false`

or `0`

(default) | `true`

or `1`

Option to insert a null DC subcarrier, specified as a numeric or logical
`0`

(`false`

) or `1`

(`true`

). When inserted, the null DC subcarrier is at the center of
the frequency band and has the index value:

(

*N*_{FFT}/ 2) + 1 when*N*_{FFT}is even.(

*N*_{FFT}+ 1) / 2 when*N*_{FFT}is odd.

*N*_{FFT} is the total number of
subcarriers in the OFDM signal specified by `FFTLength`

.

`PilotInputPort`

— Option to input pilot subcarriers

`false`

or `0`

(default) | `true`

or `1`

Option to input pilot subcarriers, specified as a numeric or logical
`0`

(`false`

) or `1`

(`true`

). When you set this property to:

`false`

— The input data,`X`

, may include embedded pilot information but the object does not assign pilot subcarrier indices.`true`

— The object assigns subcarriers specified by`PilotCarrierIndices`

for pilot modulation of the signal at the`pilot`

input argument.

`PilotCarrierIndices`

— Indices of pilot subcarrier locations

`[12; 26; 40; 54]`

(default) | column vector | matrix | 3D array

Indices of the pilot subcarrier locations, specified as a column vector, matrix, or 3D array with integer-element values in the range

$$\left[{N}_{\text{leftG}}+1,\text{\hspace{0.17em}}{N}_{\text{FFT}}/2\right]\cup \left[{N}_{\text{FFT}}/2+2,\text{\hspace{0.17em}}{N}_{\text{FFT}}-{N}_{\text{rightG}}\right],$$

where *N*_{FFT} is the total
number of subcarriers specified by `FFTLength`

,
and *N*_{leftG} and
*N*_{rightG} are the left and right guard bands
specified by `NumGuardBandCarriers`

.

You can assign the *N*_{Pilot} pilot carrier
indices to the same or different *N*_{Sym}
subcarriers for each symbol, and across *N*_{T}
transmit antennas.

When the pilot indices are the same for every symbol and transmit antenna, the property has dimensions of N

_{Pilot}-by-1.When the pilot indices vary across symbols, the property has dimensions of

*N*_{Pilot}-by-*N*_{Sym}.If the

`pilot`

input has only one symbol but the object configuration assigns multiple transmit antennas, the property has dimensions of*N*_{Pilot}-by-1-by-*N*_{T}.If the indices vary across the number of symbols and transmit antennas, the property has dimensions of

*N*_{Pilot}-by-*N*_{Sym}-by-*N*_{T}.

**Tip**

To minimize interference between transmissions across more than one transmit antenna, the pilot indices per symbol must be mutually distinct across the antennas.

#### Dependencies

This property applies when you set `PilotInputPort`

to `1`

.

`CyclicPrefixLength`

— Length of cyclic prefix

`16`

(default) | positive integer | row vector

Length of the cyclic prefix for each OFDM symbol, specified as a positive, integer
scalar or row vector containing `NumSymbols`

elements. The cyclic prefix length must be in the range [0,
*N*_{FFT}], where
*N*_{FFT} is the total number of subcarriers in
the OFDM signal specified by `FFTLength`

.
When you specify the cyclic prefix length as a:

Scalar — The cyclic prefix length is the same for all symbols through all antennas.

Row vector — The cyclic prefix length may vary across symbols but does not vary across antennas.

`Windowing`

— Option to apply raised cosine windowing between OFDM symbols

`false`

or `0`

(default) | `true`

or `1`

Option to apply raised cosine windowing between the OFDM symbols, specified as a
numeric or logical `0`

(`false`

) or
`1`

(`true`

).

To reduce the power of out-of-band subcarriers caused by spectral regrowth, apply windowing. For more information, see OFDM Raised Cosine Windowing.

`WindowLength`

— Length of raised cosine window

`1`

(default) | positive integer

Length of the raised cosine window, specified as a positive, integer scalar. This
value must be less than or equal to the minimum cyclic prefix length specified by
`CyclicPrefixLength`

. For example, in a configuration of four symbols with
cyclic prefix lengths 12, 14, 16, and 18, the window length must be less than or equal
to 12.

#### Dependencies

To enable this property, set the `Windowing`

property to `true`

.

`OversamplingFactor`

— Oversampling factor

`1`

(default) | positive scalar

Oversampling factor, specified as a positive scalar. The oversampling factor must satisfy these constraints:

(

`OversamplingFactor`

×`FFTLength`

) must be an integer value.(

`OversamplingFactor`

×`CyclicPrefixLength`

) must be an integer value.If you set

`Windowing`

to`true`

, (`OversamplingFactor`

×`WindowLength`

) must be an integer value.

**Tip**

If you set the oversampling factor to a noninteger rational number, specify a fractional value
rather than a decimal value. For example, with an FFT length of `12`

and an
oversampling factor of `4/3`

, their product is the integer
`16`

. However, rounding `4/3`

to
`1.333`

when setting the oversampling factor results in a noninteger
product of `15.9960`

, which results in a code error.

`NumSymbols`

— Number of OFDM symbols

`1`

(default) | positive integer

Number of OFDM symbols in the time-frequency grid, specified as a positive, integer scalar.

`NumTransmitAntennnas`

— Number of transmit antennas

`1`

(default) | positive integer

Number of transmit antennas used to transmit the OFDM modulated signal, specified as
a positive, integer scalar less than or equal to `64`

.

## Usage

### Description

assigns the pilot signal, `Y`

= ofdmMod(`data`

,`pilot`

)`pilot`

, into the frequency subcarriers
specified by `PilotCarrierIndices`

. To enable this syntax, set the `PilotInputPort`

property to `true`

.

### Input Arguments

`X`

— Input baseband signal

3D array

Input baseband signal, specified as an *N*_{In}-by-*N*_{Sym}-by-*N*_{T} array.

*N*_{In}is the number of data subcarriers. For more information, see the`info`

object function.*N*_{Sym}is the number of symbols, as specified by`NumSymbols`

.*N*_{T}is the number of transmit antennas, as specified by`NumTransmitAntennnas`

.

For more information, see Subcarrier Allocation, Guard Bands, and Guard Intervals.

**Data Types: **`double`

| `single`

**Complex Number Support: **Yes

`pilot`

— Pilot signal

3D array

Pilot signal, specified as an
*N*_{Pilot}-by-*N*_{Sym}-by-*N*_{T}
array.

*N*_{Pilot}is the number of pilot subcarriers in each symbol, as specified by`size(`

.`PilotCarrierIndices`

,1)*N*_{Sym}is the number of OFDM symbols, as specified by`NumSymbols`

.*N*_{T}is the number of transmit antennas, as specified by`NumTransmitAntennnas`

.

For more information, see Subcarrier Allocation, Guard Bands, and Guard Intervals.

**Data Types: **`double`

| `single`

**Complex Number Support: **Yes

### Output Arguments

`Y`

— OFDM-modulated baseband signal

matrix

OFDM-modulated baseband signal, returned as an (*osf* ×
*N*_{Out})-by-*N*_{T} matrix of the same data type as the input signal.

*osf*is the oversampling factor, as determined by`OversamplingFactor`

.*N*_{Out}=*N*_{CPTotal}+ (*N*_{FFT}×*N*_{Sym})*N*_{CPTotal}is the cyclic prefix length over all the symbols.*N*_{CP}is the cyclic prefix length, as determined by`CyclicPrefixLength`

.When

`CyclicPrefixLength`

is a scalar,*N*_{CPTotal}=*N*_{CP}×*N*_{Sym}.When

`CyclicPrefixLength`

is a row vector,*N*_{CPTotal}= ∑*N*_{CP}.

*N*_{FFT}is the number of subcarriers, as determined by`FFTLength`

.*N*_{Sym}is the number of symbols, as determined by`NumSymbols`

.*N*_{T}is the number of transmit antennas, as determined by`NumTransmitAntennnas`

.

## Object Functions

To use an object function, specify the
System object as the first input argument. For
example, to release system resources of a System object named `obj`

, use
this syntax:

release(obj)

### Specific to `comm.OFDMModulator`

`info` | Provide dimensioning information for OFDM modulator |

`showResourceMapping` | Show subcarrier mapping of OFDM symbols created by OFDM modulator or demodulator System object |

## Examples

### Create and Modify OFDM Modulator

Create and display an OFDM modulator System object™ with default property values.

ofdmMod = comm.OFDMModulator

ofdmMod = comm.OFDMModulator with properties: FFTLength: 64 NumGuardBandCarriers: [2x1 double] InsertDCNull: false PilotInputPort: false CyclicPrefixLength: 16 Windowing: false OversamplingFactor: 1 NumSymbols: 1 NumTransmitAntennas: 1

Modify the number of subcarriers and symbols. Verify that the number of subcarriers and the number of symbols changed. Use the `info`

object function to display the input and output signal dimensions.

ofdmMod.FFTLength = 128; ofdmMod.NumSymbols = 2

ofdmMod = comm.OFDMModulator with properties: FFTLength: 128 NumGuardBandCarriers: [2x1 double] InsertDCNull: false PilotInputPort: false CyclicPrefixLength: 16 Windowing: false OversamplingFactor: 1 NumSymbols: 2 NumTransmitAntennas: 1

info(ofdmMod)

`ans = `*struct with fields:*
DataInputSize: [117 2]
OutputSize: [288 1]

Use the `showResourceMapping`

object function to show the mapping of data, pilot, and null subcarriers in the time-frequency space.

showResourceMapping(ofdmMod)

Update the object to add a DC null and activate the pilot input argument. Display the configuration of the updated object. Use the `showResourceMapping`

object function to show the updated resource mapping. Use the `info`

object function to display the updated input and output signal dimensions. The updated input and output dimensions show the change to the object configuration. Specifically, when the object runs, pilot subcarriers must be provided.

ofdmMod.InsertDCNull = 1; ofdmMod.PilotInputPort = 1

ofdmMod = comm.OFDMModulator with properties: FFTLength: 128 NumGuardBandCarriers: [2x1 double] InsertDCNull: true PilotInputPort: true PilotCarrierIndices: [4x1 double] CyclicPrefixLength: 16 Windowing: false OversamplingFactor: 1 NumSymbols: 2 NumTransmitAntennas: 1

info(ofdmMod)

`ans = `*struct with fields:*
DataInputSize: [112 2]
PilotInputSize: [4 2]
OutputSize: [288 1]

showResourceMapping(ofdmMod)

### Create OFDM Modulator from OFDM Demodulator

Creating the modulator by using the configured demodulator ensures a matched modulator and demodulator pair.

Create an OFDM demodulator System object™ with default property values. Then, specify pilot indices for a single symbol and two transmit antennas. When you use the demodulator in the creation of the modulator, setting the `PilotCarrierIndices`

property of the demodulator affects the number of transmit antennas in the OFDM modulator. The number of receive antennas in the demodulator is uncorrelated with the number of transmit antennas.

```
ofdmDemod = comm.OFDMDemodulator;
ofdmDemod.PilotOutputPort = true;
ofdmDemod.PilotCarrierIndices = ...
cat(3,[12; 26; 40; 54],[13; 27; 41; 55]);
```

Use the OFDM demodulator to create the OFDM modulator.

ofdmMod = comm.OFDMModulator(ofdmDemod);

Display the properties of the OFDM modulator and demodulator, verifying that the applicable properties match.

disp(ofdmMod)

comm.OFDMModulator with properties: FFTLength: 64 NumGuardBandCarriers: [2x1 double] InsertDCNull: false PilotInputPort: true PilotCarrierIndices: [4x1x2 double] CyclicPrefixLength: 16 Windowing: false OversamplingFactor: 1 NumSymbols: 1 NumTransmitAntennas: 2

disp(ofdmDemod)

comm.OFDMDemodulator with properties: FFTLength: 64 NumGuardBandCarriers: [2x1 double] RemoveDCCarrier: false PilotOutputPort: true PilotCarrierIndices: [4x1x2 double] CyclicPrefixLength: 16 OversamplingFactor: 1 NumSymbols: 1 NumReceiveAntennas: 1

### Visualize Time-Frequency Resource Assignments for OFDM Modulator

The `showResourceMapping`

object function displays the time-frequency resource mapping for each transmit antenna.

Create an OFDM modulator.

ofdmMod = comm.OFDMModulator;

Apply the `showResourceMapping`

object function.

showResourceMapping(ofdmMod)

Insert a DC null.

ofdmMod.InsertDCNull = true;

Show the resource mapping after adding the DC null.

showResourceMapping(ofdmMod)

### Create OFDM Modulator and Specify Pilots

Create an OFDM modulator and specify the subcarrier indices for the pilot signals. Specify the indices for each symbol and transmit antenna. When the number of transmit antennas is greater than one, set different pilot indices for each symbol between antennas.

Create an OFDM modulator object, specifying two symbols and inserting a DC null.

ofdmMod = comm.OFDMModulator( ... FFTLength=128, ... NumSymbols=2, ... InsertDCNull=true);

Enable the pilot input port so you can specify the pilot indices.

ofdmMod.PilotInputPort = true;

Specify the same pilot indices for both symbols.

ofdmMod.PilotCarrierIndices = [12; 56; 89; 100];

Display the placement of the pilot signals and nulls in the OFDM time-frequency grid by using the `showResourceMapping`

object function.

showResourceMapping(ofdmMod)

Specify different indices for the second symbol by concatenating a second column of pilot indices to the `PilotCarrierIndices`

property.

```
ofdmMod.PilotCarrierIndices = ...
cat(2,ofdmMod.PilotCarrierIndices,[17; 61; 94; 105]);
```

Verify that the pilot subcarrier indices differ between the two symbols.

showResourceMapping(ofdmMod)

Increase the number of transmit antennas to two.

ofdmMod.NumTransmitAntennas = 2;

Specify the pilot indices for each of the two transmit antennas. To provide indices for multiple antennas while minimizing interference among the antennas, specify the `PilotCarrierIndices`

property as a 3D array so that the indices for each symbol differ among antennas.

```
ofdmMod.PilotCarrierIndices = ...
cat(3,[20; 50; 70; 110],[15; 60; 75; 105]);
```

Display the resource mapping for the two transmit antennas. The gray lines denote the insertion of custom nulls. To minimize interference among the pilot symbols from different antennas, the object creates nulls.

showResourceMapping(ofdmMod)

### Create OFDM Modulator with Varying Cyclic Prefix Lengths

Specify the length of the cyclic prefix for each OFDM symbol.

Create an OFDM modulator, specifying five symbols, four left and three right guard-band subcarriers, and the cyclic prefix length for each OFDM symbol.

ofdmMod = comm.OFDMModulator( ... NumGuardBandCarriers=[4;3], ... NumSymbols=5, ... CyclicPrefixLength=[12 10 14 11 13]);

Display the properties of the OFDM modulator to confirm that the configured cyclic prefix length changes across the symbols.

disp(ofdmMod)

comm.OFDMModulator with properties: FFTLength: 64 NumGuardBandCarriers: [2x1 double] InsertDCNull: false PilotInputPort: false CyclicPrefixLength: [12 10 14 11 13] Windowing: false OversamplingFactor: 1 NumSymbols: 5 NumTransmitAntennas: 1

### Determine OFDM Modulator Data Dimensions

Get the OFDM modulator data dimensions by using the `info`

object function.

Create an OFDM modulator object with pilot indices, a DC null, and two transmit antennas.

ofdmMod = comm.OFDMModulator( ... NumGuardBandCarriers=[4; 3], ... PilotInputPort=true, ... PilotCarrierIndices=cat(3,[12; 26; 40; 54],[11; 25; 39; 53]), ... InsertDCNull=true, ... NumTransmitAntennas=2);

Use the `info`

object function to get the modulator input data, pilot input data, and output data sizes.

info(ofdmMod)

`ans = `*struct with fields:*
DataInputSize: [48 1 2]
PilotInputSize: [4 1 2]
OutputSize: [80 2]

### Create OFDM Modulated Data

Generate OFDM modulated symbols for use in link-level simulations.

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

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

Determine input data, pilot, and output data dimensions.

modDim = info(ofdmMod);

Generate random data symbols for the OFDM modulator. The structure variable, `modDim`

, determines the number of data symbols.

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

modData = ofdmMod(dataIn,pilotIn);

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

ofdmDemod = comm.OFDMDemodulator(ofdmMod);

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

[dataOut, pilotOut] = ofdmDemod(modData);

Verify that, within a tight tolerance, the input data and pilot symbols match the output data and pilot symbols.

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

`isSame = `*logical*
1

### Oversample and Filter OFDM Signal Through SISO Channel

Filter an OFDM modulated signal with data and pilot inputs and outputs generated at four times the sample rate through a single-input single-output (SISO) channel. Demodulate the channel-filtered signal and compare to the original data.

Create an OFDM demodulator object that has three symbols and different pilot subcarrier indices and cyclic prefix lengths for each symbol.

ofdmDemod = comm.OFDMDemodulator( ... NumGuardBandCarriers=[9;8], ... RemoveDCCarrier=true, ... PilotOutputPort=true, ... PilotCarrierIndices=[[12;26;40;54],[14;28;38;52],[12;26;40;54]], ... CyclicPrefixLength=[16 32 16], ... OversamplingFactor=4, ... NumSymbols=3);

Create an OFDM modulator System object from the OFDM demodulator object, `ofdmDemod`

.

ofdmMod = comm.OFDMModulator(ofdmDemod);

Show the configured subcarrier resource mapping for data, pilot, guard band and null signals by using the `showResourceMapping`

object function. Obtain the input and output dimension information by using the `info`

object function.

showResourceMapping(ofdmDemod);

modDim = info(ofdmMod);

Create random data and pilot inputs and apply QAM modulation.

M = 16; xd = randi([0 M-1],modDim.DataInputSize); dataIn = qammod(xd,M,UnitAveragePower=true); xp = randi([0 M-1],modDim.PilotInputSize); pilotIn = qammod(xp,M,UnitAveragePower=true);

Apply OFDM modulation to the data and pilot QAM signals. Filter the signal through an AWGN channel. To recover the data and pilot symbols, apply OFDM demodulation and then QAM-demodulation.

```
modOut = ofdmMod(dataIn,pilotIn);
chanOut = awgn(modOut,20,"measured");
[dataOut, pilotOut] = ofdmDemod(chanOut);
yd = qamdemod(dataOut,M,UnitAveragePower=true);
yp = qamdemod(pilotOut,M,UnitAveragePower=true);
```

Verify that the data and pilots are unchanged through this process.

dataSame = isequal(xd,yd)

`dataSame = `*logical*
1

pilotSame = isequal(xp,yp)

`pilotSame = `*logical*
1

## Algorithms

### Orthogonal Frequency Division Multiplexing

OFDM belongs to the class of multicarrier modulation schemes. Because the operation can transmit multiple carriers simultaneously, noise does not influence OFDM to the same degree as single-carrier modulation.

OFDM operation divides a high-rate data stream into low-rate data substreams by decomposing the transmission frequency band into a number of contiguous individually modulated subcarriers. This set of parallel and orthogonal subcarriers carry the data stream occupying almost the same bandwidth as a wideband channel. By using narrow orthogonal subcarriers, the OFDM signal gains robustness over a frequency-selective fading channel and eliminates adjacent subcarrier interference. Intersymbol interference (ISI) is reduced because the lower data rate substreams have symbol durations larger than the channel delay spread.

This image shows a frequency domain representation of orthogonal subcarriers in an OFDM waveform.

The transmitter applies inverse fast Fourier transform (IFFT) to *N* symbols
at a time. Typically, the output of the IFFT is the sum of the *N*
orthogonal sinusoids:

$$x(t)={\displaystyle \sum _{k=0}^{N-1}{X}_{k}{e}^{j2\pi k\Delta ft}},\text{\hspace{1em}}0\le t\le T,$$

where {*X*_{k}} are data symbols, and
*T* is the OFDM symbol time. The data symbols
*X*_{k} are typically complex and can be from any
digital modulation alphabet (for example, QPSK, 16-QAM, 64-QAM, etc.).

**Note**

The MATLAB^{®} implementation of the discrete Fourier transform normalizes the output of
the IFFT by 1/*N*. For more information, see Discrete Fourier Transform of Vector
on the `ifft`

reference page.

The subcarrier spacing is Δ*f* = 1/*T*, ensuring that
the subcarriers are orthogonal over each symbol period:

$$\frac{1}{T}{\displaystyle {\int}_{0}^{T}{\left({e}^{j2\pi m\Delta ft}\right)}^{*}\left({e}^{j2\pi n\Delta ft}\right)}\text{\hspace{0.17em}}dt=\frac{1}{T}{\displaystyle {\int}_{0}^{T}{e}^{j2\pi (m-n)\Delta ft}}\text{\hspace{0.17em}}dt=0\text{\hspace{1em}}\text{for}\text{\hspace{0.17em}}m\ne n.$$

An OFDM modulator consists of a serial-to-parallel conversion followed by a bank of
*N* complex modulators, individually corresponding to each OFDM subcarrier.

### Subcarrier Allocation, Guard Bands, and Guard Intervals

Individual OFDM subcarriers are allocated as data, pilot, or null subcarriers.

As shown here, subcarriers are designated as data, DC, pilot, or guard-band subcarriers.

Data subcarriers transmit user data.

Pilot subcarriers are for channel estimation.

Null subcarriers transmit no data. Subcarriers with no data provide a DC null and serve as buffers between OFDM resource blocks.

The null DC subcarrier is the center of the frequency band with an index value of (

`nfft`

/2 + 1) if`nfft`

is even, or ((`nfft`

+ 1) / 2) if`nfft`

is odd.The guard bands provide buffers between adjacent signals in neighboring bands to reduce interference caused by spectral leakage.

Null subcarriers enable you to model guard bands and DC subcarrier locations for specific standards, such as the various 802.11 formats, LTE, WiMAX, or for custom allocations. You can allocate the location of nulls by assigning a vector of null subcarrier indices.

Similar to guard bands, guard intervals protect the integrity of transmitted signals in OFDM by reducing intersymbol interference.

Assignment of guard intervals is analogous to the assignment of guard bands. You can model guard intervals to provide temporal separation between OFDM symbols. The guard intervals help preserve intersymbol orthogonality after the signal passes through time-dispersive channels. You create guard intervals by using cyclic prefixes. Cyclic prefix insertion copies the last part of an OFDM symbol as the first part of the OFDM symbol.

OFDM benefits from the use of cyclic prefix insertion as long as the span of the time dispersion does not exceed the duration of the cyclic prefix.

Inserting a cyclic prefix results in a fractional reduction of user data throughput because the cyclic prefix occupies bandwidth that could be used for data transmission.

### OFDM Raised Cosine Windowing

OFDM raised cosine windowing applies techniques described in [3] to limit spectral regrowth by creating a smooth transition between the last sample of one symbol and the first sample of the next symbol.

While the cyclic prefix creates a guard period in time domain to preserve orthogonality, an OFDM symbol rarely begins with the same amplitude and phase that it exhibits at the end of the prior OFDM symbol, which causes spectral regrowth and, therefore, spreads the signal bandwidth due to intermodulation distortion. To limit this spectral regrowth, you can create a smooth transition between the last sample of a symbol and the first sample of the next symbol by using a cyclic suffix and raised cosine windowing.

The discussion and figures in this section assume an oversampling factor of 1. To
create the cyclic suffix, the operation appends the first
*N*_{WIN} samples of a given symbol to
the end of that symbol. However, to comply with the IEEE^{®} 802.11g standard, for example, the operation cannot arbitrarily
lengthen the symbol. Instead, the cyclic suffix must overlap in time and is
effectively summed with the cyclic prefix of the following symbol. The operation
applies two, mathematically inverse, windows in this overlapped segment. The first
raised cosine window applies to the cyclic suffix of symbol *k* and
decreases from 1 to 0 over its duration. The second raised cosine window applies to
the cyclic prefix of symbol *k*+1 and increases from 0 to 1 over
its duration. This process provides a smooth transition from one symbol to the
next.

The raised cosine window, *w*(*t*), in the time domain can be expressed as:

$$w(t)=\{\begin{array}{l}1,\text{\hspace{0.17em}}\text{}0\le \left|t\right|<T-\frac{{T}_{W}}{2}\\ \frac{1}{2}\left\{1+\mathrm{cos}\left[\frac{\pi}{{T}_{W}}\left(\left|t\right|-\left(T-\frac{{T}_{W}}{2}\right)\right)\right]\right\},\text{}T-\frac{{T}_{W}}{2}\le \left|t\right|\le T+\frac{{T}_{W}}{2}\\ 0,\text{}\text{otherwise}\end{array}$$

where:

*T*is the OFDM symbol duration including the guard interval.*T*_{W}is the duration of the window.

Adjust the length of the cyclic suffix by setting the window length, with suffix lengths set between 1 and the minimum cyclic prefix length. While windowing improves spectral regrowth, it does so at the expense of multipath fading immunity because of reduced redundancy in the guard band due to guard band sample values changes to implement intersymbol transition smoothing.

## References

[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] Agilent Technologies, Inc., "OFDM Raised Cosine Windowing", https://helpfiles.keysight.com/csg/n7617/Content/Main/ofdm_raised_cosine_windowing.htm.

[4] Montreuil, L., R. Prodan, and T. Kolze. "OFDM TX Symbol Shaping 802.3bn", https://www.ieee802.org/3/bn/public/jan13/montreuil_01a_0113.pdf. Broadcom, 2013.

[5] IEEE Standard 802.16-2017. "Part 16: Air Interface for Broadband Wireless Access Systems." March 2018.

## Extended Capabilities

### C/C++ Code Generation

Generate C and C++ code using MATLAB® Coder™.

Usage notes and limitations:

See System Objects in MATLAB Code Generation (MATLAB Coder).

## Version History

**Introduced in R2014a**

### R2023b: Single data type support

If the input signal is of type single, then the object natively computes in single precision, and the returned output is also of type single.

### R2023a: Adds support for oversampling

`comm.OFDMModulator`

now supports oversampling.

## See Also

### Functions

### Objects

### Blocks

## MATLAB Command

You clicked a link that corresponds to this MATLAB command:

Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)