# Orthogonal Frequency Division Multiplexing

5G air interface is designed based on orthogonal frequency division multiplexing (OFDM). OFDM simplifies the transmitter and receiver design for broadband communication which is characterised by frequency selective channels. Furthermore, it facilitates easy time and frequency division multiplexing. The details about the modulation and demodulation is provided in upcoming sections.

Warning

Current implementation of OFDM assume that the cyclic prefix for OFDM is same for all the OFDM symbols. In 5G, the cyclic prefix size varies for different OFDM symbols.

## OFDM: Modulator

This module implements the cyclic prefix (CP) OFDM. The 5G transmitter side modulate the physical resource grid using

$$\bar{s}_l^{(p, \mu)}(t)=\sum_{k=0}^{N_{\mathrm{grid}, \mu}^{\mathrm{size}}, N_{\mathrm{sc}}^{\mathrm{RB}}-1} a_{k, l}^{(p, \mu)} e^{j 2 \pi\left(k+k_0^\mu-N_{\mathrm{grid},}^{\mathrm{size}, \mu} N_{\mathrm{sc}}^{\mathrm{RB}} / 2\right) \Delta f\left(t-N_{\mathrm{c}, l}^\mu T_{\mathrm{c}}-t_{\mathrm{start}, l}^\mu\right)}$$

The module provided below implements the discrete version of the above equation as detailed below.

$$\bar{s}_l^{(p, \mu)}(n)=\sum_{k=0}^{\text{N}_\text{FFT}-1} a_{k, l}^{(p, \mu)} e^\frac{j 2 \pi(k-\text{N}_\text{FFT} / 2) (n-N_{\mathrm{c}, l}^\mu )}{N_{\text{FFT}}}$$. This expression is derived by setting

Table 34 Table-1: Positioning in 5G Networks

Parameter

Definition

Value

$$k_0^\mu$$

0

Initial subcarrier offset

$$t$$

$$t = n.T_{c}$$

time instant

$$t_{\mathrm{start}, l}^\mu$$

0

Start of time window associated with symbol l and numerology $$\mu$$

$$T_{c}$$

$$T_{c} = \frac{1}{\text{N}_\text{FFT} *\Delta f}$$

Sample Duration

The details of the input and output interface for OFDM Modulator is shown below.

class toolkit5G.OFDM.OFDMModulator(cyclic_prefix_length, **kwargs)[source]

Computes the time-domain representation of an OFDM resource grid with (optional) cyclic prefix.

Parameters:

cyclic_prefix_length (int) – Integer indicating the length of the cyclic prefix that it prepended to each OFDM symbol. It cannot be longer than the FFT size.

Input:

[…,num_ofdm_symbols,fft_size], tf.complex – A resource grid in the frequency domain.

Output:

[…,num_ofdm_symbols*(fft_size+cyclic_prefix_length)], tf.complex – Time-domain OFDM signal.

## OFDM: Demodulator

This module implements the OFDM demodulator to recover the resource Grid back from the received samples.

class toolkit5G.OFDM.OFDMDemodulator(fft_size, l_min, cyclic_prefix_length, **kwargs)[source]

Computes the frequency-domain representation of an OFDM waveform with cyclic prefix removal.

The demodulator assumes that the input sequence is generated by the TimeChannel. For a single pair of antennas, the received signal sequence is given as:

$y_b = \sum_{\ell =L_\text{min}}^{L_\text{max}} \bar{h}_\ell x_{b-\ell} + w_b, \quad b \in[L_\text{min}, N_B+L_\text{max}-1]$

where $$\bar{h}_\ell$$ are the discrete-time channel taps, $$x_{b}$$ is the the transmitted signal, and $$w_\ell$$ Gaussian noise.

Starting from the first symbol, the demodulator cuts the input sequence into pieces of size cyclic_prefix_length + fft_size, and throws away any trailing symbols. For each piece, the cyclic prefix is removed and the fft_size-point discrete Fourier transform is computed.

Since the input sequence starts at time $$L_\text{min}$$, the FFT-window has a timing offset of $$L_\text{min}$$ symbols, which leads to a subcarrier-dependent phase shift of $$e^{\frac{j2\pi k L_\text{min}}{N}}$$, where $$k$$ is the subcarrier index, $$N$$ is the FFT size, and $$L_\text{min} \le 0$$ is the largest negative time lag of the discrete-time channel impulse response. This phase shift is removed in this layer, by explicitly multiplying each subcarrier by $$e^{\frac{-j2\pi k L_\text{min}}{N}}$$. This is a very important step to enable channel estimation with sparse pilot patterns that needs to interpolate the channel frequency response accross subcarriers. It also ensures that the channel frequency response seen by the time-domain channel is close to the OFDMChannel.

Parameters:
• fft_size (int) – FFT size (, i.e., the number of subcarriers).

• l_min (int) – The largest negative time lag of the discrete-time channel impulse response. It should be the same value as that used by the cir_to_time_channel function.

• cyclic_prefix_length (int) – Integer indicating the length of the cyclic prefix that is prepended to each OFDM symbol.

Input:

[…,num_ofdm_symbols*(fft_size+cyclic_prefix_length)+n], tf.complex – Tensor containing the time-domain signal along the last dimension. n is a nonnegative integer.

Output:

[…,num_ofdm_symbols,fft_size], tf.complex – Tensor containing the OFDM resource grid along the last two dimension.