# Cyclic prefix

In telecommunications, the term cyclic prefix refers to the prefixing of a symbol with a repetition of the end. The receiver is typically configured to discard the cyclic prefix samples, but the cyclic prefix serves two purposes:
* It provides a guard interval to eliminate intersymbol interference from the previous symbol.
* It repeats the end of the symbol so the linear convolution of a frequency-selective multipath channel can be modeled as circular convolution, which in turn may transform to the frequency domain via a discrete Fourier transform. This approach accommodates simple frequency domain processing, such as channel estimation and equalization.
For the cyclic prefix to serve its objectives, it must have a length at least equal to the length of the multipath channel. The concept of a cyclic prefix is traditionally associated with OFDM systems, however the cyclic prefix is now also used in single carrier systems to improve the robustness to multipath propagation.

## Principle

A cyclic prefix is often used in conjunction with modulation to retain sinusoids' properties in multipath channels. It is well known that sinusoidal signals are eigenfunctions of linear, and time-invariant systems. Therefore, if the channel is assumed to be linear and time-invariant, then a sinusoid of infinite duration would be an eigenfunction. However, in practice, this cannot be achieved, as real signals are always time-limited. So, to mimic the infinite behavior, prefixing the end of the symbol to the beginning makes the linear convolution of the channel appear as though it were circular convolution, and thus, preserve this property in the part of the symbol after the cyclic prefix.

## Use in OFDM

OFDM uses cyclic prefixes to combat multipath by making channel estimation easy. As an example, consider an OFDM system that has $N$ subcarriers. The message symbol can be written as:
    $\mathbf {d} ={\begin{bmatrix}d_{0}&d_{1}&\ldots &d_{N-1}\end{bmatrix}}^{\textsf {T}}$
The OFDM symbol is constructed by taking the inverse discrete Fourier transform (IDFT) of the message symbol, followed by a cyclic prefixing. Let the symbol obtained by the IDFT be denoted by
    $\mathbf {x} ={\begin{bmatrix}x[0]&x[1]&\ldots &x[N-1]\end{bmatrix}}^{\textsf {T}}$.
Prefixing it with a cyclic prefix of length $L_{1}-1$, the OFDM symbol obtained is:
    $\mathbf {z} ={\begin{bmatrix}x[N-L_{1}+1]&\ldots &x[N-2]&x[N-1]&x[0]&x[1]&\ldots &x[N-1]\end{bmatrix}}^{\textsf {T}}.$
Assume that the channel is represented using
    $\mathbf {h} ={\begin{bmatrix}h_{0}&h_{1}&\ldots &h_{L_{2}-1}\end{bmatrix}}^{\textsf {T}}$.
Then, the convolution with this channel, which happens as
    $y[m]=\sum _{l=0}^{L-1}h[l]z[m-l]\quad 0\leq m\leq N-L_{1}-2$
results in the received symbols $\mathbf {y}$. Now only if $L_{1}\geq L_{2}$, this is the circular convolution of $\mathbf {z}$ and $\mathbf {h}$ at the values $m\geq L_{1}$, since here $\mathbf {z}$ becomes $x[(m-l)\mod N]$. Hence, taking the discrete Fourier transform of these values, we get
    $Y[k]=H[k]\cdot X[k]$.
where $X[k]$ is the discrete Fourier transform of $\mathbf {x}$, i.e. $\mathbf {d}$. Thus, a multipath channel is converted into scalar orthogonal sub-channels in the frequency domain, thereby simplifying the receiver design considerably. The task of channel estimation is simplified, as we just need to have access to an estimate of the scalar coefficients $H[k]$, for the duration in which the channel does not vary significantly, merely multiplying the received demodulated symbols by the inverse of $H[k]$ yields the estimates of $\{X[k]\}$ and hence, the estimate of actual symbols ${\begin{bmatrix}d_{0}&d_{1}&\ldots &d_{N-1}\end{bmatrix}}^{\textsf {T}}$.