3.1. Chapter3 (2)
3.1. Chapter3 (2)
➢ Chapter Objectives:
• Analog-to-digital signaling (pulse code modulation )
Binary and multilevel digitals signals
• Spectra and bandwidths of digital signals
• Prevention of intersymbol interference
• Time division multiplexing
• Packet transmission
1
INTRODUCTION
➢ This chapter we study how to encode analog waveforms into base
band digital signals. Digital signal is popular because of the low
cost and flexibility.
➢ Main goals:
• To study how analog waveforms can be converted to digital
waveforms, Pulse Code Modulation.
• To learn how to compute the spectrum for digital signals.
• Examine how the filtering of pulse signals affects our ability to
recover the digital information. Intersymbol interference (ISI).
• To study how we can multiplex (combine) data from several
digital bit streams into one high-speed digital stream for
transmission over a digital system Time-division Multiplexing.
2
PULSE AMPLITUDE MODULATION
➢ Pulse Amplitude Modulation (PAM) is used to describe the
conversion of the analog signal to a pulse-type signal in which the
amplitude of the pulse denotes the analog information.
3
Natural Sampling (Gating)
4
Natural Sampling (Gating)
w(t)
s(t)
ws(t) =w(t)s(t)
5
Generating Natural Sampling
➢ The PAM wave form with natural sampling can be generated using a
CMOS circuit consisting of a clock and analog switch as shown.
6
Spectrum of Natural Sampling
sin( nd )
Ws ( f ) = F[ws (t )] = cnW ( f − nf s ) = d
n =−
n =− nd
W ( f − nf s )
sin( nd )
Ws ( f ) = d
n =− nd
W ( f − nf s )
sin( nd )
d
nd
7
Recovering Naturally Sampled PAM
➢ At the receiver, the original analog waveform, w(t), can be recovered
from the PAM signal, ws(t), by passing the PAM signal through a low-
pass filter where the cutoff frequency is: B <fcutoff < fs -B
➢ If the analog signal is under sampled fs < 2B, the effect of spectral
overlapping is called Aliasing. This results in a recovered analog
signal that is distorted compared to the original waveform.
LPF Filter
B <fcutoff < fs -B
8
Demodulation of PAM Signal
➢ The analog waveform may be recovered from the PAM signal
by using product detection,
9
Instantaneous Sampling (Flat-Top PAM)
• This type of PAM signal
consists of instantaneous
samples.
10
Instantaneous Sampling (Flat-Top PAM)
➢ DEFINITION: If w(t) is an analog waveform bandlimited to B
Hertz, the instantaneous sampled PAM signal is given by
ws (t ) = w(kTs )h(t − kTs ) = h(t ) w(kTs ) (t − kTs ) = h(t ) w(t ) (t − kTs )
k =− k =− k =−
– Where h(t) denotes the sampling-pulse shape and, for flat-top sampling,
the pulse shape is,
sin f
H ( f ) = h(t ) =
f
11
The spectrum of the flat-top PAM
➢ Analog signal maybe recovered from the flat-top PAM signal by the use of a LPF.
LPF Response
Note that the recovered signal
has some distortions due to the
curvature of the H(f).
Distortions can be removed by
using a LPF having a response
1/H(f).
12
Some notes on PAM
• The flat-top PAM signal could be generated by using a sample-
and-hold type electronic circuit.
• There is some high frequency loss in the recovered analog
waveform due to filtering effect H(f) caused by the flat top pulse
shape.
• This can be compensated (Equalized) at the receiver by making the
transfer function of the LPF to 1/H(f)
• This is a very common practice called “EQUALIZATION”
• The pulse width τ is called the APERTURE since τ/Ts determines
the gain of the recovered analog signal
➢ Disadvantages of PAM
• PAM requires a very larger bandwidth than that of the original signal;
• The noise performance of the PAM system is not satisfying.
13
Chapter 3:
Pulse Code Modulation
➢ Pulse Code Modulation
➢ Quantizing
➢ Encoding
➢ Analogue to Digital Conversion
➢ Bandwidth of PCM Signals
14
PULSE CODE MODULATION (PCM)
➢ DEFINITION: Pulse code modulation (PCM) is essentially
analog-to-digital conversion of a special type where the
information contained in the instantaneous samples of an analog
signal is represented by digital words in a serial bit stream.
15
Sampling, Quantizing, and Encoding
➢ The PCM signal is generated by carrying out three basic operations:
1. Sampling
2. Quantizing
3. Encoding
1. Sampling operation generates a flat-top PAM signal.
2. Quantizing operation approximates the analog values by using a
finite number of levels. This operation is considered in 3 steps
a) Uniform Quantizer
b) Quantization Error
c) Quantized PAM signal output
3. PCM signal is obtained from the quantized PAM signal by encoding
each quantized sample value into a digital word.
16
Analog to Digital Conversion
➢ The Analog-to-digital Converter (ADC)
performs three functions:
Analog – Sampling
Input • Makes the signal discrete in time.
Signal
• If the analog input has a bandwidth
Sample
of W Hz, then the minimum sample
frequency such that the signal can be
reconstructed without distortion.
ADC – Quantization
Quantize • Makes the signal discrete in
111
110
101
amplitude.
100
011
• Round off to one of q discrete levels.
– Encode
010
001
Encode 000
18
Illustration of the Quantization Error
19
Uniform Quantization
Dynamic Range: • Most ADC’s use uniform
(-8, 8)
quantizers.
Output sample
• The quantization levels of a
7
XQ
5
uniform quantizer are
3
1
equally spaced apart.
-8 -6 -4 -2 -1 2 4 6 8
• Uniform quantizers are
Input sample X
-3
optimal when the input
-5 distribution is uniform.
-7 When all values within the
Quantization Characteristic Dynamic Range of the
Example: Uniform =3 bit quantizer quantizer are equally likely.
q=8 and XQ = {1,3,5,7}
20
Quantization Example
Analogue signal
Sampling TIMING
Quantization levels.
Quantized to 5-levels
Quantization levels
Quantized 10-levels
21
PCM encoding example
M=8
22
Encoding
• The output of the quantizer is one of M possible signal levels.
– If we want to use a binary transmission system, then we need to map
each quantized sample into an n bit binary word.
M = 2n , n = log 2 ( M )
• Encoding is the process of representing each quantized sample
by an bit code word.
– The mapping is one-to-one so there is no distortion introduced by
encoding.
– Some mappings are better than others.
• A Gray code gives the best end-to-end performance.
• The weakness of Gray codes is poor performance when the sign bit
(MSB) is received in error.
23
Gray Codes
• With gray codes adjacent samples differ only in one bit position.
• Example (3 bit quantization):
XQ Natural coding Gray Coding
+7 111 110
+5 110 111
+3 101 101
+1 100 100
-1 011 000
-3 010 001
-5 001 011
-7 000 010
• With this gray code, a single bit error will result in an amplitude
error of only 2.
– Unless the MSB is in error.
24
Waveforms in a PCM system for M=8
M=8
M = 2n n = log 2 ( M )
M is the number of Quantization levels
(c) Error Signal n is the number of bits per sample
26
Practical PCM Circuits
• Three popular techniques are used to implement the
analog-to-digital converter (ADC) encoding
operation:
1. The counting or ramp, ( Maxim ICL7126 ADC)
2. Serial or successive approximation, (AD 570)
3. Parallel or flash encoders. ( CA3318)
• The objective of these circuits is to generate the
PCM word.
• Parallel digital output obtained (from one of the
above techniques) needs to be serialized before
sending over a 2-wire channel
• This is accomplished by parallel-to-serial
converters [Serial Input-Output (SIO) chip]
• UART,USRT and USART are examples for SIO’s
27
Bandwidth of PCM Signals
• The spectrum of the PCM signal is not directly related to the spectrum of the
input signal.
• The bandwidth of (serial) binary PCM waveforms depends on the bit rate R
and the waveform pulse shape used to represent the data.
• The Bit Rate R is
R=nfs
Where n is the number of bits in the PCM word (M=2n) and fs is the sampling
rate.
• For no aliasing case (fs≥ 2B), the MINIMUM Bandwidth of PCM Bpcm(Min) is:
The Minimum Bandwidth of nfs//2 is obtained only when sin(x)/x pulse is used
to generate the PCM waveform.
Bpcm = R = nfs
28
Chapter 3:
PCM Noise and Companding
➢ Quantization Noise
➢ Signal to Noise Ratio
➢ PCM Telephone System
➢ Nonuniform Quantization
➢ Companding
29
Quantization Noise
➢ The process of quantization can be interpreted as an additive noise
process.
Signal Quantized Signal
X XQ
Quantization Noise
nQ
Average Power{ X }
( SNR)Q =
Average Power{nQ }
30
Effects of Noise on PCM
➢ Two main effects produce the noise or distortion in the PCM output:
– Quantizing noise that is caused by the M-step quantizer at the PCM transmitter.
– Bit errors in the recovered PCM signal, caused by channel noise and improper filtering.
• If the input analog signal is band limited and sampled fast enough so that the
aliasing noise on the recovered signal is negligible, the ratio of the recovered analog
peak signal power to the total average noise power is:
• The ratio of the average signal power to the average noise power is
31
Effects of Quantizing Noise
• If Pe is negligible, there are no bit errors resulting from channel noise and no ISI, the
Peak SNR resulting from only quantizing error is:
Where, M = 2n
α = 4.77 for peak SNR
α = 0 for average SNR
32
Determining number of bits at
the output of PCM and Signal
to Noise Ratio due to
𝑆
Quantization Error
𝑁 𝑄
Quantization Error
As mentioned before, Quantization error
is the difference between the Analog
signal and the Quantized signal.
The number of bits which represent each
sample is directly related to the
Quantization Error.
Vpp
The relationship is given by:
Peak to peak
50 amplitude
𝑛 ≥ 3,32 log10
𝑃
P: PCM accuracy which is given as a
percentage. It is the ratio of peak to peak
quantization error to the peak to peak Quantization Error
amplitude of the analog signal.
Number of Quantization Levels: M=2n
Amplitude range for a level:
𝑉𝑃𝑃
∆=
𝑀
Example
What should be the number of Quantization
levels for the following signal if the PCM
accuracy shall not exceed %0.5?
50
𝑛 ≥ 3,32 log10
𝑃
50 50
𝑛𝑚𝑖𝑛 = 3,32 log10 = 3,32 log10 = 6.64
𝑃 0,5
• This 64-kbit/s signal is called a DS-0 signal (digital signal, type zero).
• The minimum absolute bandwidth of the binary PCM signal is
R nf s
BPCM =
2 2
This B is for a sinx/x type pulse sampling
37
DESIGN OF A PCM SIGNAL FOR TELEPHONE SYSTEMS
• If we use a rectangular pulse for sampling the first null bandwidth is given by
• We require a bandwidth of 64kHz to transmit this digital voice PCM signal, whereas the
bandwidth of the original analog voice signal was, at most, 4kHz.
Note:
1. Coding with parity bits does NOT affect the quantizing noise,
2. However coding with parity bits will improve errors caused by channel
or ISI, which will be included in Pe ( assumed to be 0).
38
PCM Example:
Nonuniform Quantization
➢ Many signals such as speech have a nonuniform distribution.
– The amplitude is more likely to be close to zero than to be at higher levels.
➢ Nonuniform quantizers have unequally spaced levels
– The spacing can be chosen to optimize the SNR for a particular type of signal.
Output sample
XQ 6
-8 -6 -4 -2 2 4 6 8
-2
Input sample
X
-4
-6
40
Companding
• Nonuniform quantizers are difficult to make and expensive.
• An alternative is to first pass the speech signal through a
nonlinearity before quantizing with a uniform quantizer.
• The nonlinearity causes the signal amplitude to be
Compressed.
– The input to the quantizer will have a more uniform
distribution.
• At the receiver, the signal is Expanded by an inverse to the
nonlinearity.
• The process of compressing and expanding is called
Companding.
41
-Law Companding
0 1
Input |x(t)|
42
Non Uniform quantizing
• Voice signals are more likely to have amplitudes near zero than at extreme peaks.
• For such signals with non-uniform amplitude distribution quantizing noise will be
higher for amplitude values near zero.
• A technique to increase amplitudes near zero is called Companding.
x x’ x’ y
Q(.)
C(.)
Compressor Uniform Quantizer
43
Example: -law Companding
1
0.5
x[n]=speech /song/ 0
-0.5
-1
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
0.5
y[n]=C(x[n]) 0
-0.5
Companded Signal -1
0 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000
0.5
Close View of the Signal
Segment of x[n] 0
-0.5
-1
2200 2300 2400 2500 2600 2700 2800 2900 3000
0.5
Segment of y[n] 0
-1
2200 2300 2400 2500 2600 2700 2800 2900 3000
44
A-law and −law Companding
• These two are standard companding methods.
• u-Law is used in North America and Japan
• A-Law is used elsewhere to compress digital telephone signals
45
SNR of Compander
• The output SNR is a function of input signal level for uniform quantizing.
• But it is relatively insensitive for input level for a compander
46
SNR Performance of Compander
• The output SNR is a function of input signal level for uniform quantizing.
• But it is relatively insensitive for input level for a compander.
47
V.90 56-Kbps PCM Computer modem
• The V.90 PC Modem transmits data at 56kb/s from a PC
via an analog signal on a dial-up telephone line.
• A μ law compander is used in quantization with a value
for μ of 255.
• The modem clock is synchronized to the 8-ksample/ sec
clock of the telephone company.
• 7 bits of the 8 bit PCM are used to get a data rate of
56kb/s ( Frequencies below 300Hz are omitted to get rid
of the power line noise in harmonics of 60Hz).
• SNR of the line should be at least 52dB to operate on
56kbps.
• If SNR is below 52dB the modem will fallback to lower
speeds ( 33.3 kbps, 28.8kbps or 24kbps).
48
Digital Signaling
➢ Digital Signaling
➢ Vector Representation
➢ Bandwidth Estimation
➢ Binary Signaling
➢ Multilevel Signaling
49
Digital Signaling
➢ Mathematical Representation of the waveform: Voltage (or current) waveform
for digital signals:
N
w ( t ) = wkk ( t ) 0 t T0
k =1
50
Digital Signaling
➢ Baud (Symbol Rate) :
D = N/T0 symbols/sec ; N- number of dimensions used in T0 sec.
➢ Bit Rate :
R = n/T0 bits/sec ; n- number of data bits sent in T0 sec.
51
Vector Representation
➢ Orthogonal function space corresponds to orthogonal vector
space :
N
w ( t ) = wkk ( t ) 0 t T0 Orthogonal Function Space
k =1
N
52
Vector Representation of a Binary Signal
➢ Examine the representation in next slide for the waveform of a 3-bit (binary)
signal. This signal can be directly represented by,
N =3
1 N =3 1
s ( t ) = d j p t − j − T = d j p j (t ) p j (t ) = p t − j − T
j =1 2 j =1 2
The Pulse Shape p(t ), p (t ) is not normalized
j
54
Bandwidth Estimation
➢ The lower bound for the bandwidth of the waveform w(t) is given by the Dimensionality
Theorem
N 1 sinx N 1
B = D (Hertz) Lower Bound for k (t) → , B = = D
2T0 2 x 2T0 2
➢ Binary Signaling:
N
Waveform: w(t ) = wk k (t ) 0 t T0 wk takes only BINARY values
k =1
n N
Bit Rate R = = 1 Kbits/s Baud Rate (Symbol Rate) D = = 1 Kbaud
T0 T0
Same as BINARY Signaling
1
The Lower Bound : B = D = 500 Hz
2
1
The actual Null Bandwidth: B = = D = 1000 Hz
Ts
56
Binary Signaling
n N
Bit Rate R = = 1 Kbits/s Baud Rate (Symbol Rate) D = = 1 Kbaud
T0 T0
Same as BINARY Signaling
1
The ABSOLUTE Bandwidth: B = = 500 Hz LOWER BOUND bandwidth
2Ts
58
Multilevel Signaling
N
Lower bound BW: B = For N=8 pulses, T0=8 ms => B=500Hz.
2T0
59
Multilevel Signaling (Example)
M=256-message source ; L=4; T0=8 ms
n
Bit rate : R = =1 k bits/second
T0
Different
N 1
Baud ( symbol rate): D = = = 0.5 k baud
T0 Ts
B=1/Ts=D=500 Hz
B=N/2T0=250Hz
• Note that now the Baud rate is reduced by l times the Bit rate R (D=R/l).
• Thus the bandwidth required is reduced by l times.
Ts: Symbol Duration L: Number of M ary levels
Tb: Bit Duration l: Bits per Symbol
L=2l D=1/Ts=1/lTb=R/l 62
Binary-to-multilevel Polar NRZ Signal Conversion
63
Chapter 3:
Line Codes and Their Spectra
➢ Types of Line Codes
➢ Comparison of Line Codes
➢ PSD of Line Codes
64
Line Codes in PCM
• The output of an ADC can be transmitted over a baseband channel.
• The digital information must first be converted into a physical signal.
• The physical signal is called a line code. Line coders use the terminology mark
to mean binary one and space to mean binary zero.
Analog
Input
Signal
Sample
X
Quantize ADC
XQ
Encode
Xk
Line
Code
x(t) PCM signal
65
Line codes
1 1 0 1 0 0 1 BINARY DATA
(a) Punched Tape Mark Mark space Mark space space Mark
(hole) (hole) (hole) (hole)
Volts
A
0
(b) Unipolar NRZ
Tb Time
0
(d) Unipolar RZ
A
(e) Bipolar RZ 0
-A
A
(f) Manchester NRZ 0
-A
– Self-synchronization.
• The ability to recover timing from the signal itself.
• Long series of ones and zeros could cause a problem.
67
Line Coder
Digital
Data a k
Line Coder
Physical x(t ) =
Waveform
k =−
ak p (t − kTb )
69
Unipolar NRZ Line Code
• The unipolar nonreturn-to-zero line code is defined by the
unipolar mapping:
+ A when X k = 1
ak =
0 when X k = 0
– where Xk is the kth data bit.
– In addition, the pulse shape for unipolar NRZ is:
t
p(t ) = NRZ pulse shape
Tb
– Where Tb is the bit period.
Hard to recover symbol timing
when long string of 0s or 1s.
Note the DC component
This means wasted power!
1 0 1 1 0 1
A
+ A when X k = 1
ak =
0 when X k = 0
t
p(t ) = RZ pulse shape
Tb / 2
Long strings of 1s no longer a problem.
However strings of 0s still problem.
Pulse of half the duration of NRZ
requires twice the bandwidth!
1 0 1 1 0 1
A
71
Polar Line Codes
• Polar line codes use the antipodal mapping:
+ A when X k = 1
ak =
− A when X k = 0
– Polar NRZ uses NRZ pulse shape.
– Polar RZ uses RZ pulse shape.
No DC component,
so more energy efficient.
1 0 1 1 0 1
A
Polar NRZ
Now we can handle
long strings of 0s, too.
A
Polar RZ
−A 72
Manchester Line Codes
• Manchester line codes use the antipodal mapping and
the following split-phase pulse shape:
p(t )
t + Tb / 4 t − Tb / 4
p(t ) = −
b T / 2 b T / 2
1 0 1 1 0 1
73
Bipolar Line Codes
• With bipolar line codes a space is mapped to zero and a mark
is alternately mapped to -A and +A:
0 when X k = 0
ak = − A when X k = 1 and last mark → + A
+ A when X k = 1 and last mark → − A
Bipolar (RZ)
−A
74
Comparison of Line Codes
• Self-synchronization:
– Manchester codes have built in timing information because
they always have a zero crossing in the center of the pulse.
– Polar RZ codes tend to be good because the signal level
always goes to zero for the second half of the pulse.
– NRZ signals are not good for self-synchronization.
• Error probability:
– Polar codes perform better (are more energy efficient) than
Unipolar or Bipolar codes.
• Channel characteristics:
– We need to find the PSD of the line codes to answer this ...
75
Power Spectra for Binary Line Codes
➢ A digital signal is represented by
t
s(t ) = a n f (t = nTs ) ; f (t ) = for unipolar NRZ
n =− Ts
➢ PSD depends on
(1) The pulse shape used
(2) Statistical properties of data expressed by the
autocorrelation function
76
Power Spectra for Binary Line Codes
➢ PSD of a digital signal can be calculated using the
autocorrelation function:
2
−
F( f )
Ps ( f ) =
Ts
R
k =
( k ) e − j 2 kfTs
Where { f (t )} = F ( f )
I
R(k ) = (an an + k )i Pi The autocorrelation function of data
i =1
an and an + k are levels of the data pulses at the nth and (n+k)th symbol positions
Pi Probability of having the ith an an + k product
77
PSD for Polar NRZ Signaling
Possible levels for the a’s : +A and -A
I
R(k ) = (a a ) P a and a are the level of the pulses at the nth and ( n + k )th symbols
n n+k i i n n+k
i =1
2
1 1
R(0) = (an an )i Pi = A2 + (− A) 2 = A2
i =1 2 2
4
For k 0, R(k ) = (an an + k ) Pi = A21/ 4 + (− A)( A)1/ 4 + ( A)( − A)1/ 4 + ( − A) 21/ 4 = 0
i =1
A2 , k = 0
R polar (k ) =
0, k 0
F( f )
2
sin fTb
2 kfTs
f (t ) = (t / Tb ) F ( f ) = Tb
fTb
Ps ( f ) =
Ts
k =−
R (k ) e
2
sin fTb
PPolar NRZ ( f ) = A Tb
2
fTb
78
PSD for line codes
Unipolar NRZ
2
A2Tb sin fTb 1
PUni. NRZ ( f ) = 1 + ( f )
4 fTb Tb
Polar NRZ
2
sin fTb
PPolar NRZ ( f ) = A2Tb
fTb
➢ Differential Encoding
➢ Eye Patterns
➢ Regenerative Receiver
➢ Bit Synchronizer
➢ Binary to Mary Conversion
80
Differential Coding System
➢ Differential encoding removes the problem of Unintentional Signal Inversion.
➢ Polarity of the differentially encoded signal may be inverted without affecting the decoded
signal.
Modulo-2 addition
Exclusive OR
I1 I2 Out
0 0 0
0 1 1
1 0 1
1 1 0
en = d n en −1
d n = en en −1
Represents Modulo-2 adder (XOR)
81
Example of Differential Coding
Encoding en = d n en−1
Input sequence dn 1 1 0 1 0 0 1
Encoded sequence en 1 0 1 1 0 0 0 1
Reference digit
~ ~ ~
Decoding (with correct channel polarity) d n = en en−1
Receiver sequence en 1 0 1 1 0 0 0 1
(Correct polarity)
Decoded sequence dn 1 1 0 1 0 0 1
Decoded sequence dn 1 1 0 1 0 0 1
82
Eye patterns
➢ The effects of channel filtering and channel noise can be seen by observing the received line
code on an oscilloscope.
Received Line
Code
83
Regenerative Repeater
➢ Regenerate a noise-free digital signal. Amplify and clean-up the signal periodically
85
Square-law Bit Synchronizer for NRZ Signals
86
Binary-to-multilevel polar NRZ Signal Conversion
➢ Binary to multilevel conversion is used to reduce the bandwidth required by the binary
signaling.
• Multiple bits (l number of bits) are converted into words having SYMBOL durations
Ts=lTb where the Symbol Rate or the BAUD Rate D=1/Ts=1/lTb.
• The symbols are converted to a L level (L=2l ) multilevel signal using a l-bit DAC.
• Note that now the Baud rate is reduced by l times the Bit rate R (D=R/l).
• Thus the bandwidth required is reduced by l times.
Ts: Symbol Duration L: Number of M ary levels
Tb: Bit Duration l: Bits per Symbol
L=2l D=1/Ts=1/lTb=R/l Bnull=R/l 87
Power Spectra for Multilevel Polar NRZ Signals
88
Spectral Efficiency
➢ The Spectral efficiency of a digital signal is given by, where R is the data rate and
B is the bandwidth required.
=
R ( Bit s )
B Hz
• If limited BW is desired, then use a signaling technique that has high spectral efficiency.
• Maximum spectral efficiency (which is limited by channel noise) is given by the
Shannon’s Channel Capacity formula:
C S
max = = log 2 1 +
B N
Spectral efficiency for multilevel signaling is =l
( bit s )
Hz
89
PSD of a multilevel polar NRZ waveform
I
R (k ) = (an an + k )i Pi
i =1
For k = 0
8 1
R (0) = (a n )i Pi = 21 where Pi =
2 for all of the eight possible values.
8
i =1
For k 0, R(k ) = 0.
90