DFT/IDFT Implementation

Definition:

OFDM Transceiver via IDFT/DFT

The OFDM transmitter and receiver are implemented using the inverse DFT and DFT, respectively.

Transmitter (IDFT): Given NN frequency-domain data symbols {X[0],X[1],…,X[Nβˆ’1]}\{X[0], X[1], \ldots, X[N-1]\}, the time-domain samples are:

x[n]=1Nβˆ‘k=0Nβˆ’1X[k] ej2Ο€kn/N,n=0,1,…,Nβˆ’1x[n] = \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} X[k]\, e^{j2\pi kn/N}, \qquad n = 0, 1, \ldots, N-1

Receiver (DFT): After removing the cyclic prefix, the receiver computes:

Y[k]=1Nβˆ‘n=0Nβˆ’1y[n] eβˆ’j2Ο€kn/N,k=0,1,…,Nβˆ’1Y[k] = \frac{1}{\sqrt{N}} \sum_{n=0}^{N-1} y[n]\, e^{-j2\pi kn/N}, \qquad k = 0, 1, \ldots, N-1

In matrix notation with the normalised DFT matrix F\mathbf{F} where [F]k,n=1Neβˆ’j2Ο€kn/N[\mathbf{F}]_{k,n} = \frac{1}{\sqrt{N}} e^{-j2\pi kn/N}:

x=FHX,Y=F y\mathbf{x} = \mathbf{F}^H \mathbf{X}, \qquad \mathbf{Y} = \mathbf{F}\, \mathbf{y}

,

Definition:

Cyclic Prefix (CP)

The cyclic prefix is a copy of the last NcpN_{\text{cp}} samples of the OFDM symbol, prepended to the beginning of the transmitted block. If the time-domain OFDM symbol is x[0],x[1],…,x[Nβˆ’1]x[0], x[1], \ldots, x[N-1], then the transmitted sequence with CP is:

x[Nβˆ’Ncp],…,x[Nβˆ’1]⏟cyclicΒ prefix,β€…β€Šx[0],x[1],…,x[Nβˆ’1]\underbrace{x[N-N_{\text{cp}}], \ldots, x[N-1]}_{\text{cyclic prefix}},\; x[0], x[1], \ldots, x[N-1]

The total transmitted block length is N+NcpN + N_{\text{cp}} samples. The CP must satisfy Ncpβ‰₯Lβˆ’1N_{\text{cp}} \geq L - 1 where LL is the number of channel taps, ensuring that the linear convolution with the channel becomes a circular convolution over the NN-sample DFT window.

The receiver discards the first NcpN_{\text{cp}} received samples (the CP portion) and applies the DFT to the remaining NN samples.

Definition:

Circular Convolution

The circular convolution of two NN-point sequences x[n]x[n] and h[n]h[n] is defined as:

y[n]=(xβŠ›h)[n]=βˆ‘l=0Nβˆ’1h[l] x[(nβˆ’l)β€Šmodβ€ŠN]y[n] = (x \circledast h)[n] = \sum_{l=0}^{N-1} h[l]\, x[(n-l) \bmod N]

The fundamental property of the DFT is that circular convolution in the time domain corresponds to pointwise multiplication in the frequency domain:

DFT{xβŠ›h}=DFT{x}β‹…DFT{h}\text{DFT}\{x \circledast h\} = \text{DFT}\{x\} \cdot \text{DFT}\{h\}

Y[k]=H[k]β‹…X[k]Y[k] = H[k] \cdot X[k]

This is why OFDM, combined with the cyclic prefix, diagonalises the channel: the matrix channel equation becomes NN scalar equations.

Definition:

Cyclic Prefix Overhead

The CP overhead quantifies the fraction of transmitted energy and time spent on the cyclic prefix rather than on useful data:

Ξ·CP=NcpN+Ncp=TcpTtotal\eta_{\text{CP}} = \frac{N_{\text{cp}}}{N + N_{\text{cp}}} = \frac{T_{\text{cp}}}{T_{\text{total}}}

The spectral efficiency loss due to the CP is:

