DISCRETE-TIME SIGNALS &
SYSTEMS
SIGNAL SAMPLING AND
QUANTIZATION
BAU Dr. Abdul Rahman El Falou
BASIC CONCEPTS OF DIGITAL SIGNAL
PROCESSING
2
Analog filter : anti-alias filter, input and output signal are
continuous in time and amplitude.
ADC: Sampling, Quantization and coding. The output signal
is discrete both in time and in amplitude
DSP: processing of digital signal (filtering, enhancement…)
DAC: converts the processed digital signal to an analog
output signal (continuous in time and discrete in amplitude)
Reconstruction filter (anti-image): to smooth the DAC output
voltage levels
Dr. Abdul Rahman El Falou
Example of application: Digital Filtering
(1)
3
A digitized noisy signal obtained from digitizing analog
voltages (sensor output) containing a useful low-frequency
signal and noise that occupies all of the frequency range
Dr. Abdul Rahman El Falou
Example of application: Digital Filtering
(2)
4
After using a digital low pass filter:
Dr. Abdul Rahman El Falou
Example of application: Signal
Frequency (Spectrum) Analysis
5
Dr. Abdul Rahman El Falou
Digital Crossover Audio System
6
Dr. Abdul Rahman El Falou
Interference Cancellation in
Electrocardiography
7
Dr. Abdul Rahman El Falou
SAMPLING OF CONTINUOUS SIGNAL
8
The analog signal contains an infinite number of points
infinite amount of memory
infinite amount of processing power for computations
Sampling can solve such a problem by taking samples at a
fixed time interval
Dr. Abdul Rahman El Falou
Sample and hold analog voltage for
ADC
9
each sample maintains its voltage level during the
sampling interval T to give the ADC enough time to
convert it
T represents the sampling interval or sampling period in
seconds.
Sampling rate:
Dr. Abdul Rahman El Falou
Sampling Rate
10
We have to ensure that samples are collected at a rate
high enough that the original analog signal can be
reconstructed or recovered later
If an analog signal is not appropriately sampled,
aliasing will occur
an analog signal can be in theory perfectly recovered as
long as the sampling rate is at least twice as large as the
highest-frequency component of the analog signal to be
sampled
Dr. Abdul Rahman El Falou
Example
11
Dr. Abdul Rahman El Falou
Sampling
12
The sampled signal xs(t) obtained by sampling the
continuous signal x(t) at a sampling rate of fs samples
per second.
This process can be written as the product of the
continuous signal and the sampling pulses (pulse train)
Dr. Abdul Rahman El Falou
Spectrum of Sampled signal
13
From spectral analysis, the original spectrum (frequency
components) X(f) and the sampled signal spectrum Xs(f)
in terms of Hz are related as:
where X(f) is assumed to be the original baseband
spectrum
Dr. Abdul Rahman El Falou
14
Dr. Abdul Rahman El Falou
SIGNAL RECONSTRUCTION
15
Dr. Abdul Rahman El Falou
SIGNAL RECONSTRUCTION
16
Case 1: fs= 2fmax
an ideal lowpass reconstruction filter is required to recover the
analog signal spectrum. This is an impractical case.
Folding frequency=fs/2.
a DSP system with a sampling rate of fs can ideally sample an
analog signal with a maximum frequency that is up to half of the
sampling rate without introducing spectral overlap (aliasing)
Dr. Abdul Rahman El Falou
SIGNAL RECONSTRUCTION
17
Case 2: fs> 2fmax
a practical lowpass reconstruction (anti-image) filter can be
designed to reject all the images and achieve the original
signal spectrum.
Dr. Abdul Rahman El Falou
SIGNAL RECONSTRUCTION
18
Case 3: fs < 2fmax
Violation of Shannon sampling theorem
Even when we apply an ideal lowpass filter, there are still
some foldover frequency components from the adjacent
replica
if an analog signal with a frequency f is undersampled,
the aliasing frequency component falias in the baseband is:
Dr. Abdul Rahman El Falou
Example
19
Dr. Abdul Rahman El Falou
Solution
20
Dr. Abdul Rahman El Falou
Example
21
Dr. Abdul Rahman El Falou
Solution
22
Dr. Abdul Rahman El Falou
Example
23
Dr. Abdul Rahman El Falou
Solution
24
Dr. Abdul Rahman El Falou
Practical Considerations for Signal
Sampling: Anti-Aliasing Filtering
25
The analog signal to be digitized may contain other frequency
components in addition to the folding frequency
we apply an anti-aliasing filter to limit the input analog signal
all the frequency components are less than the folding frequency
Considering the worst case, where the analog signal to be
sampled has a flat frequency spectrum
the shape of each replica in the sampled signal spectrum is the
same as that of the anti-aliasing filter magnitude frequency
response
Dr. Abdul Rahman El Falou
Practical Considerations for Signal
Sampling: Anti-Aliasing Filtering
26
The aliasing noise from the adjacent replica still appears
in the baseband
Dr. Abdul Rahman El Falou
Practical Considerations for Signal
Sampling: Anti-Aliasing Filtering
27
We use Butterworth filter with an order of n:
For a second-order Butterworth lowpass filter with unit
gain, the transfer function is:
The magnitude frequency response is:
Dr. Abdul Rahman El Falou
Example of Butterworth analog filter
28
Dr. Abdul Rahman El Falou
Aliasing Level
29
Using the symmetry of the Butterworth magnitude
function and its first replica
Dr. Abdul Rahman El Falou
EXAMPLE 2.4
30
Dr. Abdul Rahman El Falou
Solution 2.4
31
Dr. Abdul Rahman El Falou
Solution 2.5
32
Dr. Abdul Rahman El Falou
Example 2.6
33
Dr. Abdul Rahman El Falou
Solution 2.6
34
Dr. Abdul Rahman El Falou
Practical Considerations for Signal Reconstruction:
Anti-Image Filter and Equalizer
35
The DAC unit converts the processed digital signal
y(n) to a sampled signal ys(t) , and then the hold circuit
produces the sample-and-hold voltage yH(t)
Dr. Abdul Rahman El Falou
Practical Considerations for Signal Reconstruction:
Anti-Image Filter and Equalizer
36
The magnitude frequency response acts like lowpass filtering and
shapes the sampled signal spectrum of Ys(f) distortion
The percentage of distortion in the desired frequency band is given
by:
Dr. Abdul Rahman El Falou
EXAMPLE 2.7
37
Dr. Abdul Rahman El Falou
Sample-and-hold: Solutions
38
To overcome the sample-and-hold effect:
We can compensate the sample-and-hold shaping effect
using an equalizer
We can increase the sampling rate using oversampling
and interpolation methods when a higher sampling rate
is available at the DAC
We can change the DAC configuration and perform
digital pre-equalization using a flexible digital filter
Dr. Abdul Rahman El Falou
ANALOG-TO-DIGITAL CONVERSION, DIGITAL-TO-
ANALOG CONVERSION, AND QUANTIZATION
39
Quantization: during the ADC process, the continuous
amplitude must be converted to digital data with finite
precision
There are several ways to implement ADC
Flash ADC high conversion speed, lot of hardware
Successive approximation ADC minimum hardware
Sigma-delta ADC high precision
Dr. Abdul Rahman El Falou
Example: 2-bit flash ADC
40
Dr. Abdul Rahman El Falou
Quantizer type
41
A unipolar quantizer deals with analog signals ranging
from 0 volt to a positive reference voltage
A bipolar quantizer deals with analog signals ranging
from a negative reference to a positive reference
The step size of the quantizer or the ADC resolution is
given by: o L denotes the number of
quantization levels
o m is the number of bits used
in ADC
o xq indicates the quantization
level
o i is an index corresponding
to the binary code
Dr. Abdul Rahman El Falou
Example: 3-bit unipolar quantizer
42
Dr. Abdul Rahman El Falou
Example: 3-bit unipolar quantizer
43
Dr. Abdul Rahman El Falou
Example: 3-bit bipolar quantizer
44
Dr. Abdul Rahman El Falou
Example: 3-bit bipolar quantizer
45
Dr. Abdul Rahman El Falou
EXAMPLE 2.9
46
Dr. Abdul Rahman El Falou
EXAMPLE 2.9
47
Dr. Abdul Rahman El Falou
Typical ADC process.
48
Dr. Abdul Rahman El Falou
Typical DAC process
49
Dr. Abdul Rahman El Falou
Quantization error
50
When the DAC outputs the analog amplitude xq with
finite precision, it introduces quantization error defined
as:
The quantization error is bounded by half of the step
size:
Assuming the quantization error has a uniform
distribution, the power of quantization noise is related
to the quantization step and given by:
Dr. Abdul Rahman El Falou
Quantization error
51
The ratio of signal power to quantization noise power
(SQNR) can be expressed as:
or
Using E(x2) = x2rms , we achieve:
Practically,
Dr. Abdul Rahman El Falou
Example 2.10
52
Dr. Abdul Rahman El Falou
Example 2.11
53
Dr. Abdul Rahman El Falou
Example 2.12
54
Dr. Abdul Rahman El Falou