Wireless Communication Systems
@CS.NCTU
Lecture 3: 802.11 PHY and OFDM
Instructor: Kate Ching-Ju Lin (林靖茹)
Reference
1. OFDM Tutorial
online:
http://home.iitj.ac.in/~ramana/ofdm-
tutorial.pdf
2. OFDM Wireless LWNs: A Theoretical
and Practical Guide
By John Terry, Juha Heiskala
3. Next Generation Wireless LANs: 802.11n
and 802.11ac
By Eldad Perahia
2
Agenda
• Packet Detection
• OFDM
(Orthogonal Frequency Division Modulation)
• Synchronization
3
What is Packet Detection
• Detect where is the starting time of a packet
• It might be easy to detect visually, but how
can a device automatically find it?
⎻ Simplest way: find the energy burst using a
threshold
⎻ Difficulty: hard to determine a good threshold
✔ ✘
4
Packet Detection
PacketPacketPacket
An Bn
Power ratio Mn=An/Bn threshold
• Double sliding window packet detection
• Optimal threshold depends on the receiving
power
5
Packet Detection in 802.11
• Each packet starts with a preamble
⎻ First part of the preamble is exactly the same with
the second part
preamble header and data
• Use cross-correlation to detect the preamble
⎻ Use double sliding window to calculate the
auto-correlation of the signals received in two
windows
⎻ Leverage the key properties: 1) noise is
uncorrelated with the preamble, and 2) data
payload is also uncorrelated with the preamble
6
Packet Detection in 802.11
preamble preamble
preamble preamble
preamble preamble preamble
preamble
preamble
An Bn
Correlation
over time threshold
• Noise is uncorrelated with noise
• Noise is uncorrelated with preamble
• Get a peak exactly when the double windows
receives the entire preamble
• Data is again uncorrelated with noise 7
Agenda
• Packet Detection
• OFDM
(Orthogonal Frequency Division Modulation)
• Synchronization
8
Narrow-Band Channel Model
• Signal over wireless channels
⎻ y = hx + n
• h = α*exp2jπfδ is the channel between Tx and
Rx
⎻ α: received amplitude, δ: propagation delay
• How to decode x? The procedure of
⎻ x = y/h + n finding H is called
⎻ How to learn h? channel estimation
⎻ Re-use the known preamble to learn h
à since y = hp + n, we get h’ = y/p
9
Why OFDM?
• Signal over wireless channels
⎻ y = hx + n à Decoding: x’= y/h
• Work only for narrow-band channels, but not for
wide-band channels, e.g., 20 MHz for 802.11
⎻ Channels of different narrow bands will be different!
Capacity = BW * log(1+SNR) 20MHz
frequency
2.45GHz (Central frequency)
10
Basic Concept of OFDM
Wide-band channel Multiple narrow-band channels
Send a sample using Send samples concurrently using
the entire band multiple orthogonal sub-channels
11
Why OFDM is Better?
t t
1
0
0
f 10
1
0 0 1 1 0 0 0 1 …........ f
Wide-band OFDM: Narrow-band
• Multiple sub-channels (sub-carriers) carry
samples sent at a lower rate
• Almost same bandwidth with wide-band channel
• Only some of the sub-channels are affected by
interferers or multi-path effect
12
Importance of Orthogonality
• Why not just use FDM (frequency division
multiplexing)
Individual sub-channel
• Not orthogonal
Leakage interference from
adjacent sub-channels
f
• Need guard bands between adjacent frequency
bands à extra overhead and lower utilization
guard band
Guard bands protect
leakage interference
f
13
Difference between FDM and OFDM
guard band
f
Frequency division multiplexing
Don’t need guard bands
Orthogonal sub-carriers in OFDM
14
Key to Achieve Orthogonality: FFT
• Fast Fourier Transform (FFT)
• Any waveform is the Sum of Sines
⎻ Fourier’s theorem: ANY waveform in the time
domain can be represented by the weighted sum
of sines
ef1+ef2 ef1+ 0.5*ef2 a*ef1+b*ef2+c*ef3+…
Frequency-
domain
How to generate
a square wave?
Time-
domain
Primer of FFT/iFFT
• iFFT: from frequency-domain signals to time-domain signals
• FFT: from time-domain signals to frequency-domain signals
time-domain signal
Frequency-domain signal:
Amplitude of each freq.
a, b, c, d, … iFFT
c
How can we know the
amplitude
a FFT
frequency-domain
b
components (a, b, c ,…)
from this time-domain signal?
f1 f2 f3 frequency
Primer of FFT/iFFT
• iFFT: from frequency to time
⎻ Use periodical waveforms to generate signals
c
amplitude a
iFFT( b
)=
f1 f2 f3 frequency
• FFT: from time to frequency
⎻ Extract frequency components of any signal
c
amplitude
a
FFT( )= b
f1 f2 f3 frequency
OFDM Transmitter and Receiver
amplitude
c
a
b
Transmitter f1 f2 f3 freq
a
Modulation b
Data in
(BPSK, QAM, c iFFT D/A
0, 1, 1, 0, … etc) d
…
channel
Frequency-domain time-domain
signal signal
+ noise
a
0, 1, 1, 0, … Demodulation b
(BPSK, QAM, c FFT A/D
Data out etc) d
…
amplitude
c
Receiver a
b
Represent information
bits as the amplitudes of f1 f2 f3 freq
18
orthogonal subcarriers
OFDM Basic
1. Partition the wide band to multiple narrow sub-
carriers f1, f2, f3, …, fN
2. Represent information bits as the frequency-
domain signal (amplitude of each sub-carrier)
⎻ Example: if we want to send 1, -1, 1, 1, we let 1, -1, 1, 1 be
the frequency-domain signals
3. Use iFFT to convert the information to the time-
domain sent over the air
⎻ Example: Transmit 1*ef1 + (-1)*ef2 + 1*ef3 + 1*ef4
4. Rx uses FFT to extract information
⎻ Example: [1 -1 1 1] = FFT(1*ef1 + (-1)*ef2 + 1*ef3 + 1*ef4)
19
Orthogonal Frequency Division Modulation
* X[1]
IFFT * X[2] transmit
f
f * X[3]
…
Data X[n] coded in
frequency domain Transformation to time domain:
each frequency is a sine wave
in time, all added up
Decode each
subcarrier separately
receive FFT
t
X’[N] = amplitude of
f each sub-carrier
Time domain signal Frequency domain signal 20
Orthogonality of Sub-carriers
Time-domain signals: x(t) Frequency-domain signals: X[k]
IFFT
Encode: frequency-domain samples à time-domain samples
N/2 1 k-th subcarrier
1 X
x(t) = X[k]ej2⇡kt/N
N
k= N/2
FFT
Decode: time-domain samples à frequency-domain sample
N/2 1
X
2j⇡kt/N
X[k] = x(t)e
t= N/2 Orthogonal à
inner product = 0
N/2 1
X
Orthogonality of any two bins : ej2⇡kt/N e j2⇡pt/N
= 0, 8p 6= k
k= N/2 21
Orthogonality between Subcarriers
• Subcarrier frequencies (k/N, k=-N/2,…, N/2-1)
are chosen so that the subcarriers are
orthogonal to each other
⎻ No guard band is required
• Two signals are orthogonal if their inner
product equals zero
N/2 1 N/2 1
X X
j2⇡kt/N j2⇡pt/N
e e = e2j⇡(k p)t/N
k= N/2 k= N/2
(
N if p = k
= N (k, p) = X[k]?X[p], k 6= p
0 6 k
if p =
22
Serial to Parallel Conversion
• Say we use BPSK and 4 sub-carriers to transmit a
stream of samples
1, 1, -1, -1, 1, 1, 1, -1, 1, -1, -1, -1, -1, 1, -1, -1, -1, 1, 1, -1, -1, -1, 1, 1
• Serial-to-parallel conversion of samples
Frequency-domain signal Time-domain signal
c1 c2 c3 c4
symbol1 1 1 -1 -1 IFFT 0 2 - 2i 0 2 + 2i
symbol2 1 1 1 -1 2 0 - 2i 2 0 + 2i
symbol3 1 -1 -1 -1 -2 2 2 2
symbol4 -1 1 -1 -1 -2 0 - 2i -2 0 + 2i
symbol5 -1 1 1 -1 0 -2 - 2i 0 -2 + 2i
symbol6 -1 -1 1 1 0 -2 + 2i 0 -2 - 2i
• Send time-domain samples after parallel-to-serial
conversion
0, 2 - 2i, 0, 2 + 2i, 2, 0 - 2i, 2, 0 + 2i, -2, 2, 2, 2, -2, 0 - 2i, -2, 0 + 2i, 0, -2 - 2i,
0, -2 + 2i, 0, -2 + 2i, 0, -2 - 2i, … 23
t1-4 t5-8 t9-12 t13-16 t17-20 t21-24
f1
symbol1 1 1 -1 -1 f2
symbol2 1 1 1 -1
symbol3 1 -1 -1 -1
symbol4 -1 1 -1 -1
symbol5 -1 1 1 -1
symbol6 -1 -1 1 1 f3
f4
24
t1-4 t5-8 t9-12 t13-16 t17-20 t21-24
f1
symbol1 1 1 -1 -1 f2
symbol2 1 1 1 -1
symbol3 1 -1 -1 -1
symbol4 -1 1 -1 -1
symbol5 -1 1 1 -1
symbol6 -1 -1 1 1 f3
1. Send four samples
simultaneously in each time-slot
2. but send the same four samples
using four time slots f4
à same data rate
Send the combined signal as the time-domain signal
Why OFDM?
combat multipath fading
26
Multi-Path Effect
y(t) = h(0)x(t) + h(1)x(t 1) + h(2)x(t 2) + · · ·
X
= h(4)x(t 4) = h(t) ⌦ x(t) , Y (f ) = H(f )X(f )
4
time-domain convolution frequency-domain
27
Current symbol + delayed-version symbol
à Signals are destructive in only certain frequencies
28
direct delay
f1 ✘
f2 ✔
f3 ✔
Current symbol + delayed-version symbol
à Signals are destructive in only certain frequencies
29
Frequency Selective Fading
frequency frequency
Frequency selective fading: Only some sub-carriers get affected
Can be recovered by proper coding!
30
Inter Symbol Interference (ISI)
• The delayed version of a symbol overlaps with
the adjacent symbol
• One simple solution to avoid this is to
introduce a guard-band
Guard band
31
Cyclic Prefix (CP)
• However, we don’t know the delay spread
exactly
⎻ The hardware doesn’t allow blank space because
it needs to send out signals continuously
• Solution: Cyclic Prefix
⎻ Make the symbol period longer by copying the tail
of time-domain samples and glue them in the front
CP Symbol i CP Symbol i+1 …
In 802.11, each symbol
with 64 samples
CP:data = 1:4
à CP: last 16 samples 32
Cyclic Prefix (CP)
• Because of the usage of FFT, the signal is periodic
FFT( ) = exp(-2jπΔf)*FFT( )
delayed version original signal
• Delay in the time domain corresponds to phase shift
in the frequency domain
⎻ Can still obtain the correct signal in the frequency
domain by compensating this rotation
33
Cyclic Prefix (CP)
w/o multipath
y(t) à FFT( ) àY[k] = H[k]X[k]
original signal
w multipath
y(t) à FFT( ) àY[k] = (H[k] + exp(-2jπΔk)H[k])X[k]
= (H [k] +H2[k])X[k]
original signal
= H’[k]X[k]
Lump the
+ delayed-version signal phase shift in H
34
Side Benefit of CP
• Allow the signal to be decoded even if the
packet is detected not that accurately
decodable undecodable
FFT_OFFSET
The point you think the first symbol ends
The last sample you
actually use for FFT
Check the parameter
FFT_OFFSET in the WARP code.
Try to modify it!
35
OFDM Diagram
Transmitter
Modulation S/P IFFT
Insert
P/S D/A
CP
channel
+ noise
De-mod
remove
P/S FFT CP
S/P A/D
Receiver
36
Unoccupied Subcarriers
• Edge sub-carriers are more vulnerable
⎻ Frequency might be shifted due to noise or multi-path
• Leave them unused
⎻ In 802.11, only 48 of 64 bins are occupied bins
• Is it really worth to use OFDM when it costs so
many overheads (CP, unoccupied bins)?
37
Agenda
• Packet Detection
• OFDM
(Orthogonal Frequency Division Modulation)
• Synchronization
38
OFDM Diagram
baseband
passband
Transmitter 20MHz
Modulation
Oscillator
2.4GHz
Insert
S/P IFFT P/S D/A
CP
channel
+ noise
Oscillator
De-mod
remove
P/S FFT S/P A/D
CP 2.4GHz
baseband
passband
20MHz
Receiver
39
Overview
• Carrier Frequency Offset (CFO)
⎻ fctx ≠ fcrx (e.g., TX: 2.45001GHz, RX: 2.44998GHz)
⎻ CFO: Δf = ftx – frx
⎻ Time-domain signals:
y’(t) = y(t) * exp(2jπΔft) Error accumulates
over time
real theoretical
• Sample Frequency Offset (SFO)
⎻ Sampling rates in Tx and Rx are slightly different
(e.g., TX: 20.0001MHz, RX: 19.99997MHz)
⎻ SFO : = Trx Ttx Phase rotates 2jπδkφ in the
Ttx k-th subcarrier
⎻ Freq.-domain signals: Y’[k] = Y[k] * exp(2jπδkφ)
constant
40
Overview
• Carrier Frequency Offset (CFO)
⎻ Calibrate in time-domain
⎻ y’(t) = y(t) * exp(2jπΔft) * exp(-2jπΔft)
⎻ How: Use the preamble
• Sample Frequency Offset (SFO)
⎻ Calibrate in frequency-domain
⎻ Y’[k] = Y[k] * exp(2jπδkφ) * exp(-2jπδkφ)
⎻ How: Use the pilot subcarriers
41
Carrier Frequency Offset (CFO)
frequency
frx ftx
Δf
• The oscillators of Tx and Rx are not perfectly
synchronized
⎻ Carrier frequency offset (CFO) Δf = ftx – frx
⎻ Leading to inter-carrier interference (ICI)
• OFDM is sensitive to CFO
42
CFO Estimation
• Up/Down conversion at Tx/Rx
⎻ Up-convert baseband signal s(t) to passband signal
r(t) = s(t)ej2⇡ftx t ⌦ h(t, ⌧ )
⎻ Down-convert passband signal r(t) back to
j2⇡frx t
yn = r(nTs )e
= s(nTs )ej2⇡ftx t e j2⇡frx t
⌦ h(nTs , ⌧ )
= s(nTs )ej2⇡ f nTs
⌦ h(nTs , ⌧ )
Error caused by CFO, accumulated with time nTs
43
CFO Correction in 802.11
sn Sn+N
Symbol 1 Symbol 2
• Reuse the preamble to calibrate CFO
• The first half part of the preamble is identical
to the second half part
⎻ The two transmitted signals are identical: sn = sn+N
⎻ But, the received signals contain different errors
yn = (sn ⌦ h)ej2⇡ f nTs à Additional phase rotation ΔfnTs
à Additional phase rotation Δf(n+N)Ts
yn+N = (sn ⌦ h)ej2⇡ f (n+N )Ts
Find Δf by taking yn+N / yn
44
CFO Correction in 802.11
⇤
yn yn+N = (sn ⌦ h)ej2⇡ f nTs
(sn ⌦ h)e j2⇡ f (n+N )Ts
j2⇡ f N Ts
=e |(sn ⌦ h)|2
• To learn CFO Δf, find the angle of (yny*n+N)
!
X
\ ⇤
yn y N +n = 2⇡ f N Ts
n
!
1 X
) ˜ f Ts = \ ⇤
y n yN +n
2⇡N n
• Calibrate the signals to remove phase rotation
j2⇡ ˜ f nTs j2⇡ f nTs j2⇡ ˜ f nTs
yn e = (sn ⌦ h)e e ⇡ (sn ⌦ h)
Received signals calibration
45
Sampling Frequency Offset (SFO)
DAC (Tx)
ADC (Rx)
• DAC (at Tx) and ADC (at Rx) never have exactly
the same sampling period (Ttx ≠ Trx)
⎻ Tx and Rx may sample the signal at slightly different
timing offset T T
rx tx
SFO : =
Ttx
46
Phase errors due to SFO
• Assuming no residual CFO, the k-th subcarrier
in the received symbol i becomes
Yi,n = Hk Xi,k ej2⇡ k
See proof in
the next slide
• All subcarriers experience the same sampling
offset, but applied on different frequencies k
⎻ φ is a constant
⎻ Each subcarrier is rotated by a constant
phase shift 2⇡
⎻ Lead to Inter Carrier interference (ICI), which
causes loss of the orthogonality of the subcarriers
47
Proof of phase errors due to SFO
Time-domain
Up-convert: r(t) = s(t)ej2⇡ftx t ⌦ h(t, ⌧ ) + n(t)
j2⇡frx t
Down-convert: yi,n = r(t)e |t=(iNS +NCP +n)Trx
Frequency-domain Residual CFO SFO
FFT
Yi,k = Hk Xi,k ej2⇡( f TF F T + k)
NCP : Number of samples in CP
NF F T : FFT window size
NS = NF F T + NCP : Symbol size
iNS + NCP a constant indicating the initial
= 0.5 + :
NF F T phase error of symbol i
48
Sample Rotation due to SFO
Incremental phase errors in different subcarriers
à Signals keep rotating in the I-Q plane
subcarrier 3
Q subcarrier 2
subcarrier 1
2⇡
2⇡
xxxx x 2⇡ xxx x
x xx x xxx I
Ideal BPSK signals (No rotation)
49
Phase Errors due to SFO and CFO
phase of H x
x 2πδkφ (SFO)
x 1
x
x
x
x 2πΔfTFFT φ (Residual CFO)
x
x Subcarrier index k
• Subcarrier i of the received frequency domain
signals in symbol n
Yi,k = Hk Xi,k ej2⇡( f TF F T + k)
• SFO: slope; residual CFO: intersection of y-axis
50
Data-aided Phase Tracking
x 2πδkφ = 2π θk (SFO)
1
x
x x 2πΔfTFFT φ = 2π η (Residual CFO)
regression
• WiFi reserves 4 known pilot bits (subcarriers) to compute
Hkej2π(η+θk)=Yk/Xk
• Estimate SFO θk and CFO η by finding the linear regression
of the phase changes experienced by the pilot bits
• Update the channel by H’k = Hke2jπ(η+θk) for every symbol k,
and then decode the remaining non-pilot subcarriers
Yi,k = Hk Xi,k ej2⇡(⌘+✓k) = Hk0 Xi,k
)X̂i,k = Yi,k /Hk0 51
After Phase Tracking
Q
Xi,k ej2 ( + k)
Xi,k
xxxx x xxx x
x xx x xx
x
I
Decoded signals in the I-Q plane after phase tracking
52
OFDM Diagram
Transmitter
Modulation
Insert
S/P IFFT P/S D/A
CP
channel
+ noise
Correct CFO
Phase track
De-mod
remove
P/S FFT S/P A/D
CP
frequency-domain Receiver time-domain
53
Quiz
• Say we want to send (1, -1, 1, 1, -1),
and transmit over the air
(1,-1,1,1,-1) is the (a) frequency-domain or
(b) time-domain signal?
is the (a) frequency-domain or
(b) time-domain signal
• What is the Multipath Effect? Why does it cause
Deep Fading?
54