ROFDM=(1βˆ’Ξ·CP)βˆ‘k=0Nβˆ’1log⁑2 ⁣(1+∣H[k]∣2PkΟƒ2)β‹…Ξ”fR_{\text{OFDM}} = \left(1 - \eta_{\text{CP}}\right) \sum_{k=0}^{N-1} \log_2\!\left(1 + \frac{|H[k]|^2 P_k}{\sigma^2}\right) \cdot \Delta f

Increasing NN (for fixed CP duration) reduces the overhead but increases sensitivity to Doppler spread and PAPR.

Theorem: Cyclic Prefix Eliminates ISI and ICI

Consider an OFDM system with NN subcarriers transmitting over a channel with LL taps: h[0],h[1],…,h[Lβˆ’1]h[0], h[1], \ldots, h[L-1]. If the cyclic prefix length satisfies Ncpβ‰₯Lβˆ’1N_{\text{cp}} \geq L - 1, then:

  1. No ISI: The received samples within the DFT window of symbol mm depend only on the data of symbol mm, not on any adjacent symbol.

  2. No ICI: The DFT output on subcarrier kk depends only on X[k]X[k], not on any other subcarrier X[m]X[m] with m≠km \neq k.

Specifically, the input-output relation in the frequency domain is the diagonal system:

Y[k]=H[k] X[k]+W[k],k=0,…,Nβˆ’1Y[k] = H[k]\, X[k] + W[k], \qquad k = 0, \ldots, N-1

where H[k]=βˆ‘l=0Lβˆ’1h[l] eβˆ’j2Ο€kl/NH[k] = \sum_{l=0}^{L-1} h[l]\, e^{-j2\pi kl/N} is the channel frequency response at subcarrier kk.

The CP converts the linear convolution y=hβˆ—xy = h * x into a circular convolution y=hβŠ›xy = h \circledast x by making x[n]x[n] appear periodic within the receiver's DFT window. The DFT diagonalises circular convolution, yielding independent sub-channels.

,

Cyclic Prefix: Linear to Circular Convolution

Watch how the cyclic prefix converts linear channel convolution into circular convolution. The CP absorbs the channel transient, preventing ISI between adjacent OFDM symbols and enabling the DFT-based diagonalisation.
An N=8N = 8 OFDM symbol with CP length 2 passes through a 3-tap channel. The DFT window (green) contains only circular convolution β€” no inter-symbol interference.

Cyclic Prefix and Channel Convolution

Visualise how the cyclic prefix converts linear convolution into circular convolution. Observe the guard interval absorbing the channel transient, preventing ISI between adjacent OFDM symbols. Adjust the channel length and CP length to see when ISI occurs.

Parameters
16
4
4

Example: Matrix Representation of OFDM

For a 4-subcarrier OFDM system (N=4N = 4) with a 2-tap channel h=[h0,h1]Th = [h_0, h_1]^T and CP length Ncp=1N_{\text{cp}} = 1:

(a) Write the transmitted sequence (with CP) for data X=[X0,X1,X2,X3]T\mathbf{X} = [X_0, X_1, X_2, X_3]^T.

(b) Write the channel convolution in matrix form.

(c) Show that the DFT of the received signal yields Y[k]=H[k]X[k]Y[k] = H[k] X[k].

Common Mistake: Insufficient Cyclic Prefix

Mistake:

Setting the CP length shorter than the channel delay spread (Ncp<Lβˆ’1N_{\text{cp}} < L - 1) to reduce overhead.

Correction:

When Ncp<Lβˆ’1N_{\text{cp}} < L - 1, the linear convolution is not fully converted to circular convolution, causing both ISI (leakage from the previous symbol) and ICI (loss of subcarrier orthogonality). The resulting interference floor cannot be removed by increasing transmit power. The CP must satisfy Ncpβ‰₯Lβˆ’1N_{\text{cp}} \geq L - 1, or equivalently Tcpβ‰₯Ο„max⁑T_{\text{cp}} \geq \tau_{\max} (maximum channel delay spread).

Quick Check

In an OFDM system with N=64N = 64 subcarriers and a channel with delay spread of 5 samples, what is the minimum CP length to avoid ISI?

Ncp=4N_{\text{cp}} = 4

Ncp=5N_{\text{cp}} = 5

