Lecture #3 Sampling, Quantization and Encoding
Lecture #3 Sampling, Quantization and Encoding
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:
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
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
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
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
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-
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
100 0.4552
010 -1.3657