0% found this document useful (0 votes)
31 views49 pages

Lecture 2

The document discusses analog to digital and digital to analog conversion. It covers sampling theory including the Nyquist rate and aliasing. It also discusses quantization including quantization levels and error. Uniform quantization is described as dividing the signal range into equal regions.

Uploaded by

vdsignfeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views49 pages

Lecture 2

The document discusses analog to digital and digital to analog conversion. It covers sampling theory including the Nyquist rate and aliasing. It also discusses quantization including quantization levels and error. Uniform quantization is described as dividing the signal range into equal regions.

Uploaded by

vdsignfeb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

EIE579 Advanced Telecommunication Systems

Lecture 2: Analog-to-Digital and Digital-to-Analog Conversion

LIU Liang

Assistant Professor
Department of Electronic and Information Engineering
The Hong Kong Polytechnic University

0
Lecture 1 Review

q Shannon capacity shows the maximum rates for reliable communication over a channel
q In modern communication systems, digital communication techniques are used to
approach Shannon capacity

1
Analog and Digital Signals
q Analog signal: continuous signals varying over time
Ø Consisting of an infinite number of samples
Ø Each sample is continuously valued
q Digital signal
Ø Consisting of a finite number of samples (via sampling)
Ø Each sample is discretely valued (via quantization)

2
Analog-to-Digital (A/D) Conversion at Transmitter

3
Digital-to-Analog (D/A) Conversion at Receiver

4
Advantages of Digital Communication

5
6
Harry Nyquist

“Certain topics in telegraph transmission theory,” Trans.


AIEE, vol. 47, pp.617–644, Apr. 1928

Nyquist Sampling Theory

Continuous-Time Discrete-Time

7
Sampling Process

q Analog signal is sampled every Ts secs


q Ts is referred to as the sampling interval
q fs = 1/Ts Hz is called the sampling rate or sampling frequency

8
Sampling Methods

In this course,
we usually
assume ideal
sampling

q Ideal sampling - an impulse at each sampling instant


q Natural sampling - a pulse of short width with varying amplitude
q Flattop sampling - sample and hold, like natural but with single amplitude value
9
How to Determine Sampling Rate
q On one hand, sampling rate should be as small as possible
Ø Otherwise, we need to store many samples
q On the other hand, sampling rate should be high enough
Ø Otherwise, it may be impossible to recover the original signal based on samples

Sampling at 2 Hz
Sampling at 1.5 Hz

What is the minimum sampling rate for perfect recovery?


10
Nyquist Sampling Theory
q If a signal has no frequency components higher than 𝑊 Hz, it can be exactly
reconstructed (without any loss of information) from its discrete-time samples taken
uniformly at a rate no smaller than 2𝑊 Hz.

Sampling at 2 Hz
Sampling at 1.5 Hz

?
Frequency of the signal: 1 Hz

11
Nyquist Sampling Rate
q The minimum sampling rate 2𝑊 Hz is called the Nyquist sampling rate
q Intuition: Signals containing high-frequency components change quickly with
time, thus requiring more frequent samples in the time domain

Time
domain:

Frequency
domain:
𝑓 𝑓
𝑊! 𝑊"

12
How to Understand Nyquist Sampling Theory
q It is easier to understand Nyquist Sampling Theory in the frequency domain
q Fourier Transform: from time domain to frequency domain

q The samples can create a periodic summation of

0
-W W

𝑓" ≥ 2𝑊 𝑓" < 2𝑊

0 -fs 0
-fs -W W fs -W W fs
-fs-W -fs+W fs-W fs+W -fs-W -fs+W fs-W fs+W
13
Aliasing Effect

6
5
4
3
2
1
0

Aliasing error due


to low sampling
6
5 frequency (fs<2W)
4
3
2
1
0

14
Recovery of Continuous Signal from Samples
q If sampling rate is above 2W Hz, the continuous signal can be recovered as follows
Ø Using samples to construct

0
-fs -W W fs

Ø Using low-pass filter to get from :

0 0
-fs -fs/2 -W W fs/2 fs -W W

Ø Using inverse Fourier Transform to recover from

15
Example of De-Sampling
q Input signal:
Ø Sampling rate:
Ø Four samples:

q De-sampling
Ø Step 1:

