2. 2
● Target
For who are not familiar with physical layer (PHY) modulation and
demodulation
Especially for computer science, networking people
● Objective
To have basics and fundamentals of PHY knowledge
To be able understand PHY and MAC cross-layer approach
● Note
Some notations and statements are loosely defined
Some numbers and factors are not scaled or normalized properly
Introduction
3. 3
● Quadrature Phase Shift Keying (QPSK)
“QPSK is a digital modulation scheme conveys data
by changing the phase of a reference signal”
“I-phase contains 1-bit information, and Q-phase
contains 1-bit information, thus QPSK can
represent 2 bits in one symbol”
● Problem
What the f**k are I and Q phase?
And how are they related with amplitude and
phase?
- (Please do not get confused it with I/Q phase)
How can we interpret a real world signal with I/Q?
Usage
- Gray code constellation
- Adjacent symbols have
only one different bit
- In most cases, noise and
fluctuation affect only
one bit in a symol
4. 4
● QPSK should generate one of four shapes
● It is a point of view from a human
● Actually, current machine could not handle such phase offset
properly as a human does and system complexity becomes high
Transmitter (1/3)
Symbol Euqation Shape
00 sin(2𝜋𝑓𝑐 𝑡 +
5
4
𝜋)
01 sin(2𝜋𝑓𝑐 𝑡 +
3
4
𝜋)
11 sin(2𝜋𝑓𝑐 𝑡 +
1
4
𝜋)
10 sin(2𝜋𝑓𝑐 𝑡 +
7
4
𝜋)
5. 5
● Mathematical fundamentals (high school)
sin 𝛼 ± 𝛽 = sin 𝛼 cos 𝛽 ± cos 𝛼 sin 𝛽
Implies that “phase can be modulated by modulating amplitude of
each cosine and sine component”
Recall the table
Transmitter (2/3)
Symbol Equation Equivalent
00 sin(2𝜋𝑓𝑐 𝑡 +
5
4
𝜋) sin
5
4
𝜋 cos 2𝜋𝑓𝑐 𝑡 + cos
5
4
𝜋 sin 2𝜋𝑓𝑐 𝑡
01 sin(2𝜋𝑓𝑐 𝑡 +
3
4
𝜋) sin
3
4
𝜋 cos 2𝜋𝑓𝑐 𝑡 + cos
3
4
𝜋 sin 2𝜋𝑓𝑐 𝑡
11 sin(2𝜋𝑓𝑐 𝑡 +
1
4
𝜋) sin
1
4
𝜋 cos 2𝜋𝑓𝑐 𝑡 + cos
1
4
𝜋 sin 2𝜋𝑓𝑐 𝑡
10 sin(2𝜋𝑓𝑐 𝑡 +
7
4
𝜋) sin
7
4
𝜋 cos 2𝜋𝑓𝑐 𝑡 + cos
7
4
𝜋 sin 2𝜋𝑓𝑐 𝑡
green: contains no phase offset
good for hardware
red = -0.707 < 0 (bit 0)
blue = 0.707 > 0 (bit 1)
6. 6
● Human implementation (machine can’t)
● Real world implementation (simplified version)
Transmitter (3/3)
~ local oscillator
sin(2𝜋𝑓𝑐 𝑡)
multiplier yields ±Asin(2𝜋𝑓𝑐 𝑡)
𝜃
multiplier yields ±Acos(2𝜋𝑓𝑐 𝑡)
90 degree
phase shifter
cos(2𝜋𝑓𝑐 𝑡)
Q-phase symbol
A (1) or –A (0)
I-phase symbol
A (1) or –A (0)
adder yields
𝐴′sin(2𝜋𝑓𝑐 𝑡 +
𝑛
4
𝜋)
or
±A𝑐𝑜𝑠(2𝜋𝑓𝑐 𝑡) ± Asin(2𝜋𝑓𝑐 𝑡)
Phase shift according to
QPSK symbol
5/4pi (00), 3/4pi (01)
1/4pi (11), 7/4pi (10)
~local oscillator
sin(2𝜋𝑓𝑐 𝑡)
𝜃
QPSK symbol This part is not so easy
for machine
7. 7
● In the previous, we learned that we can express:
sin 2𝜋𝑓𝑐 𝑡 +
𝑛
4
𝜋 , 𝑛 = 1,3,5,7
in another form:
A0 cos 2𝜋𝑓𝑐 𝑡 + 𝐴1 sin 2𝜋𝑓𝑐 𝑡
● Should we write A0 cos 2𝜋𝑓𝑐 𝑡 + 𝐴1 sin 2𝜋𝑓𝑐 𝑡 every time?
No
● Suppose Cartesian coordinates and two vectors
𝑣1 = 1,0 , 𝑣2 = (0,1)
You can never get 𝑣2 from 𝑣1 by multiplying any number
It is called orthogonal and orthogonality (in a loose manner) and
they are
Signal Space (1/2)
8. 8
● The same applies to sine and cosine
Then, sine and cosine can be axes and two spans the entire signal
space
A0 cos 2𝜋𝑓𝑐 𝑡 + 𝐴1 sin 2𝜋𝑓𝑐 𝑡 can be expressed as (𝐴0, 𝐴1)
Here, cosine is called in-phase axis and sine is called quadrature-
phase
● Another 2-D space: complex number
● (𝐴0, 𝐴1) can be interpreted as 𝐴0 + 𝒋𝐴1
● Advantage of the complex number representation
● Mathematical fundamentals (undergraduate, common)
𝐴0 + 𝑗𝐴1 = 𝐴0
2
+ 𝐴1
2
exp(𝑗 tanh−1
(𝐴1/𝐴0))
● Euler representation is widely used in EE (e.g., channel model, channel state
information, etc.)
● You can leave in the future
Signal Space (2/2)
𝐴0
𝐴1
tan−1(
𝐴1
𝐴0
)
9. 9
● Mathematical fundamentals (undergraduate, EE)
sin 2𝜋𝑓𝑐 𝑡 =
exp 2𝜋𝑓𝑐 𝑡 − 𝑗exp(2𝜋𝑓𝑐 𝑡)
2
cos 2𝜋𝑓𝑐 𝑡 =
exp 2𝜋𝑓𝑐 𝑡 + 𝑗𝑒𝑥𝑝(2𝜋𝑓𝑐 𝑡)
2
Their Fourier transform peaks at carrier frequency
Transmitter in Frequency Domain
0
Re
−𝑓𝑐 𝑓𝑐
cosine
0
Im
𝑓𝑐−𝑓𝑐
sine
10. 10
● Applying local oscillator to baseband signal (I/Q symbol) moves
its band to carrier frequency
Transmitter in Frequency Domain
0
Re
baseband
signal
Frequency
0
Re
−𝑓𝑐 𝑓𝑐
apply cosine
0
Im
𝑓𝑐−𝑓𝑐
apply sine
11. 11
● Objective
Extract QPSK symbol from a signal at carrier frequency
● How?
Same as transmitter
1. Measure phase offset and convert it into QPSK symbol
- Remember, for a human
2. Measure I and Q phase amplitude and map it into QPSK symbol
- It is a reverse of moving baseband to carrier frequency
Receiver
12. 12
● Real world implementation (simplified version)
Mathematical fundamentals (high school)
sin2(𝛼) =
1 − cos 2𝛼
2
, cos2 𝛼 =
1 + cos(2𝛼)
2
Receiver
~
multiplier yields
±A𝑐𝑜 𝑠 2𝜋𝑓𝑐 𝑡 sin(2𝜋𝑓𝑐 𝑡) ± Asin2(2𝜋𝑓𝑐 𝑡)
𝜃
multiplier yields
±A𝑐𝑜𝑠2(2𝜋𝑓𝑐 𝑡) ± Asin 2𝜋𝑓𝑐 𝑡 cos(2𝜋𝑓𝑐 𝑡)
Q-phase symbol
A (1) or –A (0)
I-phase symbol
A (1) or –A (0)
input from antenna
±A𝑐𝑜𝑠(2𝜋𝑓𝑐 𝑡) ± Asin(2𝜋𝑓𝑐 𝑡)
LPF
LPF
LPF removes all swing terms
and leaves only a constant term
13. 13
Receiver Proof of Concept
● Red line is a super simple low pass filtered (average) signal
Filtered signal < 0: bit 0
Filtered signal > 0: bit 1
Transmitted and received signal apply sine and low pass filter apply cosine and low pass filter
14. 14
Receiver in Frequency Domain
0
Re
I-phase
signal
I-phase
signal
−𝑓𝑐 𝑓𝑐
0
Re
−𝑓𝑐 2𝑓𝑐
Apply
low
pass
filter
here
−2𝑓𝑐
apply cosine
0
Im
Q-phase
signal
Q-phase
signal
−𝑓𝑐 𝑓𝑐
0
Re
−𝑓𝑐 2𝑓𝑐
Apply
low
pass
filter
here
−2𝑓𝑐
apply sine
15. 15
● A real world signal has only amplitude and phase
● I/Q-phase and I/Q-plane is for machine
● References and materials
1. PSK/QPSK – Wikipedia https://en.wikipedia.org/wiki/Phase-shift_keying
2. Orthogonality – Wikipedia https://en.wikipedia.org/wiki/Orthogonality
3. Trigonometric functions/Relationship to exponential function and complex
numbers – Wikipedia
https://en.wikipedia.org/w/index.php?title=Trigonometric_functions&redirect=no
#Relationship_to_exponential_function_and_complex_numbers
4. Euler’s formula – Wikipedia https://en.wikipedia.org/wiki/Euler%27s_formula
5. Fourier transform of sine and cosine – Wolfram
http://mathworld.wolfram.com/FourierTransformSine.html,
http://mathworld.wolfram.com/FourierTransformCosine.html
6. Convolution theorem – Wikipedia
https://en.wikipedia.org/wiki/Convolution_theorem
7. Heterodyne – Wikipedia https://en.wikipedia.org/wiki/Heterodyne
8. Lecture 11: Signal space - MIT open course
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-450-
principles-of-digital-communications-i-fall-2006/video-lectures/lecture-11-signal-
space/
Conclusion