ADVANCED DIGITAL
COMMUNICATIONS
Lecture #3: Sampling, Quantization
and Encoding
Introduction to Digital
Communications
Advantages
Immunity to noise and distortion compared
to analog systems
Digital circuits are more reliable and cheaper
Different kinds of signals e.g. voice, media,
data etc are treated identically since a bit is
still a bit
Error detection and correction (channel
coding) available
Better suited for signal processing functions
against interference, jamming, privacy and
encryption
Disadvantages
Uses more bandwidth
Introduction to Digital
Communications
Introduction to Digital
Communications
Formatting
Transmit and Receive Formatting
Transition from information source digital
symbols information sink
5
Formatting
Transforming an analog signal into a
digital signal compatible with digital
communication system
Sampling
Quantization
Symbol to bit mapper (PCM)
SYMBOL TO
BIT MAPPER
SAMPLING QUANTIZATION
101110….
Sampling
Sampling is the processes of converting continuous-
time analog signal, x(t), into a discrete-time signal by
taking the “samples” at discrete-time intervals
Sampling analog signals makes them discrete in time
but still continuous valued
If done properly (Nyquist theorem is satisfied),
sampling does not introduce distortion
Sampled values:
The value of the function at the sampling points
Sampling interval:
The time that separates sampling points (interval b/w
samples), Ts
If the signal is slowly varying, then fewer samples per
second will be required than if the waveform is rapidly
varying
So, the optimum sampling rate depends on the
maximum frequency component present in the signal
Sampling
Sampling Rate (or sampling frequency fs):
The rate at which the signal is sampled, expressed
as the number of samples per second (reciprocal of
the sampling interval), 1/Ts = fs
Nyquist Sampling Theorem (or Nyquist
Criterion):
If the sampling is performed at a proper rate, no
info is lost about the original signal and it can be
properly reconstructed later on
Statement:
“If a signal is sampled at a rate at least, but not
exactly equal to twice the max frequency
component of the waveform, then the waveform
can be exactly reconstructed from the samples
without any distortion”
f s 2 f max
Sampling
3 types of sampling
Impulse Sampling (a.k.a. Ideal Sampling)
Natural Sampling
Sample and Hold (Simplest and Most
Popular)
Ideal Sampling
x(t )
x (t ) (t nTs )
n
xs (t ) x(t ).x (t ) x(t ) (t nTs )
n
x(nTs ) (t nTs )
n
Ideal Sampling
X(f )
1
X ( f )
Ts
( f nf )
n
s
X s ( f ) X ( f ) * X ( f )
1
X ( f ) *
Ts
( f nf s )
n
1
Ts
X(f nf s )
n
Convolution Examples
Convolution Examples
13
Convolution Examples
14
Convolution Examples
15
Natural Sampling
x(t )
x p (t ) P (t ) * t nT Pt nT
n n
where P(t) is a rectangle pulse with width T
xs (t ) x(t ) Pt nT
n
Natural Sampling
X(f )
1 k k
X p( f ) P f
k T T T
1 1
T T
1 k k
X s ( f ) X s ( f )
k T
P
T
f
T
1 1
1 k k
P X f
T T
k T T T
Sample and Hold
p (t )
p (t )
x (t )
1
xs (t ) p (t ) * [ x(t ).x (t )] X s ( f ) P( f )
Ts
X ( f nf )
n
s
1
p (t ) * [ x(t ) (t nTs )] Tssinc( fTs ).
Ts
X ( f nf )
s
n
n
Sample and Hold
Sampling Theorem
A bandlimited signal having no spectral
fm
components above hertz can be
determined uniquely by values sampled
at uniform intervals
T
1 of
s
2 fm
or in terms of the sampling rate, called
f s 2 f m
the Nyquist criterion
Nyquist rate f s 2 f m
Recovering the Analog
Signal
One way of recovering the original signal from sampled signal
Xs(f) is to pass it through a Low Pass Filter (LPF) as shown below
If fs > 2B then we recover x(t) exactly
Else we run into some problems and signal is
not fully recovered
Aliasing
Undersampling and Aliasing
If the waveform is undersampled (i.e. fs < 2B)
then there will be spectral overlap in the sampled
signal
Aliasing effect
The signal at the output of the filter will be
different from the original signal spectrum
This is the outcome of aliasing!
This implies that whenever the sampling
condition is not met, an irreversible overlap
of the spectral replicas is produced
Aliasing effect
24
Aliasing effect
This could be due to:
1. x(t) containing higher frequency than were
expected
2. An error in calculating the sampling rate
Under normal conditions, undersampling of
signals causing aliasing is not recommended
Solution : Anti-Aliasing
Analog Filter
All physically realizable signals are not
completely bandlimited
If there is a significant amount of energy in
frequencies above half the sampling
frequency (fs/2), aliasing will occur
Aliasing can be prevented by first passing the
analog signal through an anti-aliasing filter
(also called a prefilter) before sampling is
performed
The anti-aliasing filter is simply a LPF with
cutoff frequency equal to half the sample rate
Solution : Anti-Aliasing
Analog Filter
Aliasing is prevented by forcing the
bandwidth of the sampled signal to satisfy
the requirement of the Sampling Theorem
Quantization
Amplitude quantizing: Mapping samples of a
continuous amplitude waveform to a finite set of
amplitudes. Out
In
Quantized
where q=(Vp-(-
values
Vp)) / L
= 2Vp / L
= Vpp / L
Uniform Quantization
A quantizer with equal quantization level is a Uniform
Quantizer
Each sample is approximated within a quantile interval
Uniform quantizers are optimal when the input
distribution is uniform
i.e. when all values within the range are equally
likely
q
Most ADC’s are implemented using uniform q
quantizers
e
Error of a uniform quantizer is bounded2by 2
Uniform Quantization
If we assume that the quantization error, e, the mean-
squared value (noise variance) of the quantization
error is given by:
q / 2
MSE 2
e 2 p (e)de
q/2
2
1
q / 2 q
e 2 de
q/2 q 12
where p(e) = 1/q is the (uniform) probability density
function of the quantization error. The variance, σ2,
corresponds to the average quantization noise power.
Uniform Quantization
The peak power of the analog signal (normalized
to 1Ω) can be expressed as
2 2
2 V pp Lq L2 q 2
Vp
2 2 4
where L is the number of quantization levels.
The ratio of peak signal power to average
quantization noise power (S/N)q , assuming that
there are no errors due to lSI or channel noise:
S L2 q 2 / 4
2 3L2
N q q / 12
Types of Quantizers
Uniform Non-uniform
Types of Quantizers
Non-uniform Quantization
Nonuniform quantizers have unequally
spaced levels
The spacing can be chosen to optimize the Signal-to-
Noise Ratio for a particular type of signal
It is characterized by:
Variable step size
Quantizer size depend on signal size
Non-uniform Quantization
Many signals such as speech have a
nonuniform distribution
Basic principle is to use more levels at
regions with large probability density
function (pdf)
Concentrate quantization levels in areas of
largest pdf
Or use fine quantization (small step size)
for weak signals and coarse quantization
(large step size) for strong signals
Non-uniform Quantization
In speech, weak signals are more frequent
than strong ones.
Using equal step sizes (uniform quantizer) S
N q
gives low for weak S signals
and high
N
for strong signals. q
Non-uniform Quantization
Companding is a method of reducing the
number of bits required in ADC while
achieving an equivalent dynamic range or
Signal-to-Quantization-Noise Ratio (SQNR)
In order to improve the resolution of weak
signals within a converter, and hence
enhance the SQNR, the weak signals need
to be enlarged, or the quantization step
size decreased, but only for the weak
signals
But strong signals can potentially be reduced
without significantly degrading the SQNR or
alternatively increasing quantization step
size
Nonuniform Quantization
The compression process at the
transmitter must be matched with an
equivalent expansion process at the
receiver
Non-uniform Quantization
After compression, input to the
quantizer will have a more uniform
distribution after sampling
Companding
At the receiver, the signal is expanded
by an inverse operation
The process of COMpressing and
exPANDING the signal is called
companding
Companding is a technique used to
reduce the number of bits required in
ADC or DAC while achieving comparable
SQNR
Companding
compressing + expanding companding
y C (x) x̂
x(t ) y (t ) yˆ (t ) xˆ (t )
x ŷ
Compress Qauntize Expand
Transmitter Channel Receiver
Companding
Basically, companding introduces a
nonlinearity into the signal
This maps a non-uniform distribution into
something that more closely resembles a
uniform distribution
A standard ADC with uniform spacing between
levels can be used after the compandor (or
compander)
The companding operation is inverted at the
receiver
There are in fact two standard logarithm
based companding techniques
US standard called µ-law companding
European standard called A-law companding
-Law Companding
Standard
x
log e 1
x
max
y ymax sgn( x)
log e 1
1 x 0
where sgn x
x and y represent the input and output voltages 1 x0
is a constant number determined by experiment
In the U.S., telephone lines uses companding with = 255
Samples 4 kHz speech waveform at 8,000 sample/sec
Encodes each sample with 8 bits, L = 256 quantizer levels
Hence data rate R = 64 kbit/sec
= 0 corresponds to uniform quantization
-Law Companding
Characteristics
A-Law Companding
Standard
x
A
y x
max sgn( x) x 1
0
1 log e A
max
xmax A
y
x
1 log e A
xmax 1 x
ymax sgn( x) 1
1 log e A A xmax
where
x and y represent the input and output voltages
A = 87.6
A is a constant number determined by
experiment
A -Law Companding
Characteristics
Pulse Code Modulation
(PCM)
Pulse Code Modulation refers to a digital
baseband signal that is generated
directly from the quantizer output
Sometimes the term PCM is used
interchangeably with quantization
Pulse Code Modulation
(PCM)
Encoding (PCM)
A uniform linear quantizer is called Pulse
Code Modulation (PCM).
Pulse code modulation (PCM): Encoding the
quantized signals into a digital word (PCM
word or codeword).
Each quantized sample is digitally encoded
into an l bits codeword where L in the
number of quantization levels and
Encoding
Example
amplitude
x(t)
111 3.1867
110 2.2762 Quant. levels
101 1.3657
100 0.4552
011 -0.4552 boundaries
010 -1.3657
001 -2.2762 x(nTs): sampled values
xq(nTs): quantized values
000 -3.1867
Ts: sampling time
PCM t
codeword 110 110 111 110 100 010 011 100 100 011 PCM sequence
Encoder Design
Algorithm
Vin value lies
between two
comparators
∆V = Vref/2N
N = Encoder
output bits
Comparators
≥2N-1
Encoder Design Example
Vin = 5.5V, Vref= 8V
Vin lies in between Vcomp5 & Vcomp6 0
Vcomp5 = Vref*5/8 = 5V
0
Vcomp6 = Vref*6/8 = 6V
1
Comparator 1 - 5 => output 1 1
Comparator 6 - 7 => output 0
1
Encoder Octal Input = sum(0011111)
=5
1
Encoder Binary Output = 1 0 1 1
5.5V