You are on page 1of 42

KIE2008 (Week 4-5)

Analog to Digital Conversion


i. Signals Sampling and Reconstruction
ii. Quantization & Encoding
iii. Waveform Encoding (PCM, DPCM, DM, ADM)

Adapted from,
Proakis and Salehi (2014), Fundamental of
Communication Systems, 2nd Ed. Pearson.
(CHAPTER 7)
Introduction To Modulation
Introduction
• Previous chapter deals with analog communications.
• Digital communication systems provide
• a higher level of noise immunity
• more flexibility in the bandwidth-power trade-off
• the possibility of applying cryptographic and anti-jamming techniques
• the ease of implementation using a large-scale integration of circuits.
• First step is to convert analog information in digital form with
minimum signal distortion
• Analog-to-Digital conversion involves three operations:
i. Sampling
ii. Quantization
iii. Encoding
Sampling Theorem
• The analog signal is sampled to
obtain a discrete-time
continuous-valued signal from
the analog signal.
• Sampling theorem plays an
important role in digital
communication methods.
• Assume two signals, x1(t) and
x2(t)
• x1(t) is a smooth signal (low freq)
• x2(t) is a rapidly-changing signal
(high freq)
Sampling Theorem
•  These signals can be approximated with samples taken at regular
intervals, and using linear interpolation of the sampled values.
• linear interpolation is a curve fitting method using linear polynomials to
construct new data points within the range of a discrete set of data points.
• The sampling interval for x1(t) can be much greater than x2(t).
• Sampling Theorem basically states two facts:
i. If signal x(t) is bandlimited to W (X(f)  0 for |f|  W), then it is sufficient to
sample at intervals to recover the exact original signal from the samples.
ii. If a more sophisticated interpolating signals than linear interpolation is
allowed, the exact original signal can be recovered from the samples, as long
as condition (i) is satisfied.
Sampling Theorem
••  Let signal has a bandwidth , and be sampled at multiples of sampling
interval to yield a sequence
• Possible to reconstruct the original signal using reconstruction formula
,
where. ( arbitrary number)
• Special case 

Sinc (sine cardinal) Function


  1 ; 𝑥 =0
{
sinc ( 𝑥 ) = sin 𝑥
𝑥
; 𝑜𝑡h𝑒𝑟
Sampling Theorem
•Proof
 
• Let denote the result of sampling by impulses at time instants, so

• Laplace Transform

• It shows that is a replication of the FT of the


original signal at a rate of

 
Review:
• What is ?
• What is ?
Sampling Theorem
•   If (, undersampling), the replicated spectrum of x(t) overlaps and reconstruction
of the original signal is not possible  aliasing error/distortion
• If (), reconstruction is possible with appropriate filter (such as low pass filter)
Sampling Theorem
•Assume
  the use of an ideal lowpass filter with bandwidth W’, with a transfer
function

Where
With this choice we have

IFT,
Sampling Theorem
•  Therefore, if we use sinc functions for interpolation of the sampled
values, we can perfectly reconstruct the original signal.
• The sampling rate is the minimum sampling rate at which no aliasing
occurs, it is known as Nyquist Sampling Rate.
Sampling Theorem
••  If Nyquist rate is used, the reconstruction filter must be an ideal lowpass filter

• In practical systems, sampling is done at rate higher than Nyquist rate to allow
realizable and easily-designed filters.
• The distance between two adjacent spectra in the frequency domain is called
guardband,

Examples
A bandlimited signal has a bandwidth of 3400Hz and in order to guarantee a
guardband of 1200 Hz, the sampling rate should be 8000Hz.
Examples
•1.   For a lowpass signal with a bandwidth of 6000 Hz, what is the minimum sampling frequency for
perfect reconstruction of the signal? What is the minimum required sampling frequency if a guard
band of 2000 Hz is required? If the reconstruction filter has the frequency response
;
What is the minimum required sampling frequency and the value of K for perfect reconstruction?
2. The lowpass signal x(t) with a bandwidth of W is sampled with a sampling interval of Ts, and the
signal is reconstructed from the samples, where p(t) is an arbitrary-shaped pulse (not necessarily
time limited to the interval [0, Ts]).
a) Find the Fourier transform of xp(t).
b) Find the conditions for perfect reconstruction of x(t) from xp(t).
c) Determine the required reconstruction filter.
Quantization
• After sampling, we have discrete-time signals. The amplitudes of
these signals are, however, continuous, which requires an infinite
number of bits for transmission.
• Quantization is used to make the amplitudes discrete.
• The output after quantization is discrete-time, finite-amplitude signal.
• Two types of quantization methods:
i. Scalar quantization: samples are quantized individually
ii. Vector quantization: blocks of samples are quantized at a time (mostly used
in voice and image processing).
Scalar Quantization Example of an
8-level
• Each
  sample is quantized into one of a quantization
