Lecture 2 - Signal Sampling and Quantization-3
Lecture 2 - Signal Sampling and Quantization-3
Edited by Ndegwa 1
Introduction
• Even most of signals are in continuous-time domain, they should be converted to a number at different discrete
time to be processed by a microprocessor.
• The process of converting these signals into digital form is called analog-to-digital (A/D) conversion.
• The reverse process of reconstructing an analog signal from its samples is known as digital-to-analog (D/A)
conversion.
Edited by Ndegwa 2
Introduction
8 Bit Code
Digital Processor
Edited by Ndegwa 3
Sampling
• Periodic or uniform sampling, a sequence of samples 𝑥[𝑛] is obtained from a continuous-time signal 𝑥𝑐 [𝑡] by
taking values at equally spaced points in time. T is the fixed time interval between samples, is known as the
the sampling period.
• The reciprocal 𝐹𝑠 is called sampling frequency (cycles per second or Hz) or sampling rate (samples per second).
Sampling rate Sampling period Example sampling period: T = 125 µs.
Sample per second (Hz) 𝐹𝑠 = 1/𝑇 (second)
sampling rate: 𝐹𝑠 =1/125µs = 8,000 samples per second (Hz).
Sampled
signal
Edited by Ndegwa 5
Sampling Process – frequency domain 1
Fourier Transform
Normalized Frequency
𝑛 (1)(2) (Cycles/ Sample)
• Since 𝑥[𝑛] is related to 𝑥𝑐 𝑡 𝑤𝑖𝑡ℎ 𝑡 = 𝑛𝑇 =
𝐹𝑠
Sampling Frequency (Hz)
• The desired relationship between sampled signal spectrum 𝑋𝑠 𝐹 and the continuous signal spectrum 𝑋𝑐 (𝐹)
Edited by Ndegwa 6
Sampling Process – frequency domain 2
∞
1 1 1 1
𝑋𝑠(𝐹) = ∑ 𝑋𝑐 𝐹 − 𝑘𝐹𝑠 𝑋𝑠 𝑓 = ⋯ + 𝑋𝑐 𝐹 + 𝐹𝑠 + 𝑋𝑐 𝐹 + 𝑋𝑐 𝐹 − 𝐹𝑠 + ⋯
𝑇 𝑇 𝑇 𝑇
𝑘=−∞
• Spectrum of 𝑥[𝑛] is obtained by scaling the spectrum of 𝑥𝑐 [𝑡], putting copies of the scaled spectrum 𝑋𝑐 (𝐹),
1
at all integer multiples of the sampling frequency 𝐹𝑠 = 𝑇 .
• The spectrum of 𝑥[𝑛] can be readily sketched if 𝑥𝑐(𝑡)is assumed to be band-limited. 𝑋𝑐 𝐹 = 0 𝑓𝑜𝑟 𝐹 > 𝐹𝐻
Edited by Ndegwa 7
Sampling Process – frequency domain 3
Case 1: Ω𝑠 > 2Ω𝐻
• The sampling operation leaves the input spectrum 𝑋𝑐(Ω) intact when Ω𝑠 > 2Ω𝐻, therefore, it should be possible
to recover or reconstruct 𝑥𝑐(𝑡) from the sequence 𝑥 𝑛 .
• Sampling at Ω𝑠 > 2Ω𝐻creates a guard band which simplifies the reconstruction process in practical applications.
Edited by Ndegwa 8
Sampling Process – frequency domain 4
• If Ω𝑠 < 2Ω𝐻, the scaled copies of 𝑋𝑐(Ω) overlap, so that when they are added together, 𝑋𝑐(Ω) cannot be
recovered from 𝑋(Ω) .
• This effect, in which individual terms overlap is known as aliasing distortion or simply aliasing.
Edited by Ndegwa 9
Sampling Theorem 1
• Question: Are the samples 𝑥[𝑛] sufficient to describe uniquely the original continuous-time signal and, if so, how
can 𝑥𝑐 [𝑡] be reconstructed from 𝑥[𝑛] ? An infinite number of signals can generate the same set of samples.
• Answer: The response lies in the frequency domain, in the relation between the spectra of 𝑥𝑐 [𝑡] and 𝑥[𝑛] .
Edited by Ndegwa 10
1 1 Sampling Theorem 2
𝑇 = 0.01 sec → 𝐹𝑠 = = = 100 𝐻𝑧
𝑇 0.01
One sample
each 0.01 s
Edited by Ndegwa 11
Sampling Theorem 3
• An analog signal can be perfectly recovered (reconstruction filter) as long as the sampling rate is at least twice
as large as the highest-frequency component of the analog signal to be sampled (Shannon sampling theorem).
Then 𝑥𝑐(𝑡) can be uniquely determined by its samples 𝑥 𝑛 = 𝑥𝑐(𝑛𝑇), where 𝑛 = 0, ±1, ±2, … if the sampling
frequency Ω𝑠 satisfies the condition:
2𝜋
𝐹𝑠 = ≥ 2 𝐹𝑚𝑎𝑥
𝑇𝑠
𝐹𝑠
• Half of the sampling frequency is usually called the Nyquist frequency (Nyquist limit), or folding frequency.
2
Example: To sample a speech signal containing frequencies up to 4 kHz, the minimum sampling rate is chosen
to be at least 8 kHz, or 8,000 samples per second.
Edited by Ndegwa 12
Example 1
Problem:
Euler's
identity
Solution:
Using Euler’s identity,
Edited by Ndegwa 13
Example 1 – Contd.
a.
Replicas, no
additional
information.
Edited by Ndegwa 14
Signal Reconstruction
(Digital-to-Analog Conversion)
• The reconstruction process (recovering the analog signal from its sampled signal) involves two steps.
𝑥𝑠 𝑡 = ∑ 𝑥 𝑛 𝛿(𝑡 − 𝑛𝑇𝑠)
𝑛=−∞
• Reconstruction filter
Perfect reconstruction is not possible, even if we use ideal low pass filter.
Edited by Ndegwa 17
Example 2
Problem:
Solution:
Edited by Ndegwa 18
a.
b.
The Shannon sampling theory condition is satisfied
Edited by Ndegwa 19
Example 3
Problem:
Solution:
a. b.
Edited by Ndegwa 20
8 Quantization
• During the ADC process, amplitudes of the analog signal to be converted have infinite
precision.
• Quantization : The quantizer converts the continuous amplitude signal discrete amplitude
signal.
• Encoding: After quantization, each quantization level is assigned a unique binary code.
Edited by Ndegwa 21
8 Quantization – Contd.
• A unipolar quantizer deals with analog signals ranging from 0 volt to a positive reference voltage
∆ ∆
𝑒𝑞: Quantization error 𝑒𝑞 = 𝑥𝑞 − 𝑥 𝑤𝑖𝑡ℎ − ≤ 𝑒𝑞 ≤
2 2
Edited by Ndegwa 22
8 Quantization – Contd.
Example:3-bit ADC channel accepts analog input ranging from 0 to 5 volts,
• bipolar quantizer deals with analog signals ranging from a negative reference to a positive
reference.
Edited by Ndegwa 23
9 Periodicity
• In discrete-time case, a periodic sequence is a sequence for which
where the period N is necessarily an integer.
𝜋 𝜋/ 1
Example 1:
𝜔 4 1
𝜔= → 𝑓= = =
4 2𝜋 2𝜋 8 → 𝑁 = 𝑓 = 8
Period of N = 8
Edited by Ndegwa 24
9 Periodicity – Contd.
Example 2: Not periodic with N = 8
3𝜋 𝜔 3 𝜋/8 3 1 16
𝜔= → 𝑓 = 2𝜋 = 2𝜋 = → 𝑁 = = 3×
8 16 𝑓 3
But periodic with N = 16 (Must be integer)
Edited by Ndegwa 25