1
Pri rinciples nciples of
- f Com
- mmunications
munications
EC ECS S 332 32
- Dr. Prapun Suksompong
prapun@siit.tu.ac.th
- 7. Angle Modulation
Pri rinciples nciples of of Com ommunications munications EC - - PowerPoint PPT Presentation
Pri rinciples nciples of of Com ommunications munications EC ECS S 332 32 Dr. Prapun Suksompong prapun@siit.tu.ac.th 7. Angle Modulation Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00 1 Instantaneous Frquency
1
2
2 1
cos 2 x t t t
1 2 3 4 1 0.5 0.5 1 1 1 x1 t ( ) 4 t
At t = 2, frequency = ?
3
2 1
cos 2 x t t t
1 2 3 4 1 0.5 0.5 1 1 1 x1 t ( ) 4 t
At t = 2, f = t2 = 4 Hz?
cos 2 ft
Correct?
4
2 1
cos 2 x t t t
1 2 3 4 1 0.5 0.5 1 x1 t ( ) cos 2 4 t ( ) t
Correct? At t = 2, f = t2 = 4 Hz?
cos 2 ft
5
2 1
cos 2 x t t t
4 Hz is too low!!!
1 2 3 4 1 0.5 0.5 1 x1 t ( ) cos 2 4 t ( ) t 1.9 2 2.1 1 0.5 0.5 1 x1 t ( ) cos 2 4 t ( ) t
6
2 1
cos 2 x t t t
12 Hz?
1 2 3 4 1 0.5 0.5 1 x1 t ( ) cos 2 12 t ( ) t 1.9 2 2.1 1 0.5 0.5 1 x1 t ( ) cos 2 12 t ( ) t
7
Message signal Unmodulated carrier Phase-modulated signal Frequency-modulated signal
8
FM
x t
PM
x t
Remark: To see xPM(t) of time varying m(t), it is usually easier to look at the instantaneous freq. via the derivative first.
9
Message signal Unmodulated carrier Phase-modulated signal Frequency-modulated signal
10
11
FM
x t
PM
x t
12
Purely amplitude-modulated? Purely phase-modulated?
1( )
( )cos 2
c
x t a t f t
2
2 ( ) cos ( )
c
x t f A t t
13
1( )
( )cos 2
c
x t a t f t
Assume that 𝑏 𝑢 is bounded such that 0 ≤ 𝑏 𝑢 ≤ 𝐵. Let
1 1
1 ( ) cos ( ) 2
c
t x t t A f
2 1
( ) cos ( ( ) 2 )
c
t t x t f x A t
12
0.05 0.1 0.15 0.2 0.25
0.5 1 Seconds 0.03
cos 2𝜌𝑔
1𝑢
cos 2𝜌𝑔
2𝑢
cos 2𝜌𝑔
5𝑢
cos 2𝜌𝑔
4𝑢
cos 2𝜌𝑔
3𝑢
Rate = R frequency-change per second
Each tone lasts 1/R sec.
13
cos 2𝜌𝑔
1𝑢
cos 2𝜌𝑔
2𝑢
cos 2𝜌𝑔
5𝑢
cos 2𝜌𝑔
4𝑢
cos 2𝜌𝑔
3𝑢
1300 Hz 1100 Hz 1200 Hz 1500 Hz 1400 Hz
1 2 3 4 5 6 7 8 9 10
0.5 1 Seconds
1000 2000 3000 0.5 1 1.5 Frequency [Hz] Magnitude
R = 0.5
14
cos 2𝜌𝑔
1𝑢
cos 2𝜌𝑔
2𝑢
cos 2𝜌𝑔
5𝑢
cos 2𝜌𝑔
4𝑢
cos 2𝜌𝑔
3𝑢
300 Hz 100 Hz 200 Hz 500 Hz 400 Hz
1 2 3 4 5 6 7 8 9 10
0.5 1 Seconds
200 400 600 800 1000 0.2 0.4 0.6 0.8 1 Frequency [Hz] Magnitude
R = 0.5
15
cos 2𝜌𝑔
1𝑢
cos 2𝜌𝑔
2𝑢
cos 2𝜌𝑔
5𝑢
cos 2𝜌𝑔
4𝑢
cos 2𝜌𝑔
3𝑢
300 Hz 100 Hz 200 Hz 500 Hz 400 Hz R = 1
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
0.5 1 Seconds
200 400 600 800 1000 0.1 0.2 0.3 0.4 0.5 Frequency [Hz] Magnitude
16
cos 2𝜌𝑔
1𝑢
cos 2𝜌𝑔
2𝑢
cos 2𝜌𝑔
5𝑢
cos 2𝜌𝑔
4𝑢
cos 2𝜌𝑔
3𝑢
300 Hz 100 Hz 200 Hz 500 Hz 400 Hz R = 5
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.5 1 Seconds
200 400 600 800 1000 0.02 0.04 0.06 0.08 0.1 Frequency [Hz] Magnitude
17
cos 2𝜌𝑔
1𝑢
cos 2𝜌𝑔
2𝑢
cos 2𝜌𝑔
5𝑢
cos 2𝜌𝑔
4𝑢
cos 2𝜌𝑔
3𝑢
300 Hz 100 Hz 200 Hz 500 Hz 400 Hz R = 20
0.05 0.1 0.15 0.2 0.25
0.5 1 Seconds
200 400 600 800 1000 0.01 0.02 0.03 Frequency [Hz] Magnitude
18
cos 2𝜌𝑔
1𝑢
cos 2𝜌𝑔
2𝑢
cos 2𝜌𝑔
5𝑢
cos 2𝜌𝑔
4𝑢
cos 2𝜌𝑔
3𝑢
300 Hz 100 Hz 200 Hz 500 Hz 400 Hz R = 50
0.02 0.04 0.06 0.08 0.1 0.12
0.5 1 Seconds
200 400 600 800 1000 0.005 0.01 0.015 Frequency [Hz] Magnitude
19
cos 2𝜌𝑔
1𝑢
cos 2𝜌𝑔
2𝑢
cos 2𝜌𝑔
5𝑢
cos 2𝜌𝑔
4𝑢
cos 2𝜌𝑔
3𝑢
300 Hz 100 Hz 200 Hz 500 Hz 400 Hz
1 2 3 4 5 6 7 8 9 10
0.5 1 Seconds
200 400 600 800 1000 0.2 0.4 0.6 0.8 1 Frequency [Hz] Magnitude
R = 0.5
95 100 105 Frequency [Hz]
20
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.5 1 Seconds
50 100 150 200 0.1 0.2 0.3 0.4 0.5 Frequency [Hz] Magnitude 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.5 1 Seconds
50 100 150 200 0.02 0.04 0.06 0.08 0.1 Frequency [Hz] Magnitude
𝑦 𝑢 = cos 2𝜌 100 𝑢 𝑦 𝑢 = cos 2𝜌 100 𝑢 , 0.4 ≤ 𝑢 ≤ 0.6, 0,
1
The Sony VAIO logo illustrates the integration of analog and digital technology. The VA letters form an analog wave and the IO part represents a binary one and zero.
2
Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00
3
The real world is analog! Interfacing between analog and digital is important. Digitization
1.
Sampling (and hold): Discretize the time
Get sampled values of the analog signal. 2.
Convert each sampled value to a binary code.
4
Time Vertical lines are used for sampling Horizontal lines are used for quantization 001 000 010 011 100 101 110 111 111 100 100 111 011 100 101 010 000 001 001 100111111100001000010100011001
5
At first glance, digitization of a continuous signal (audio,
Therefore the crucial question arises as to which criterion we
6
Sampling is the process of taking a (sufficient) number of
Suppose that we sample a signal at a uniform rate, once every
We refer to Ts as the sampling period, and to its reciprocal fs
The more samples you take, the more accurately you can
Caution: If the sampling rate is too low, your may experience
distortion (aliasing).
7
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.2 0.4 0.6 0.8 1 t
[AliasingSin_2.m]
8
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.2 0.4 0.6 0.8 1 t
From time 0 to 1, it should have completed 50 cycles. However, our plot has only
It looks more like the plot
sin 2 t
9
0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1
0.2 0.4 0.6 0.8 1 t
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.2 0.4 0.6 0.8 1 t
Aliasing causes high-frequency signal to be seen as low frequency.
10
In order to (correctly and completely) represent an analog
Given a sampling frequency, fs,
Given that highest (positive-)frequency component fmax of
And the Nyquist sampling interval is 1/(2 fmax)
11
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.2 0.4 0.6 0.8 1 t
We need to sample at least 100 times per time unit. Here, the number of sample per time unit is 49, which is too small to avoid aliasing.
12
If you've ever watched a film and seen the wheel of a rolling
13
fs: Sampling frequency = 200 samples/sec
1 2 3 4 5 6 7 8 9 10
0.5 1 Seconds
20 40 60 80 100 2 4 6 Frequency [Hz] Magnitude
𝑔
𝑡
2 − 𝑔
𝑡
2 cos 2𝜌 5 𝑢
14
fs: Sampling frequency = 200 samples/sec
𝑔
𝑡
2 − 𝑔
𝑡
2 cos 2𝜌 10 𝑢
1 2 3 4 5 6 7 8 9 10
0.5 1 Seconds
20 40 60 80 100 2 4 6 Frequency [Hz] Magnitude
15
fs: Sampling frequency = 200 samples/sec
cos 2𝜌 50 𝑢
20 40 60 80 100 2 4 6 Frequency [Hz] Magnitude
cos 2𝜌 70 𝑢
20 40 60 80 100 2 4 6 Frequency [Hz] Magnitude
20 40 60 80 100 2 4 6 8 Frequency [Hz] Magnitude
cos 2𝜌 100 𝑢
16
fs: Sampling frequency = 200 samples/sec
cos 2𝜌 110 𝑢 cos 2𝜌 130 𝑢 cos 2𝜌 190 𝑢
20 40 60 80 100 1 2 3 4 Frequency [Hz] Magnitude
20 40 60 80 100 2 4 6 Frequency [Hz] Magnitude
20 40 60 80 100 2 4 6 Frequency [Hz] Magnitude
17
18
When sampled at 10 Samples per sec, there is no way to tell
19
𝑓𝑘2𝜌𝑔
0𝑢
20
𝑓𝑘2𝜌𝑔
0𝑢
21
𝑓𝑘2𝜌𝑔
0𝑢
𝑓𝑘2𝜌𝑔
1𝑢
22
𝑓𝑘2𝜌𝑔
0𝑢
𝑓𝑘2𝜌𝑔
1𝑢
23
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8
24
1 2 3 4 2 4 6 8 10 12 14 16
1 2 3 4 2 4 6 8 10 12 14 16
1
Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00
2
Text is commonly encoded using ASCII, and MATLAB
text string (decimal) ASCII representation of the text string binary (base 2) representation of the decimal numbers
3
4
Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00
5
p t
T 2T 3T 4T
t t
ˆ
n t nT t nT
x t m n p t nT m n y t x t
y t x t
1 .5T
m n m n
ˆ 1 1 ˆ 0 ˆ 1 1 m m m m m m
Transmitted signal Received signal Pulse
6
p t
T 2T 3T 4T
t t
ˆ
n t nT t nT
x t m n p t nT m n y t x t
y t x t
1
ˆ m n m n
ˆ 1 1 ˆ 0 ˆ 1 1 m m m m m m
Transmitted signal Received signal Pulse
𝑈 4 − 𝑈 4
7
p t
T 2T 3T 4T
t t
ˆ
n t nT t nT
x t m n p t nT m n y t x t
T
y t x t
ˆ m n m n
1 1.5T
2 ˆ 1 1 ˆ 0 ˆ 1 1 1 1 2 m m m m m m m m m m m m
8
p t
T 2T 3T 4T
t t
ˆ
n t nT t nT
x t m n p t nT m n y t x t
y t x t
1
ˆ m n m n
ˆ 1 1 ˆ 0 ˆ 1 1 m m m m m m
Transmitted signal Received signal Pulse
3𝑈 4 − 3𝑈 4
9
p t
T 2T 3T 4T
t t
ˆ
n t nT t nT
x t m n p t nT m n y t x t
T
y t x t
ˆ m n m n
1
10
p t
T 2T 3T 4T
t t
ˆ
n t nT t nT
x t m n p t nT m n y t x t
T
y t x t
ˆ m n m n
1 2T
11
Some pulses displaying intersymbol interference.
[Blahut, 2008, Fig 2.8] t
f
12
[Blahut, 2008, Fig 2.10]
RC
1 , 2 1 1 1 ; 1 cos , 2 2 2 2 1 0, 2 T f T T T P f f f T T T f T
13
[Blahut, 2008, Fig 2.9]
14
1 2 3
0.2 0.4 0.6 0.8 1 Time [T] Roll-off = 0 Roll-off = 0.5 Roll-off = 1
0.5 1
0.2 0.4 0.6 0.8 1 1.2 Frequency [1/T] magnitude Roll-off = 0 Roll-off = 0.5 Roll-off = 1
For fixed nonzero , the tails decay as 1/t3 for large |t|. Although the pulse tails persist for an infinite time, they are eventually small enough so they can be truncated with only negligible perturbations of the zero crossings.
RC 2 2 2 2 2 2
cos ; sinc 4 1 cos sin 4 1 t t T p t t T T t t T T t t T T
15
16
n
x t m n p t nT
0.5 1 1.5 2 2.5 3 3.5
0.5 1 1.5 t
0.5 1 1.5 2 2.5 3 3.5
0.5 1 1.5 2 t
0.5 1 1.5 2 2.5 3 3.5
0.5 1 1.5 t
;0
RC
p t p t
;1
RC
p t p t
;0.5
RC
p t p t
1
Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00
2
Time Vertical lines are used for sampling Horizontal lines are used for quantization 001 000 010 011 100 101 110 111 111 100 100 111 011 100 101 010 000 001 001 100111111100001000010100011001
3
Quantizer rounds off the sample values to the nearest discrete value in a set of q quantum levels. This process introduces permanent errors that appear at the receiver as quantization noise in the reconstructed signal.
4
5
6
Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00
7
An ordered sequence of symbols (or characters) Produced by a discrete information source. The source draws from an alphabet of M 2 different
Ex. English text source: 26 (a to z) + 26 (A to Z) + 10 (0 to 9)
Ex. Thai text source: 44 consonants (พยัญชนะ) + 15 vowel
symbols (สระ) + 4 tone marks (วรรณยุกต์) + …
Ex. A typical computer terminal has an alphabet of
M 90 symbols (the number of character keys multiplied by two to account for the shift key)
8
Text is commonly encoded using ASCII MATLAB automatically represents any string file as a list of
text string (decimal) ASCII representation of the text string binary (base 2) representation of the decimal numbers
9
Unipolar RZ (return-to-zero) Unipolar NRZ (nonreturn-to-zero) Polar RZ Polar NRZ Bipolar NRZ
(successive 1s are represented by pulses with alternating polarity)
Split-phase Manchester (twinned binary) Polar quaternary NRZ.
(Derived by grouping the message bits in blocks of two and using four amplitude levels to prepresent the four possible combinations)
10
Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00
11
50 100 150 200 250 300 350 400 450 500
2 50 100 150 200 250 300 350 400 450 500
10 200
m[0] = 2 m[1] = 2 m[2] = -2
n
x t m n p t nT
y t x t N t
2, 1,0,1,2 m n
50 100 150 200 250 300 350 400 450 500
0.5 1 50 100 150 200 250 300 350 400 450 500
5 10
12
m[0] = 1 m[1] = -1
n
x t m n p t nT
y t x t N t
2 T r n y nT To decode, consider
ˆ decode as 1 ˆ decode as 1 r n m n r n m n m[2] = -2
1,1 m n
50 100 150 200 250 300 350 400 450 500
0.5 1 50 100 150 200 250 300 350 400 450 500
5 10
13
m[0] = 1 m[1] = -1 m[2] = -1
n
x t m n p t nT
y t x t N t
n 1 2 3 4 5 6 7 8 9 𝒏 𝒐 1
1
1 1 1 1
𝒏 𝒐 1 1 1 1
1
1
14
50 100 150 200 250 300 350 400 450 500
0.5 1 50 100 150 200 250 300 350 400 450 500
5 10 50 100 150 200 250 300 350 400 450 500
50 100
Q: Where should we sample?
*
t r t T
r t y d y t h t
* r
h t p T t
x t
y t
r t
Matched filter
50 100 150 200 250 300 350 400 450 500
0.5 1 50 100 150 200 250 300 350 400 450 500
50
15
*
t r t T
r t x d x t h t
* r
h t p T t
x t
r t
when there is no noise
r n y nT T To decode, consider
ˆ decode as 1 ˆ decode as 1 r n m n r n m n
16
50 100 150 200 250 300 350 400 450 500
0.5 1 50 100 150 200 250 300 350 400 450 500
5 10 50 100 150 200 250 300 350 400 450 500
50 100
x t
y t
r t
n 1 2 3 4 5 6 7 8 9 𝒏 𝒐 1
1
1 1 1 1
𝒏 𝒐 1
1
1 1 1 1
17
Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00
18
A digital signal can modulate the amplitude, frequency, or
If the modulating waveform consists of NRZ rectangular
c
Amplitude-shift keying (ASK) Frequency-shift keying (FSK) Phase-shift keying (PSK)
19
DSB mod. w/ Nyquist pulse shaping at baseband OOK(on-off keying) PRK (phase-reversal keying)
[Carlson and Crilly, 2009, Fig 14.1-1]
20
0.05 0.1 0.15 0.2 0.25
0.5 1 Seconds 0.03
cos 2𝜌𝑔
1𝑢
cos 2𝜌𝑔
2𝑢
cos 2𝜌𝑔
5𝑢
cos 2𝜌𝑔
4𝑢
cos 2𝜌𝑔
3𝑢
Rate = R frequency-change per second
Each tone lasts 1/R sec.
1
2
Telegraph network Samuel Morse, 1838 A sequence of on-off tones (or , lights, or clicks)
U V W X Y Z A B C D E F G H I J K L M N O Q P R S T 1 2 3 4 5 6 7 8 9
(wired and wireless)
3
[http://www.wolframalpha.com/input/?i=Morse+Code+%22I+Love+ECS332!%22]
4
Basic form of compression.
U V W X Y Z A B C D E F G H I J K L M N O Q P R S T 1 2 3 4 5 6 7 8 9
5
Relative frequencies
English language
U V W X Y Z A B C D E F G H I J K L M N O Q P R S T 1 2 3 4 5 6 7 8 9
6
0.02 0.04 0.06 0.08 0.1 0.12 0.14 a b c d e f g h i j k l m n o p q r s t u v w x y z
English language
U V W X Y Z A B C D E F G H I J K L M N O Q P R S T 1 2 3 4 5 6 7 8 9
7
8
, , , ,
X
a b c d e
a c a c e c d b c e d a e e d a b b b d b b a a b e b e d c c e d b c e c a a c a a e a c c a a d c d e e a a c a a a b b c a e b b e d b c d e b c a e e d d c d a b c a b c d d e d c e a b a a c a d
Information Source
1 , , , , , 5 0,
X
x a b c d e p x Approximately 20% are letter ‘a’s
9
1,2,3,4
X
1 , 1, 2 1 , 2, 4 1 , 3,4 8 0,
X
x x p x x
Information Source
Approximately 50% are number ‘1’s
2 1 1 2 1 4 1 1 1 1 1 1 4 1 1 2 4 2 2 1 3 1 1 2 3 2 4 1 2 4 2 1 1 2 1 1 3 3 1 1 1 3 4 1 4 1 1 2 4 1 4 1 4 1 2 2 1 4 2 1 4 1 1 1 1 2 1 4 2 4 2 1 1 1 2 1 2 1 3 2 2 1 1 1 1 1 1 2 3 2 2 1 1 2 1 4 2 1 2 1
10
Proposed in Shannon’s “A Mathematical Theory of
The method was attributed to Fano, who later published it as
Should not be confused with
Shannon coding, the coding method used to prove Shannon's
noiseless coding theorem, or with
Shannon–Fano–Elias coding (also known as Elias coding), the
precursor to arithmetic coding.
11
MIT, 1951 Information theory class taught by Professor Fano. Huffman and his classmates were given the choice of
a term paper on the problem of finding the most efficient binary
code.
a final exam.
Huffman, unable to prove any codes were the most efficient, was
Huffman avoided the major flaw of the suboptimal Shannon-Fano
12
pX = [0.5 0.25 0.125 0.125]; % pmf of X SX = [1:length(pX)]; % Source Alphabet [dict,EL] = huffmandict(SX,pX); % Create codebook %% Pretty print the codebook. codebook = dict; for i = 1:length(codebook) codebook{i,2} = num2str(codebook{i,2}); end codebook % Try to encode some random source string n = 5; % Number of source symbols to be generated sourceString = randsrc(1,10,[SX; pX]) % Create data using pX encodedString = huffmanenco(sourceString,dict) % Encode the data [Huffman_Demo_Ex1]
13
codebook = [1] '0' [2] '1 0' [3] '1 1 1' [4] '1 1 0' sourceString = 1 4 4 1 3 1 1 4 3 4 encodedString = 0 1 1 0 1 1 0 0 1 1 1 0 0 1 1 0 1 1 1 1 1 0
14
1 2 3 4 5 6 7 8 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Order of source extension
H X
1 H X n n
1 E X n
15
2 4 6 8 10 12 14 16 18 20 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5
𝑁 = |𝑇𝑌|
2
1 log M
2
log M
X
(no source extension)
1
Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00
2
Telegraph network Samuel Morse, 1838 A sequence of on-off tones (or , lights, or clicks)
U V W X Y Z A B C D E F G H I J K L M N O Q P R S T 1 2 3 4 5 6 7 8 9
(wired and wireless)
3
[http://www.wolframalpha.com/input/?i=Morse+Code+%22I+Love+ECS332!%22]
4
Basic form of compression.
U V W X Y Z A B C D E F G H I J K L M N O Q P R S T 1 2 3 4 5 6 7 8 9
5
Relative frequencies
U V W X Y Z A B C D E F G H I J K L M N O Q P R S T 1 2 3 4 5 6 7 8 9
6
0.02 0.04 0.06 0.08 0.1 0.12 0.14 a b c d e f g h i j k l m n o p q r s t u v w x y z
Relative frequencies
English language
U V W X Y Z A B C D E F G H I J K L M N O Q P R S T 1 2 3 4 5 6 7 8 9
7
8
, , , ,
X
a b c d e
a c a c e c d b c e d a e e d a b b b d b b a a b e b e d c c e d b c e c a a c a a e a c c a a d c d e e a a c a a a b b c a e b b e d b c d e b c a e e d d c d a b c a b c d d e d c e a b a a c a d
Information Source
1 , , , , , 5 0,
X
x a b c d e p x Approximately 20% are letter ‘a’s
9
1,2,3,4
X
1 , 1, 2 1 , 2, 4 1 , 3,4 8 0,
X
x x p x x
Information Source
Approximately 50% are number ‘1’s
2 1 1 2 1 4 1 1 1 1 1 1 4 1 1 2 4 2 2 1 3 1 1 2 3 2 4 1 2 4 2 1 1 2 1 1 3 3 1 1 1 3 4 1 4 1 1 2 4 1 4 1 4 1 2 2 1 4 2 1 4 1 1 1 1 2 1 4 2 4 2 1 1 1 2 1 2 1 3 2 2 1 1 1 1 1 1 2 3 2 2 1 1 2 1 4 2 1 2 1
10
Proposed in Shannon’s “A Mathematical Theory of
The method was attributed to Fano, who later published it as
Should not be confused with
Shannon coding, the coding method used to prove Shannon's
noiseless coding theorem, or with
Shannon–Fano–Elias coding (also known as Elias coding), the
precursor to arithmetic coding.
11
MIT, 1951 Information theory class taught by Professor Fano. Huffman and his classmates were given the choice of
a term paper on the problem of finding the most efficient binary
code.
a final exam.
Huffman, unable to prove any codes were the most efficient, was
about to give up and start studying for the final when he hit upon the idea of using a frequency-sorted binary tree and quickly proved this method the most efficient.
Huffman avoided the major flaw of the suboptimal Shannon-Fano
coding by building the tree from the bottom up instead of from the top down.
1
prapun@siit.tu.ac.th
Office Hours: BKD 3601-7 Monday 14:40-16:00 Friday 14:00-16:00
2
Source Pulse Shaping p(t) baseband PAM signal LPF Receiving Filter hr(t) Decision Device Source Decoder Decoded source symbols Source Encoder m[1], m[2], …
cos 2𝜌𝑔
𝑑𝑢
cos 2𝜌𝑔
𝑑𝑢
N(t)
0>-1 1> 1
0101011110
𝑛 𝑙 𝑞 𝑢 − 𝑙𝑈
𝑙
>=<
0101011110
e.g. Huffman coding
3
Source Pulse Shaping p(t) baseband PAM signal LPF Receiving Filter hr(t) Decision Device Source Decoder Decoded source symbols Source Encoder m[1], m[2], …
cos 2𝜌𝑔
𝑑𝑢
cos 2𝜌𝑔
𝑑𝑢
N(t)
0>-1 1> 1
0101011110
𝑛 𝑙 𝑞 𝑢 − 𝑙𝑈
𝑙
>=<
0101011110
For the analysis in this section, we assume that the modulation and demodulation are performed perfectly (or do not exist).
4
Source Pulse Shaping p(t) baseband PAM signal Receiving Filter hr(t) Decision Device Source Decoder Decoded source symbols Source Encoder m[1], m[2], … N(t)
0>-1 1> 1
0101011110…
𝑛 𝑙 𝑞 𝑢 − 𝑙𝑈
𝑙
>=<
0101011110
These parts are studied in the previous section.
Previously, we have seen two techniques. 1) No receiving filter: ℎ𝑠 𝑢 = 𝑢 2) Matched filter: ℎ𝑠 𝑢 = 𝑞∗ 𝑈 − 𝑢
5
Pulse Shaping p(t) baseband PAM signal Receiving Filter hr(t) Decision Device m[1], m[2], … N(t)
x 𝑢 = 𝑛 𝑙 𝑞 𝑢 − 𝑙𝑈
𝑙
>=<
Previously, we have seen two techniques. 1) No receiving filter: ℎ𝑠 𝑢 = 𝑢 2) Matched filter: ℎ𝑠 𝑢 = 𝑞∗ 𝑈 − 𝑢 Note that we still need to convert -1,1 back to 0,1 r(t) r[n] y(t)
50 100 150 200 250 300 350 400 450 500
0.5 1 50 100 150 200 250 300 350 400 450 500
5 10
6
m[0] = 1 m[1] = -1
n
x t m n p t nT
y t x t N t
2 T r n y nT Technique 1: consider
ˆ decode as 1 ˆ decode as 1 r n m n r n m n m[2] = -2
1,1 m n
10 bits are transmitted
7
50 100 150 200 250 300 350 400 450 500
50 100
*
t r t T
r t y d y t h t
* r
h t p T t
r t
Matched filter
Technique 2:
r n y nT T To decode, consider
ˆ decode as 1 ˆ decode as 1 r n m n r n m n
8
Technique 1 Technique 2
n 1 2 3 4 5 6 7 8 9 𝒏 𝒐 1
1
1 1 1 1
𝒏 𝒐 1 1 1 1
1
1
4 0.4 10 BER
n 1 2 3 4 5 6 7 8 9 𝒏 𝒐 1
1
1 1 1 1
𝒏 𝒐 1
1
1 1 1 1
10 BER
9
Technique 1 Technique 2
Severity of the noise 10 bits simulation
2 3 4 5 6 7 8 9 10 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
BER
[rectPulse_Demo_5_difftPulse_BERCurve.m]
10
Severity of the noise 10,000 bits simulation
2 3 4 5 6 7 8 9 10 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
BER
Technique 1 Technique 2
[rectPulse_Demo_5_difftPulse_BERCurve.m]
50 100 150 200 250 300 350 400 450 500
1 50 100 150 200 250 300 350 400 450 500
10 100
11
n
x t m n p t nT
y t x t N t
50 100 150 200 250 300 350 400 450 500
10
N t
Note that in MATLAB, the signals are all in discrete-time approximating the actual signals in continuous-time. The noise here was generated by running the command 2*randn 500 times. (Actually, we use the command 2*randn(1,500).
12
50 100 150 200 250 300 350 400 450 500
10
1 2 3 4 5 50 100 n Number of occurrences
1 2 3 4 5 5 10 15 n Frequency (%) of occurrences
1 2 3 4 5 Number of samples = 500
N t
2*randn(1,500) generates 500 i.i.d. Gaussian RVs. These random variables have expected value = 0 and std = 2.
13
0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 x 10
4
10
2 4 6 8 5000 10000 n Number of occurrences
2 4 6 8 10 20 n Frequency (%) of occurrences
2 4 6 8 Number of samples = 50000
2*randn(1,5e4) generates 50,000 i.i.d. Gaussian RVs. These random variables have expected value = 0 and std = 2.
14
2
0, N
2
1 2
1 2
x N
f n e
15
Technique 1 Technique 2
Severity of the noise 10 bits simulation
2 3 4 5 6 7 8 9 10 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
BER
[rectPulse_Demo_5_difftPulse_BERCurve.m]
16
Severity of the noise 10,000 bits simulation
2 3 4 5 6 7 8 9 10 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
BER
Technique 1 Technique 2
[rectPulse_Demo_5_difftPulse_BERCurve.m]
17
2 3 4 5 6 7 8 9 10 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
BER
Technique 1 Technique 2 Majority Vote
[rectPulse_Demo_3_Maj.m]