scheme
finite number of levels (which is then
encoded).
• The quantization process is a rounding
process – rounded to the nearest value
from a finite set of possible levels (N).
• The number of bits required to
transmit each source output is
• Quantization introduces distortion.

 Quantization Regions:
Quantized version of x (quantization level),
Quantization function, for all
Scalar Quantization
•  The average distortion resulting from quantization can be defined
using squared error distortion as

• Since X is a random variable, so are and , therefore the average


distortion is
 Examples
Source X(t) is a stationary Gaussian source with mean zero and power spectral density

The source is sampled at the Nyquist rate and each sample is quantized using the 8-level
quantizer with a1 = −60, a2 = −40, a3 = −20, a4 = 0,a5 = 20,a6 = 40,a7 = 60, and = −70, = −50, =
−30, = −10, = 10, = 30, = 50, and = 70. What is the resulting rate and distortion?
 
Scalar Quantization
•  If the random variable X is quantized to Q(X), the signal-to-
quantization noise ratio is defined by

Examples
What is the SQNR for the previous example?
Uniform Quantization
•  The entire real line is partitioned into N regions of equal length (),
except and .
• The quantization levels are at distance of /2 from the boundaries.

• To design an optimal uniform quantizer, distortion needs to be


minimized, this is done by differentiate D with respect to a1 and D,
which is done using numerical techniques.

For the previous Example, design an optimal quantizer for the source using table
7.1. Compare the distortion.
Uniform Quantization
Uniform Quantization
Nonuniform Quantization
•  If the quantization regions (except the first and last) is of not equal
length, then we are minimizing the distortion with less constraints.

• There are 2N-1 variables (, , … , , , …, ) and the minimization is to be


done with respect to these variables.

Define

Nonuniform Quantization
• The two conditions (known as Lloyd-Max) gives the necessary
conditions for a scalar quantizer to be optimal:
i. The boundaries of the quantization regions are the midpoints of the
corresponding quantized values (nearest neighbor law)
ii. The quantized values are the centroids of the quantization regions.
• The usual method of designing a optimal quantizer is to start with a
set of quantization regions, and then using the second criterion to
find the quantized values. Then, design new quantization regions for
the new quantized values, and alternate between the two steps until
the distortion does not change much from one step to the next.

For the previous Example, instead of the uniform quantizer, we used an optimal
nonuniform quantizer with the same number of levels, what will happen?
Nonuniform Quantization

  the Gaussian source with


If
a mean of m and variance of
2, then the values are
replaced with and 2D.
Nonuniform Quantization
Nonuniform Quantization
Tutorial(1b)
1. Let X(t) denote a wide-sense stationary (WSS) Gaussian process with (signal
power) PX = 10.
a) Using Table 7.1, design a 16-level optimal uniform quantizer for this source.
b) What is the resulting distortion if the quantizer in Part 1 is employed?
c) What is the amount of improvement in SQNR (in decibels) that results from
doubling the number of quantization levels from 8 to 16?
2. Repeat 1 by using table 7.2 for nonuniform quantizer.
Encoding
• A sequence of bits are assigned
to different quantization values.
• We use b bits to replace N = 2b
levels
• Since the sampling rate is fs, so
the bit rate is R = bfs
i. Natural Binary Code (NBC):
Assign the lowest quantized
level to lowest value, and
vice versa.
ii. Gray Coding: Adjacent levels
differ only one bit.
Waveform Encoding
• To reproduce the waveform output of the source at the destination
with as little distortion as possible
• The structure of the source plays no role in the design of waveform
coders and only properties of the waveform affect the design.
• Four waveform coding methods:
1. Pulse Code Modulation (PCM)
2. Differential PCM (DPCM)
3. Delta Modulation (DM)
4. Adaptive DM (ADM)
Pulse Code Modulation (PCM)

•A  pulse code modulator consists of a sampler, a quantizer, and an encoder.


• Assumptions:
i. The waveform is bandlimited with a maximum frequency of W  Nyquist sampling
rate, fs =2W.
ii. The signal is of finite amplitude 
iii. Large number of quantization levels N (=2b).
• A presampling filter (with bandwidth W) is usually used
• Sampling is done at a rate higher than fs.
• The quantizer can be uniform or nonuniform, depends on the characteristics
of the source output.
Uniform PCM
•  The length of each quantization region, ; the range is
• The quantization value is the midpoint of the quantization region, so
the error is a random variable taking values in the interval .
• Since N is large, so is small, can be approximated by a uniformly
distributed random variable on
Uniform PCM
•  Quantization noise

