Chapter 6
Sampling & PCM
Analog to Digital Conversion (A/D)
In converting an analog signal to an equivalent
sequence of “0’s” and “1’s”, we go through three
processes:
Sampling:
o converting continuous–time analog signals to discrete–time
analog signals.
Quantization
o converting discrete–time analog signals to discrete–time
digital signals (finite set of amplitude levels).
Coding
o Map each amplitude level to a binary sequence.
DC By:
Milind S Patil
[1] Sampling: Mathematical Representation
One sample of g(t) can be obtained from
g s (t ) g (t ) (t t 0 ) g (t 0 ) (t t 0 )
If we want to sample g(t) periodically every Ts sec then we
can repeat this process periodically
g (t ) g (t ) (t nT s )
n
g (t ) (t nT s )
n
g (nT s ) (t nT s ).
n
DC By:
Milind S Patil
Sampling: Time-Domain Plot
g(t)
s s s s s s s s s s s s
g(t)
s s s s s s s s s s s s
DC By:
Milind S Patil
Sampling: Frequency-Domain Analysis (1/2)
2
g (t ) g (t ) Ts (t ) T (t ) (t nT s )
s
s
Ts
n
a0 a1 cos(s t ) a2 cos(2s t ) a3 cos(3s t )
Ts Ts b1 sin(s t ) b 2 sin(2s t ) b3 sin(3s t )
2 2
1 1 1
a0
Ts T (t )dt
T
s
Ts (t )dt
Ts Ts
s
2 2
Ts Ts Ts
2 2 2
an0 2 2 2 2
Ts T (t ) cos(s t )dt
T
s
Ts (t ) cos(st )dt
Ts Ts (t ) cos(0)dt
Ts Ts
s
2 2 2
Ts Ts Ts
2 2 2
2 2 2
bn0
Ts T (t ) sin(s t )dt
Ts
s
Ts (t ) sin(st )dt
Ts Ts (t ) sin(0)dt 0
Ts
2 2 2
DC By:
Milind S Patil
Sampling: Frequency-Domain Analysis (2/2)
g (t ) g (t ) (t nT s )
n
1 2 2 2
g (t ) g (t ) cos(s t ) g (t ) cos(2s t ) g (t ) cos(3s t ) .
Ts Ts Ts Ts
1 1 1
G ( ) G ( ) G ( s ) G ( s ) G ( 2s ) G ( 2s )
Ts Ts Ts
1
G ( 3s ) G ( 3s ) .
Ts
1
Ts
G ( n )
n
s
DC By:
Milind S Patil
Spectrum of Sampled Function
G()
s s s 2B +2B s s s
G()
A/Ts
... ...
s s s–2B s s+2B 2B +2B s–2B s s+2B s s
DC By:
Milind S Patil
Recovering the Continuous-Time
Signal
Magnitude of LPF should be Ts to cancel G() LPF for reconstructing the origianl
the scaling factor caused by sampling Ts signal from the sampled signal
A/Ts
... ...
s s s–2B s s+2B 2B +2B s–2B s s+2B s s
Reconstructed Signal s > 2(2B) No interference between Images
A/Ts
s s s 2B +2B s s s
DC By:
Milind S Patil
Sampling Theorem
A baseband signal whose spectrum is band-
limited to B Hz can be reconstructed exactly
(without any error) from its samples taken
uniformly at a rate fs ≥ 2B.
fs ≥ 2B is called Nyquist Criterion of sampling.
fs = 2B is called the Nyquist rate of sampling.
Does Sampling Theorem Make Sense?
DC By:
Milind S Patil
Reconstructing the Signal: Time-Domain Prespective
ω g (t ) G ( ) g (t ) G ( )
Ts rect sinc s t LPF
s 2 H() = Ts rect(f/fs)
ω
G ( ) G ( ) Ts rect
s
t g (t ) (t nTs ) sinc s
g (t ) g (t ) sinc s t
2 n 2
t
g (t ) g (nTs ) (t nTs ) sinc
n Ts
t nTs
g (t ) g (nTs ) sinc
n Ts
DC By:
Milind S Patil
Graphical Illustration
DC By:
Milind S Patil
Aliasing
G() LPF for reconstructing the origianl
Ts signal from the sampled signal
A/Ts
... ...
s s s s s s s s
Reconstructed Signal s < 2(2B) Interference between images
will occur
A/Ts
Damaged part of the signal
s s s s s s s s
Sampling a signal at a rate less that the Nyquist rate results in
Aliasing.
In aliasing, the higher frequency components take the identity of
lower frequencies.
Real life Example: Sampling a rotating wheel.
DC By:
Milind S Patil
g1(t)
Time Division Multiplexing
(TDM) Ts
Multiplexing: The process of g2(t)
sending two or more signals
together
FDM: Sending them together at the Ts
same time over different bands g3(t)
using carrier modulation (AM &
FM broadcasting)
TDM: Sending them together over
the same band by sampling the Ts
signals and sending the samples at gTDM(t)
different time instants
(interleaved).
DC By: Ts
Milind S Patil Ts/3
How to Transmit the Samples?
Analog Pulse Modulation:
Use the samples to modulate a carrier of pulses
Pulse Amplitude Modulation (PAM)
Pulse Width Modulation (PWM)
Pulse Position Modulation (PPM)
Pulse Code Modulation (PCM)
Quantization of samples
Coding
DC By:
Milind S Patil
Pulse Amplitude Modulation (PAM)
gPAM(t)
Ts
DC By:
Milind S Patil
Pulse Width Modulation (PWM)
gPWM(t)
Ts
DC By:
Milind S Patil
Pulse Position Modulation (PPM)
gPPM(t)
Ts
DC By:
Milind S Patil
[2] Quantization
Analog samples with an amplitude that may take value
in a specific range are converted to a digital samples
with an amplitude that takes one of a specific pre–
defined set of values.
The range of possible values of the analog samples is
divide into L levels. L is usually taken to be a power of
2 (L = 2n).
The center value of each level is assigned to any
sample that falls in that quantization interval.
For almost all samples, the quantized samples will
differ from the original samples by a small amount,
called the quantization error.
DC By:
Milind S Patil
Quantization: Illustration
A quantization interval Corresponding quantization value
mp
v
2m p
L=2 n v
L
L levels t
0
n bits 0 Ts 2Ts 3Ts 4Ts 5Ts
–mp
Quantizer Input Samples x
Quantizer Output Samples x q
DC By:
Milind S Patil
Input-Output Characteristics of Quantizer
Quantizer
Output xq
x
xq
v/2
v/2
v/2
v/2
Quantizer
v v v v v/2 v v v v Input x
v/2
v/2
v/2
mp
DC By:
Milind S Patil
Quantization Error
Quantization Error q x x q
v/2
Quantizer
v/2 Input x
v v v v v v v v
mp
DC By:
Milind S Patil
[3] Coding
PCM Code
A quantization interval Corresponding quantization value n bits/sample
mp
111
v 110
101
n
L=2
L levels 100
0
n bits 0 Ts 2Ts 3Ts 4Ts 5Ts
011
010
001
000
–mp
Quantizer Input Samples x
001 011 100 110 110 110 100 010 010 010 100 101 101
Quantizer Output Samples x q
DC By:
Milind S Patil
We want to scan and send a black-and-white image of
height 11 inches and width 8.5 inches (Letter size paper).
The resolution of the scanner is 600×600 dots per inch
square. The picture will be quantized using 256 levels.
Find the size of the scanned image and the time it takes
to transmit the image using a modem of speed 56 kbps.
Size of image =
11(in)×8.5(in)×600×600(samples/in2)×8bits/sample
= 269280000 bits = 269 Mbits
Time to transmit = 269280000 / 56,000 = 4808 sec = 80
min
DC By:
Milind S Patil
How would 0’s and 1’s be transmitted?
The simplest form is to send a +ve pulse for a
“1” and a –ve pulse for a “0”.
Transmitting the message g(t) would translate
into sending a a long sequence of +ve and –ve
pulses.
DC By:
Milind S Patil
Advantages of Digital Communications
Rugged: Can withstand channel noise and
distortion much better.
Use of repeaters (travels as far as needed).
Use of TDM
Can be encrypted (Security and Privacy)
Can be encoded for error correction (reliability).
Easy to process, store and search.
DC By:
Milind S Patil
Nyquist Theorem for Transmission
Note that the larger the transmission rate
(pulses/sec) the narrower the pulse, the wider
its spectrum, the higher the channel bandwidth
required for transmission.
The minimum theoretical bandwidth
required to transmit R pulses/sec is R/2 Hz.
(To be demonstrated later)
DC By:
Milind S Patil
A signal m(t) band-limited to 3 kHz is sampled
at a rate 33.33% higher than the Nyquist rate,
quantized and coded. The maximum acceptable
quantization error is 0.5% of mp.
Find the minimum bandwidth required for
transmission? How is that compared to SSB?
Ans: 32 kHz.
DC By:
Milind S Patil
TDM Revisited
Time axis is divided into frames. Frame rate is
determined by sampling rate.
Each frame is divided into slots.
Each user is assigned a slot (periodically in each
frame).
A user uses the full bandwidth during his slot.
The transmission rate of the multiplexed channel is the
sum of the rates of individual channels plus the control
bits.
Can be used with digital signals only.
DC By:
Milind S Patil
TDM in Telephony (T1 & E1 Systems)
T1:
Introduced in 1960s
North America and Japan
1 1
2 MUX MUX 2
...
22
...
23 24 b 1 2 . . . 24 b
24 frame 24
E1 system (Europe): 30 voice channels + 2 syn channels
DC By:
Milind S Patil
T1 System
Multiplexes 24 voice channels
Voice bandwidth is approximately 3.4 kHz
Nyquist rate of sampling = 6800 samples/sec
Actual sampling rate = 8000 samples/sec
8 bits/sample (256 levels)
Frame duration = 1/8000 = 125 sec
Number of bits/frame = 24×8+1=193
Bit duration = 0.647 sec
Transmission rate:
(248+1) bits/frame 8000 frames/sec = 1.544 Mbps
DC By:
Milind S Patil
Quantization Noise
The quantization error is assumed to be uniformly
distributed over the range (-).
v / 2 v / 2
1 1 q 3
Pq q 2
dq
v / 2
v v 3 q v / 2
1
1
3 3 3 3
v / 2 v / 2 v v
v 3 3 v 24 24
/L
2
v
2
2m p m p2
Pq
12 12 3L 2
DC By:
Milind S Patil
Signal-to-Quantization-Noise Ratio
Signal Power Ps
SNR
Noise Power Pq
3L 2
2 Ps .
mp
3L 2 3
SNR dB 10 log10 2 Ps 10 log10 2 Ps
mp mp
10 log10 2
2n
3
10 log10 2 Ps 20n log10 2
m p
6n
6n dB.
DC By:
Milind S Patil
SNR-Bandwidth Exchange
More bits/sample for the same message results in more
quantization levels, less quantization step, less
quantization noise, higher SNR.
On the other hand, more bits/sample results in
bandwidth expansion
Ps
SNR 3 (2) 2 n ; ( SNR ) dB 6n
mp
One added bit results in multiplying SNR by a factor of
4 (6 dB), but multiplying the transmission bandwidth
by a factor of (n+1)/n
DC By:
Milind S Patil
A signal of bandwidth 4 kHz is samples at Nyquist rate
and transmitted using PCM with uniform quantization.
If the number of quantization levels L is increased
from 64 to 256, find the change in SNR and
transmission bandwidth.
DC By:
Milind S Patil
Non-Uniform Quantization
There is a huge variation in voice signal level
from user to user, and for the same use from
call to call as well as within the call (sometimes
of the order of 1000:1)
Uniform quantization provides same degree of
resolution for low and high values.
Designing the step size for the low values
results in too many levels, and designing them
for the high values destroys the low values.
DC By:
Milind S Patil
Non-Uniform Quantizers
DC By:
Milind S Patil
Compressors and Expanders
It is practically more feasible to compress the signal
logarithmically then apply it to a uniform quantizer.
A reciprocal process takes place at the receiver by an
expander.
The compressor/expander system is called compander.
There are two standard laws for companders, the -law
(North America and Japan) and the A-law (Europe and
rest of the world).
DC By:
Milind S Patil
-Law and A-Law Characteristics
DC By:
Milind S Patil
Differential Pulse Code Modulation
(DPCM)
In PCM we quantize the analog samples. Since the signal
varies over a large range of amplitudes, we generally need a
large number of levels (an hence bits).
Note that neighboring samples are “close” to each other in
values.
If we instead quantize the difference between successive
samples, we will be dealing with much smaller range of
values.
This will results in either:
Using less number of bits for the same SNR.
Obtaining smaller SNR for the same number of bits.
Quantization noise will be reduced by a factor of (mp/md)2
DC By:
Milind S Patil
Block Diagram of DPCM
d [k ] x [k ] x [k 1].
+ d[k]
x[k] + Quantizer dq[k]
–
x[k-1]
Delay Ts
+
dq[k] + xˆ [k ]
+
xˆ [k 1]
xˆ [k ] d q [k ] xˆ [k 1]. Delay Ts
DC By:
Milind S Patil
Generalized DPCM
We can get even a smaller range of values if we define the
difference as:
d [k ] x[k ] xˆ[k ]
xˆ (k ) can be predicted from previous values of x,
xˆ (k ) a1 x(k 1) a2 x(k 2) a3 x(k 3)
The more previous samples included, the better the
approximation, the smaller the difference.
The relation d[k] = x[k]- x[k-1] is a special case where the
previous sample is taken as a prediction of the current value.
DC By:
Milind S Patil
Delta Modulation (DM)
If we increase the sampling rate (oversampling) much above the
Nyquist rate, the adjacent samples become very much correlated,
with a very small prediction error.
The difference can then be encoded by one bit;
If x[k] > x[k-1] dq [k] =
If x[k] < x[k-1] dq [k] = -
k
xq [k ] d [k ]; (assuming zero initial condition)
i 0
The analog signal is approximated by a staircase function.
DM is simple to implement. Moreover, it does not require word
synchronization.
DC By:
Milind S Patil
DM Illustration
DC By:
Milind S Patil
DM Modulator and Demodulator
2-level Quantizer Sampler
(Comparator Frequency fs
+ d[k] g]k[ dq[k] dq[k]
x[k] +
xˆq (t )
Accumulator (Integrator)
xˆq (t )
dq[k] LPF xˆ (t )
Accumulator (Integrator)
DC By:
Milind S Patil
SNR for DM
The quantization error lies in the range (-, )
Granular noise power = 2/3
The noise is uniformly distributed in the band 0
to fs.
The LPF will only pass (2/3)(B/fs) of noise
power.
SNR = (3/2)(fs/B)Ps
DC By:
Milind S Patil
Adpative Delta Modulation (ADM)
DM suffers from granular noise effect and
slope overload effect.
A remedy is applied by varying the step size s.
A granular noise is detected by a sequence of
alternating pulses.
A slope overload is identified by a sequence of
pulses of the same polarity.
DC By:
Milind S Patil