# OFDM
[OFDM 簡介](https://ir.nctu.edu.tw/bitstream/11536/47090/4/362004.pdf)
[OFDM 通道估測](https://ir.nctu.edu.tw/bitstream/11536/47090/5/362005.pdf)
### GFDM vs OFDM
##### Pros
* Better spectral efficiency
* Low OOBE
* Less guard bands
* Same SER
* Low PAPR (less subcarrier + prototype filter)
* Higher DOF ($K$, $M$, $\mathcal{K}$, $\mathcal{M}$, $\mathbf{g}$)
##### Cons
* Higher transceiver complexity
## 2. Digital communications

### 2.1 Discrete-time channel models

* Continuous-time transmit signal
$$x_a(t)=\sum_n x[n]\delta(t-nT)*p_1(t)=\sum_n x[n]p_1(t-nT)$$
* Received signal
$$r_a(t)=(x_a*c_a)(t)+q_a(t)=\sum_n x[n](p_1*c_a)(t-nT)+q_a(t)$$
* $$w_a(t)=r_a(t)*p_2(t)=\sum_n x[n](p_1*c_a*p_2)(t-nT)+(q_a*p_2)(t)$$
* effective continuous-time channel $c_e(t)=(p_1*c_a*p_2)(t)$
* effective noise $q_e(t)=(q_a*p_2)(t)$
* Discrete-time received signal
$$\begin{align}
r[n] &= w_a(nT)=\sum_k x[k]c_e(nT-kT)+q_e(nT)\\
&=\sum_k x[k]c[n-k]+q[n]
\end{align}$$
* discrete-time equivelent channel $c[n]=(p_1*c_a*p_2)(t)|_{t=nT}$
* discrete-time equivelent noise $q[n]=(q_a*p_2)(t)|_{t=nT}$
--
* Transfer function (z-transforms) of $c[n]$: $C(z) = \sum c[n]z^{-n}$
* The channel is often modeled as a finite impulse response (FIR) filter.
* ++Channel length is inversely propotional to $T$++. ==The faster we send $x[n]$, the longer the FIR channel $c(n).$ (more complex)==
* If the channel $C(z)$ has more than one tap, ex: $c(0)+c(1)$, it will introduce ++intersymbol interference (ISI)++.
#### AGN and AWGN channels
* A channel is AGN channel if
* its channel impulse response is $c(n)=\delta(n)$
* channel noise $q(n)$ is a Gaussian random process
* If the noise also satisfy $E[q(n)q^*(m)]=0$ then it is an AWGN channel.
* AGN and AWGN channels have no ISI.
#### FIR channels
$$C(z)=\sum_{n=0}^L c(n)z^{-n}$$
* $L$: channel order
* $L+1$: channel length
* The channel has different gains for different frequencies $\rightarrow$ frequency selective channel
* One tap$\rightarrow$ frequency nonselective
#### Random channels with uncorrelated taps
In many cases, the channel impulse response is not avaliable, and only the stasistic is known.
If taps are zero-mean uncorrelated r.v.s with known variance, then $c(n)$ satisfies:
* $E[c(n)]=0$
* $R_c(k)=E[c(n)c^*(n-k)]=\sigma^2_n\delta(k)$, where $\sigma^2_n$ is the power delay profile.
### 2.2 Equalization
Consider a FIR channel $C(z)=\sum^L_{n=0}c(n)z^{-n}$:
* IIR zero-forcing equalizer: $A(z)=\frac{1}{C(z)}$
* In practice, $\frac{1}{C(z)}$ is often unstable when $C(z)$ has zeros outside the unit circle.
* To avoid this, we can design an FIR equalizer $a(n)$ with output
$$\hat{x}(n)=(a*c*x)(n)+(a*q)(n)$$
* $(c*a)(n)$ to be as close to $\delta(n-n_0)$ as possible
* design $a(n)$ to include the effect of ISI and noise
* When an FIR channel has more than one non-zero tap, an FIR equalizer can never be zero-forcing.
#### FIR vs IIR


* FIR
==只固定看某一個範圍內的輸入訊號==,所以就被稱為「有限」脈衝濾波器。
* IIR: need info from the previous output.
==不斷使用到前面訊號的特性,有一種不斷輪迴的感覺,所以被稱作「無限」脈衝濾波器==。
#### SNR
$$\beta =\frac{\text{signal power}}{\text{mean square error}}=\frac{\epsilon_x}{\sigma_e^2}$$
, where $\sigma_e^2=E[|\hat{x}(n)-x(n-n_0)|^2$.
### 2.3 Digital modulation
#### PAM (pulse amplitude modulation)

* Signal power of b-bits PAM symbols: $\epsilon_s=E[s^2]=\frac{\Delta^2}{3}(2^{2^b}-1)$
* Use nearest neighbor decision rule (NNDR).
* ++Grey code: a mapping scheme in which adjecent constellation points differ by only one bit++.
#### QAM (quadrature amplitude modulation)

* Signal power of 2b-bits QAM symbols (twice of b-bit PAM): $\epsilon_s=E[|s|^2]=\frac{2\Delta^2}{3}(2^{2^b}-1)$
* $SER_{QAM}(2b)\approx2SER_{PAM}(b)$
* $SER_{QAM}(2b)\approx 2b BER_{QAM}(2b)$
## 3. FIR equalizers
* $L_c$ is the channel order, and $L_a$ is the equalizer order
* FIR LTI channel: $C(z)=\sum_{n=0}^{L_c}c(n)z^{-n}$
* Equalizer transfer function: $A(z)=\sum_{n=0}^{L_a}a(n)z^{-n}$
* $\hat{x}(n)=(a*c*x)(n)+(a*q)(n)$

### 3.1 Zero-forcing equalizers
* $T(z)=$==$A(z)C(z)=z^{-n_0}$==$\rightarrow$ only system delay and noise
#### Least square equalizer
When channel is ==frequency selective, it has more than one tap==. Therefore, there does not exists an FIR ZF equalizer.
We can instead ++find $A(z)$ so $A(z)C(z)$ is "close" to a delay $z^{-n_0}$++.
* $$d(n)=(a*c)(n)-\delta(n-n_0)$$
When $d(n)=0$, $A(z)$ is zero-forcing. Since this is not possible, we design $a(n)$ to minimize $\sum_n |d(n)|^2$.
Let $L=L_c+L_a$, $\mathbf{t}=\mathbf{C}_{low}\mathbf{a}$.

* $$\epsilon_d(n_0)=\sum^L_{n=0}|d(n)|^2=\|\mathbf{t}-\mathbf{1}_{n_0}\|^2=\|\mathbf{C}_{low}\mathbf{a}-\mathbf{1}_{n_0}\|^2$$
$\epsilon_d(n_0)$ is the closeness of the transfer function $T(z)$ to the delay $z^{-n_0}$.
We would like to find $\mathbf{a}$ in the col space of $\mathbf{C}_{low}$ that is closest to $\mathbf{1}_{n_0}$ $\rightarrow$ orthogonal projection of $\mathbf{1}_{n_0}$ on the col space of $\mathbf{C}_{low}$.
* $$\mathbf{a}_{ls}=(\mathbf{C}_{low}^\dagger\mathbf{C}_{low})^{-1}\mathbf{C}_{low}^\dagger\mathbf{1}_{n_0}$$
==$a_{ls}(n)=[\mathbf{a}_{ls}]_n$ is the least square equalizer.==
##### Channel noise
Signal dependent noise decrease as $L_a$ increase, but noise unrelated to the signal increase as $L_a$ increase. Increase the length of least square equalizer leads to a larger output error!
Freq. domain explanation:

### 3.2 Orthogonality principle and linear estimation
* Noisy observations $y_0,...,y_{K-1}$
* Linear estimator: $\hat{x}=a_0y_0+a_1y_1+...+a_{K-1}y_{K-1}$
* Estimation error: $e = \hat{x}-x$
* Mean square error (MSE): $E[|e|^2]$
#### Find minimum mean square error (MMSE) by using orthogonality principle


### 3.3 MMSE equalizers
==在有通道衰減的情況下同時考慮 ISI 跟雜訊,允許殘留 ISI 的影響以減輕雜訊放大的效應。==
* Received signal: $$y(n)=\sum_{k=0}^{L_c} c(k)x(n-k) + q(n)$$
* Output of an $L_a$-th ordered equalizer: $$\hat{x}(n)=\sum_{k=0}^{L_a}a(k)y(n-k)$$
* Estimation error: $e = \hat{x}(n)-x(n-n_0)$, where $n_0$ is the system delay.
*Find MMSE equalizer $\rightarrow$ find the MMSE estimate of $x(n-n_0)$ from the $L_a+1$ received samples: $y(n), y(n+1),...,y(n-L_a)$:
$$E[e(n)y^*(n-k)]=0 \quad ,0\le k \le L_a$$
#### Matrix formulation

* $\mathbf{y}=\mathbf{C}_{low}^T\mathbf{x}+\mathbf{q}$
* $$\begin{align}
\mathbf{a}_\perp &=[\mathbf{R}_y^*]^{-1}\mathbf{r}_{xy}(n_0)\\
&=[\mathbf{C}_{low}^\dagger\mathbf{R}_x^*\mathbf{C}_{low}+\mathbf{R}_q^*]^{-1}\mathbf{C}_{low}^\dagger\mathbf{R}_x^*\mathbf{1}_{n_0}
\end{align}$$
----
## OFDM system model

### Effect of Multipath Channel on OFDM Symbols
* $T_{sub}$: duration of the effective OFDM symbol without guard interval.
By extending the symbol duration by $N$ times (i.e., $T_{sub}$ = $NT_s$), the effect of the multipath fading channel is greatly reduced on the OFDM symbol. However, its effect still remains as a harmful factor that may break the orthogonality among the subcarriers in the OFDM scheme.
#### CP
* OFDM symbol length: $T_{sym}=T_{sub}+T_{CP}$
* $Y_l[k]=H_l[k]X_l[k]+Z_l[k]$ using circular convolution. The transmitted symbol can be detected by ++one-tap equalization++, which simply ++divides the received symbol by the channel++.
##### Benefits
1. It inhibits ISI between subsequent OFDM symbols.
2. It turns linear convolution into circular convolution with the FFT window.
Only circular convolution allows to apply the convolution theorem and use the single-tap equalizer.
##### Issues
* Symbol timing offset (STO) may occur, which keeps the head of an OFDM symbol from coinciding with the FFT window start point.

#### ZP
Since the ZP is filled with zeros, the actual length of an OFDM symbol containing ZP is shorter than that of an OFDM symbol containing CP.
##### Benefits
* OFDM symbol containing ZP has PSD with the smaller inband ripple and larger out-of-band power. $\to$ ++more power to be used for transmission++ (peak transmission power fixed).
### OFDM Guard Band
The power spectrum of an OFDM signal is the sum of many frequency-shifted sinc functions, which has ++large out-of-band power++ such that ++ACI (adjacent channel interference)++ is incurred.
==The virtual carriers (unused subcarriers) can be used in combination with the (RC) windowing to reduce the out-of-band power and eventually to combat the ACI.==
##### Pulse shaping filter (RC filter)

out-of-band power decreases as the roll-off factor becomes larger (smoother).
### OFDMA (Multiple Access Extensions of OFDM)

* OFDM: All subcarriers are used for transmitting the symbols of a ++single user++.
* OFDMA: Assigns a subset of subcarriers to each user (subcarrier/user can vary).
##### Benefits
* As users in the same cell may have different signal-to-noise and interference ratios (SINRs), it would be more efficient to ++allow multiple users to select their own subset of subcarriers with better channel conditions++.
* Multi-user diversity gain: Improvement in the bandwidth efficiency, achieved by selecting multiple users with better channel conditions.
### Duplexing
The mechanism of dividing a communication link for downlink and uplink.
##### FDD (Frequency Division Duplexing)
* 2 separate band for each link (guard band)
* Full duplex
* High complexity/ low flexibility
* Low latency
##### TDD (Time Division Duplexing)
* Single channel (guard time)
* Half duplex
* Low complexity/ high flexibility
* Symmetric channel
## OFDM Synchronization
OFDM system carries the message data on ++orthogonal subcarriers++ for parallel transmission, ++combating++ the distortion caused by the ++frequency-selective channel++.
### Effect of STO (symbol time offset)

1. Case 1: No STO.
2. Case 2: A little early but after the end of last OFDM symbol.
Orthogonality among subcarrier frequency components can be completely preserved, but there exists a phase offset. (rotation in constellation) $\to$ single tap frequency-domain equalizer
3. Case 3: Starts beforethe end of the previous OFDM symbol.
++Both ISI and ICI++.
4. Case 4: Late. The signal consists a part of the next OFDM symbol.
++Both ISI and ICI++.
### Effect of CFO (carrier frequency offset)
Two sources:
1. phase noise due to the instability of carrier signal generators
2. Doppler shift
Two parts:
1. integer CFO (IFO)
2. fractional CFO (FFO)
##### Integer CFO (IFO)
the transmit signal $X[k]$ is cyclic-shifted by $\epsilon_i$ in the receiver, and thus producing $X[k-\epsilon_i]$ in the $k$th subcarrier. $\to$ ++significant degradation in the BER performance, but no ICI++
##### Fractional CFO (FFO)
No orthogonality among subcarrier. $\to$ amplitude and phase distortion
### Estimation Techniques for STO
Correlation-based approach.
#### Time-Domain Estimation Techniques for STO
1. STO Estimation Techniques Using Cyclic Prefix (CP)

==CP and the corresponding data part will share their similarities that can be used for STO estimation.==
Can be affected by CFO.
2. STO Estimation Techniques Using Training Symbol

Contains overhead, but ==doesn't suffer from multi-path channel==.
Estimating STO without being affected by CFO.
#### Frequency-Domain Estimation Techniques for STO
STO can be estimated by the phase difference between adjacent subcarrier components of the received signal in the frequency domain.
### Estimation Techniques for CFO
#### Time-Domain Estimation Techniques for CFO
1. CFO Estimation Techniques Using Cyclic Prefix (CP)
CP can estimate the CFO only within the range $\{|\epsilon|<0.5\}$.
2. CFO Estimation Techniques Using Training Symbol
A transmitter send the training symbols with $D$ repetitive patterns in the time domain. As the estimation range of CFO increases, the MSE performance becomes worse.
#### Frequency-Domain Estimation Techniques for CFO
If two identical training symbols are transmitted consecutively, the corresponding signals with CFO of e are related.
Preamble period: consecutive training symbols are provided for facilitating the computation
### Effect of Sampling Clock Offset
1. Effect of Phase Offset in Sampling Clocks
++Symbol timing error.++ (Same shift/delay for all sombols) It is often considered just as a part of STO.

2. Effect of Frequency Offset in Sampling Clocks
++Mismatch between the transmitter and receiver oscillators.++