Ø Step 2: low-pass filter

Ø Step 3: Inverse Fourier Transform


16
Example of De-Sampling
q In computing devices, everything should be discrete e.g., L=11, M=11
t: 0, 0.1, 0.2, …., 1
f: -2, -1.6, -1.2, … 2

When you design program,


q De-sampling you can set L and M to be
large, e.g., L=1001, M=1001
Ø Step 1:

Ø Step 2: low-pass filter

Ø Step 3: discrete version of Inverse Fourier Transform

17
Some Practical Issues
q In practice, it is difficult to design a low-pass filter with sharp cut-off

0
-W W fs 2fs

q If the sampling rate is much higher than the Nyquist sampling rate, the filter to
recover the signal can have a gentler slope in the cut-off region, making it easier to
implement in practice

0
-W W fs 2fs

q In practice, the sampling rate is higher than the Nyquist sampling rate

18
Examples
q For telephone voice signals, the maximum frequency is 3.4 kHz
Ø The Nyquist rate is 6.8 kHz
Ø A minimum sampling rate of 6.8 kHz is needed
Ø The sampling rate is set as 8 kHz, which is an international standard to process
voice signals
q For music signals in Compact Disk (CD), the maximum frequency is 20 kHz
Ø The Nyquist rate is 40 kHz
Ø The sampling frequency adopted to sample music thus must be greater than or
equal to 40 kHz
Ø The signal is originally sampled at a rate of 44.1 kHz, and then oversampled by 4
times to make the sampling rate 176.4 kHz

19
20
Quantization
q Objective: Transforms a continuous-amplitude signal into a discrete-amplitude
signal, where the discrete amplitudes are only taken from a finite set
q Divide the range of real values into N disjoint subsets
, each called a quantization region and corresponds
to a value (also called the quantization level).
q The quantizer output for any input amplitude is if or
q Quantization function Q(.):

21
An Example
q One quantization design with N=8 quantization levels
Ø Quantization region:

Ø Quantization level:
output

q Quantizer is a staircase function


q N is usually a power of 2 for ease of
ℛ! ℛ" ℛ# ℛ$ 100 101 110 111
000 001 010 011 ℛ% ℛ& ℛ' ℛ(
input encoding, i.e., N=2R
Ø 𝑅 is called number of quantization bits

22
Quantization Error
q Quantization error:
Ø True value: output

Ø Quantized value:
q Average distortion (mean-squared error)
ℛ! ℛ" ℛ# ℛ$
input
ℛ% ℛ& ℛ' ℛ(

q Signal-to-quantization-noise ratio (SQNR)

q Need to design the quantizer to reduce distortion or improve SQNR


Ø How to decide quantization regions
Ø How to decide quantization levels
23
Uniform Quantization
q Quantization regions are of the same length
Ø Length of each quantization region
Ø Quantization regions:
q Quantization levels are midpoints of quantization regions:

24
Uniform Quantization
q Quantization error/noise for uniform quantization

Continuous waveform Quantization error (quantization noise)

Quantized waveform

0.5

0.3

0.1

-0.1

-0.3

25
Uniform Quantization

q Worst-case quantization error for uniform quantization:

26
Uniform Quantization
q Example:
Ø Range of the input samples:
Ø Number of quantization levels:
Ø Length of each quantization region:
Ø Assuming quantization error uniformly distributed in

§ Distortion:

§ SQNR:

One more quantization bit increases SQNR by 6 dB!


27
Uniform Quantization
q If the signal is a sinusoidal wave , then

Number of Quantization Number of Quantization SQNR (dB)


Levels, N Bits, R
32 5 31.8
64 6 37.8
128 7 43.8
256 8 49.8

28
Non-Uniform Quantization
q In practice, the signal’s amplitude may not be evenly distributed. For example, for
speech waveform, there exists a higher probability for smaller amplitudes and a
lower probability for larger amplitudes
q This motivates us to design a quantizer with more quantization regions (smaller
step size) at lower amplitudes and fewer quantization regions (larger step size) at
larger amplitudes. This is called non-uniform quantization

0.6

0.4

0.2

-0.2

-0.4