Ncp=64N_{\text{cp}} = 64

Ncp=0N_{\text{cp}} = 0 (no CP needed)

Key Takeaway

The cyclic prefix is what makes OFDM work. Without it, the frequency-selective channel creates ISI and ICI. With a CP of length Ncpβ‰₯Lβˆ’1N_{\text{cp}} \geq L-1, linear convolution becomes circular convolution, the DFT diagonalises the channel matrix, and each subcarrier sees a single complex scalar H[k]H[k]. The price: a spectral efficiency loss of Ncp/(N+Ncp)N_{\text{cp}}/(N + N_{\text{cp}}).

⚠️Engineering Note

5G NR Numerology and CP Overhead

5G NR supports multiple subcarrier spacings (numerologies): Ξ”f∈{15,30,60,120,240}\Delta f \in \{15, 30, 60, 120, 240\} kHz, denoted by ΞΌ={0,1,2,3,4}\mu = \{0, 1, 2, 3, 4\} where Ξ”f=15Γ—2ΞΌ\Delta f = 15 \times 2^\mu kHz.

ΞΌ\mu Ξ”f\Delta f TsymT_{\text{sym}} Normal CP (ΞΌ\mus) CP overhead
0 15 kHz 66.7 ΞΌ\mus 4.69 6.6%
1 30 kHz 33.3 ΞΌ\mus 2.34 6.6%
2 60 kHz 16.7 ΞΌ\mus 1.17 6.6%
3 120 kHz 8.33 ΞΌ\mus 0.57 6.4%
4 240 kHz 4.17 ΞΌ\mus 0.29 6.5%

Wider subcarrier spacing reduces the symbol duration and CP length proportionally, keeping the relative CP overhead constant at approximately 7%. However, the absolute CP duration decreases, limiting the tolerable delay spread. At mmWave (120/240 kHz SCS), the CP covers only 0.3--0.6 ΞΌ\mus of delay spread, which is sufficient for urban micro/indoor scenarios but not for large outdoor cells.

Practical Constraints
  • β€’

    Normal CP covers ~4.7 ΞΌs at 15 kHz SCS (urban macro), ~0.6 ΞΌs at 120 kHz (mmWave indoor)

  • β€’

    Extended CP (only ΞΌ=2) increases CP to ~4.17 ΞΌs but reduces to 12 symbols/slot

  • β€’

    FFT size scales with SCS: N=4096 at 15 kHz, N=512 at 120 kHz for same bandwidth

πŸ“‹ Ref: 3GPP TS 38.211, Β§5.3

OFDM Transceiver Block Diagram

OFDM Transceiver Block Diagram
The OFDM transmitter maps data symbols X[k]X[k] to time-domain samples via IDFT, adds the cyclic prefix, and converts to analog for RF transmission. The receiver reverses the process: remove CP, apply DFT, and equalise each subcarrier with X^[k]=Y[k]/H[k]\hat{X}[k] = Y[k]/H[k].

Cyclic Prefix

A copy of the last NcpN_{\text{cp}} samples of an OFDM symbol prepended to the symbol before transmission. Converts linear channel convolution into circular convolution, enabling ISI-free DFT-based demodulation.

Related: Orthogonal Frequency Division Multiplexing (OFDM), Circular Convolution, Cyclic Prefix Eliminates ISI and ICI

Circular Convolution

Convolution of two periodic (or periodically extended) sequences, defined as (xβŠ›h)[n]=βˆ‘lh[l]x[(nβˆ’l)β€Šmodβ€ŠN](x \circledast h)[n] = \sum_l h[l] x[(n-l) \bmod N]. Corresponds to pointwise multiplication in the DFT domain.

Related: OFDM Transceiver via IDFT/DFT, Cyclic Prefix (CP), Orthogonal Frequency Division Multiplexing (OFDM)

CP Overhead

The fraction of time (and energy) consumed by the cyclic prefix: Ξ·CP=Ncp/(N+Ncp)\eta_{\text{CP}} = N_{\text{cp}} / (N + N_{\text{cp}}). Represents a direct loss in spectral efficiency.

Related: Cyclic Prefix (CP), Spectral Efficiency of Hybrid vs. Digital Beamforming