• The signal-to-quantization-noise ratio


; is the power of each sample
• If X(t) is a wide-sense stationary process,

• , usually  3N2 is the upper bound to SQNR


•  every extra bit increases the SQNR by 6dB
• For each sample, b bits are used, so a total of bfs (=2bW) bps are required  the
minimum bandwidth for PCM is bW.
Nonuniform PCM

• Uniform PCM if suitable for close to uniformly-distribution input signal.


• Nonuniform PCM is suitable for input signal that are not uniformly
distributed (such as speech with higher probability for smaller amplitude
and vice versa)
• Nonuniform quantization is done by first pass the samples through a
nonlinear element that compresses the large amplitudes to reduce the
dynamic range of the signal, and then perform uniform quantization.
• The opposite (expansion) is done at the receiver.
• This is known as companding.
Nonuniform PCM

-Law Compander A-Law Compander


 
𝑔 ( 𝑥 ) =log ¿ ¿ ¿  ( )
𝑔 𝑥 =1+log
𝐴∨𝑥∨¿
𝑠𝑔𝑛(𝑥)¿
1+log ( 𝐴 )
Differential PCM (DPCM)
•  In the simplest form of DPCM, the difference
between two adjacent samples is quantized.
• Since two adjacent samples are highly
correlated, their difference has small variation,
and so fewer levels are required.
• DPCM can achieve performance levels at lower
bit rates than PCM.
• The input to the quantizer is , where is closely
related to ; this can prevent accumulation of
quantization noise.
• The input to the quantizer is quantized by a
scalar quantizer
Delta Modulation (DM)
• Simplified version of DPCM
• The quantizer is a one-bit quantizer with
magnitude 
• The quantizer noise will be high unless
thee dynamic range of Yn is very low.
• To counter this, Xn and Xn-1 must have
sampling rate that is much higher than
Nyquist rate.
• A major advantage of DM is its simple
structure.
Delta Modulation (DM)
• The step size is a very important parameter in designing a delta
modulator.
• Large values cause the modulator to follow rapid changes in the input signal,
but high quantization noise when the input changes slowly. (granular noise)
• Small values cause longer time for the output to follow the input if the input
signal changes rapidly. (overload distortion)
Adaptive DM (ADM)
•  Adaptively change the step size ()
according to the changes in input
• A mechanism is needed to recognize
large and small input slopes.
• Sign of two successive is used as
criterion for changing the step size
• If same sign, increase step
• If opposite sign, decrease step

= output of the quantizer before being


scaled by the step size
K = constant larger than 1
Tutorial(1c)
1. A stationary random process has an autocorrelation function given by RX(τ) = A2/2 e−|τ| cos 2πf0τ; we know that
the random process never exceeds 6 in magnitude. Assume that A = 6.
a) How many quantization levels are required to guarantee an SQNR of at least 60 dB?
b) Assuming that the signal is quantized to satisfy the condition of (a) and assuming the approximate
bandwidth of the signal is W, what is the minimum required bandwidth for the transmission of a binary
PCM signal based on this quantization scheme?
2. A signal can be modeled as a lowpass stationary process X(t), whose probability density function (PDF) at any
time t0 is shown. The bandwidth of this process is 5 kHz, and we desire to transmit it using a PCM system.
a) If sampling is done at the Nyquist rate and a uniform quantizer with 32 levels is employed, what is the
resulting SQNR? What is the resulting bit rate?
b) If the available bandwidth of the channel is 40 kHz, what is the highest achievable SQNR?
c) If, instead of sampling at the Nyquist rate, we require a guard band of at least 2 kHz and the bandwidth
of the channel is 40 kHz, what is the highest achievable SQNR?
Assignment
Reading Assignment: Study on the digital audio and video coding
standards. (Textbook section 7.6 & 7.7)
Matlab Assignment (Part 1)
The objective of this exercise is to investigate the error in the
quantization of a sinusoidal signal using uniform PCM. Quantize the
sinusoidal signal s(t)=sin(t), 0≤t≤10 once to 8 levels and once to 16
levels for a sampling interval Ts = 0.1. Plot the original signal and the
two quantized versions on the same graph, and observe the results.
Compute the SQNR for the 8- and 16-level quantizers.
Repeat the exercise with another type of signals.
Submission: Friday (week 7) – Hardcopy report.

You might also like