29
Non-Uniform Quantization
q Method: First pass the samples through a nonlinear element that compresses the
large amplitudes (reduces the dynamic range of the signal), and then perform a
uniform quantization on the output
q At the receiving end, the inverse (expansion) of this nonlinear operation is
applied to obtain the sampled value.
q This technique is called companding (compressing-expanding)
q Two commonly adopted standards, namely A-law and µ-law, have been widely
used

30
A-Law

q A-law is used in the companding of telephone voice in European telephone


system

31
A-Law
the weaker signals are amplified by
larger factors while the stronger signals
q Compressor output versus input are amplified by smaller factors

32
µ-Law

q The µ-law of compression is defined by the input-out relationship

ln(1 + µ vin )
vout = sgn(vin )
ln(1 + µ )
q The value µ controls the amount of compression and expansion.
q µ-law is used in North America to compress the dynamic range of telephone voice
for quantization. The standard pulse code modulation system in US and Canada
employs a compressor with µ=255 followed by a uniform quantizer with 8
bits/sample

33
µ-Law

q Compressor output versus input

34
Extension: Vector Quantization

q Scalar quantization: input signal is x


q Vector quantization: input signal is x=[x1,x2,…,xK]

35
36
Encoding

q A bit (binary digit): 0 or 1


q Encoding: Assign a sequence of 𝑅 binary bits for each of the N=2𝑅 quantization
levels
q Recall the sampling rate is 𝑓𝑠 samples/second, thus the bit rate is
𝑅 bits/sample x 𝑓𝑠 samples/second = 𝑅𝑓𝑠 bits/second
q The bit rate represents how many bits are contained in one second
q Two encoding methods: natural binary coding (NBC) and Gray coding

37
Natural Binary Coding (NBC)

q Assign values of 0 to N−1 to different quantization levels, starting from the lowest
level to the highest level. Then, assign the binary expression of the numbers 0 to N−1
to these levels

N=8 7 111
N=16
6 110
5 101
4 100

011 3
010 2
001 1
000 0

38
Gray Coding

q Assign the bit sequence such that adjacent quantization levels only differ in one bit

N=8 100 N=16


101
111
110

010
011
001
000

Ø In practice, the signal amplitude changes smoothly. When the quantized value
changes to the next level, it is practically appealing to change the code by one bit

39
An Example for A/D and D/A Conversion

q Sampling rate: 5 Hz
q Number of quantization bits per sample: 3
40
Sampling at Transmitter

q 5 samples per second


q > Nyquist sampling rate
41
Quantization at Transmitter

100
101

111
110

010

011
001
000

q Quantization bits for 10 samples


101 100 110 000 001 101 100 110 000 001
42
De-Quantization at Receiver

100
101

111
110

010

011
001
000

q Receiver recovers 10 samples based on quantization bits


101 100 110 000 001 101 100 110 000 001
43
De-Sampling at Receiver

100
101

111
110

010

011
001
000

q Receiver recovers signal based on 10 samples

44
Some Remarks

q Sampling does not lose any information as long as the sampling rate is equal to or
higher than the Nyquist sampling rate
q However, quantization error is inevitable, unless we use an infinite number of
quantization bits
Ø Rate-distortion trade-off

45
Summary of A/D and D/A Conversion

46
Homework 1

q Visit the website of this course on blackboard. On the left tool bar, click
“Assessment”. You will see one item called “Homework 1”
q Download “Instruction_of_Homework1.pdf”
q Design a program using Matlab or Pathon to perform A/D and D/A conversion
following the instruction in the above file
q If you meet any difficulty, please contact TA
Ø Wang Qipeng: [email protected]
q The deadline for Homework 1 is 11:59pm, January 31, 2023
Ø Click “Homework 1” in “Assessment”. Attach your code and report there, and
click “Submit”

47
How to Install Matlab

q If you have an available Matlab license, use it to install a full version of Matlab on
your PC
q Download a trial version of Matlab from the official website
https://au.mathworks.com/products/matlab.html using your PolyU email address.
This version can be used for 30 days
q Use the open-source version of Matlab, the GNU Octave, which can be
downloaded from https://octave.org/download.html. In Octave, you can write script
and run it in the same way as Matlab (except for some complicated Matlab packages
which are not needed in this assignment). Octave has both Windows and MAC OS
versions, and is easy to install

48

You might also like