Bài giảng Digital signal processing - Chapter 2: Quantization - Nguyen Thanh Tuan

1. Quantization process

2 Quantization

The quantized sample xQ(nT) is represented by B bit, which can take

2B possible values.

Fig: Analog to digital conversion

An A/D is characterized by a full-scale range R which is divided

into 2B quantization levels. Typical values of R in practice are

between 1-10 volts.

Quantization by rounding: replace each value x(nT) by the nearest

quantization level.

e(nT)  xQ (nT)  x(nT)

Quantization by truncation: replace each value x(nT) by its below

nearest quantization level.

Quantization error:

Consider rounding quantization:

pdf 29 trang Bích Ngọc 04/01/2024 420
Bạn đang xem 20 trang mẫu của tài liệu "Bài giảng Digital signal processing - Chapter 2: Quantization - Nguyen Thanh Tuan", để tải tài liệu gốc về máy hãy click vào nút Download ở trên

Tóm tắt nội dung tài liệu: Bài giảng Digital signal processing - Chapter 2: Quantization - Nguyen Thanh Tuan

Bài giảng Digital signal processing - Chapter 2: Quantization - Nguyen Thanh Tuan
Click to edit Master subtitle style Nguyen Thanh Tuan, M.Eng. 
Department of Telecommunications (113B3) 
Ho Chi Minh City University of Technology 
Email: nttbk97@yahoo.com 
 Quantization 
 Chapter 2 
Digital Signal Processing 
1. Quantization process 
2 Quantization 
 The quantized sample xQ(nT) is represented by B bit, which can take 
2B possible values. 
Fig: Analog to digital conversion 
 An A/D is characterized by a full-scale range R which is divided 
into 2B quantization levels. Typical values of R in practice are 
between 1-10 volts. 
Digital Signal Processing 
1. Quantization process 
3 
Fig: Signal quantization 
Quantization 
 Quantizer resolution or quantization width (step) 
2B
R
Q 
 A bipolar ADC ( )
2 2
Q
R R
x nT 
 A unipolar ADC 0 ( )Qx nT R 
Digital Signal Processing 
1. Quantization process 
4 Quantization 
 Quantization by rounding: replace each value x(nT) by the nearest 
quantization level. 
( ) ( ) ( )Qe nT x nT x nT 
 Quantization by truncation: replace each value x(nT) by its below 
nearest quantization level. 
 Quantization error: 
 Consider rounding quantization: 
2 2
Q Q
e 
Fig: Uniform probability density of quantization error 
Digital Signal Processing 
1. Quantization process 
5 Quantization 
 The mean value of quantization error 
 The mean-square error 
 (power) 
/2 /2
/2 /2
1
( ) 0
Q Q
Q Q
e ep e de e de
Q
/2 /2 2
2 2 2 2
/2 /2
1
( ) ( )
12
Q Q
q
Q Q
Q
e e e p e de e de
Q

 Root-mean-square (rms) error: 2
12
rms q
Q
e e 
 R and Q are the ranges of the signal and quantization noise, then 
the signal to noise ratio (SNR) or dynamic range of the quantizer 
is defined as 
2
10 10 102
10log 20log 20log (2 ) 6BxdB
q
R
SNR B dB
Q


 which is referred to as 6 dB bit rule. 
Digital Signal Processing 
Example 1 
6 Quantization 
 In a digital audio application, the signal is sampled at a rate of 44 
KHz and each sample quantized using an A/D converter having a 
full-scale range of 10 volts. Determine the number of bits B if the 
rms quantization error must be kept below 50 microvolts. Then, 
determine the actual rms error and the bit rate in bits per second. 
Digital Signal Processing 
2. Digital to Analog Converters (DACs) 
7 Quantization 
We begin with A/D converters, because they are used as the building 
blocks of successive approximation ADCs. 
Fig: B-bit D/A converter 
 Vector B input bits : b=[b1, b2,,bB]. Note that bB is the least 
significant bit (LSB) while b1 is the most significant bit (MSB). 
 For unipolar signal, xQ є [0, R); for bipolar xQ є [-R/2, R/2). 
Digital Signal Processing 
2. DACs 
8 Quantization 
Fig: DAC using binary weighted resistor 
Rf 
31 2 4
2 4 8 16
REF
f f f f
bb b b
I V
R R R R

31 2 4
2 4 8 16
Q OUT f REF
bb b b
x V I R V
  

16Rf 8Rf 4Rf 2Rf 
xQ=Vout 
-VREF 
 iI
LSB 
MSB 
b1 
bB 
 4 3 2 1 0 3 2 1 01 2 3 4 1 2 3 42 2 2 2 2 2 2 2 2Qx R b b b b Q b b b b 
 Full scale R=VREF, B=4 bit 
Digital Signal Processing 
2. DACs 
9 Quantization 
 Unipolar natural binary 
where m is the integer whose binary representation is b=[b1, b2,,bB]. 
1 2 0
1 22 2 ... 2
B B
Bm b b b
 Bipolar offset binary: obtained by shifting the xQ of unipolar natural 
binary converter by half-scale R/2: 
1 2
1 2( 2 2 ... 2 )
B
Q Bx R b b b Qm
1 2
1 2( 2 2 ... 2 )
2 2
B
Q B
R R
x R b b b Qm 
 Two’s complement code: obtained from the offset binary code by 
complementing the most significant bit, i.e., replacing b1 by . 
1 2
1 2( 2 2 ... 2 )
2
B
Q B
R
x R b b b 
1 11b b 
Digital Signal Processing 
Example 2 
10 Quantization 
 A 4-bit D/A converter has a full-scale R=10 volts. Find the quantized 
analog values for the following cases ? 
a) Natural binary with the input bits b=[1001] ? 
b) Offset binary with the input bits b=[1011] ? 
c) Two’s complement binary with the input bits b=[1101] ? 
Digital Signal Processing 
3. A/D converters 
11 Quantization 
 A/D converters quantize an analog value x so that is is represented 
by B bits b=[b1, b2,,bB]. 
Fig: B-bit A/D converter 
Digital Signal Processing 
3. A/D converters 
12 Quantization 
One of the most popular converters is the successive approximation 
A/D converter 
Fig: Successive approximation A/D converter 
 After B tests, the successive approximation register (SAR) will hold 
the correct bit vector b. 
Digital Signal Processing 
3. A/D converters 
13 Quantization 
This algorithm is applied for the natural and offset binary with 
truncation quantization. 
where the unit-step function is defined by 
1 0
( )
0 0
if x
u x
if x
 Successive approximation algorithm 
Digital Signal Processing 
Example 3 
14 Quantization 
 Consider a 4-bit ADC with the full-scale R=10 volts. Using the 
successive approximation algorithm to find offset binary of 
truncation quantization for the analog values x=3.5 volts and x=-1.5 
volts. 
Test b1b2b3b4 xQ C = u(x – xQ) 
b1 1000 0,000 1 
b2 1100 2,500 1 
b3 1110 3,750 0 
b4 1101 3,125 1 
1101 3,125 
Digital Signal Processing 
3. A/D converter 
15 Quantization 
 For rounding quantization, we 
shift x by Q/2: 
 For the two’s complement 
code, the sign bit b1 is treated 
separately. 
Digital Signal Processing 
Example 4 
16 Quantization 
 Consider a 4-bit ADC with the full-scale R=10 volts. Using the 
successive approximation algorithm to find offset and two’s 
complement of rounding quantization for the analog values x=3.5 
volts. 
Digital Signal Processing 
Oversampling noise shaping 
17 Quantization 
HNS(f) 
e(n) 
ε(n) xQ(n) x(n) 
-fs/2 fs/2 0 
f 
Pee(f) 
f’s/2 -f’s/2 
s
e
f
2
'
2'
s
e
f

'
2'
2
e'
2'2
s
e
s
s
e
s
e
f
f
ff



Digital Signal Processing 
Oversampling noise shaping 
18 Quantization 
Digital Signal Processing 
Dither 
19 Quantization 
Digital Signal Processing 
Uniform and non-uniform quantization 
20 Quantization 
Digital Signal Processing 
Mid-riser and mid-tread quantization 
21 Quantization 
Digital Signal Processing 
Bonus 2.1 
22 Quantization 
Write a program to simulate DAC. 
DAC 
b1 
b2 
b3 
bB 
MSB 
LSB 
R (full-scale range) 
xQ 
Digital Signal Processing 
Bonus 2.2 
23 Quantization 
Write a program to simulate ADC. 
MSB 
LSB 
ADC 
b1 
b2 
b3 
bB 
R (full-scale range) 
x(n) 
Digital Signal Processing 
Review 
24 Quantization 
Các thông số cơ bản của quá trình lượng tử hóa? 
Quan hệ giữa các nguyên tắc lượng tử? 
Quan hệ giữa các nguyên tắc mã hóa? 
Tính chất của sai số lượng tử? 
Hiệu quả của lấy mẫu dư và định dạng nhiễu? 
Hiệu quả của dither? 
Giải thuật test bit? 
Xác định mức lượng tử và các bit lượng tử? 
Xác định dung lượng cần lưu trữ? 
Xác định tốc độ xử lý yêu cầu của chip DSP? 
Digital Signal Processing 
Homework 1 
25 Quantization 
 Cho bộ lượng tử và mã hóa nhị phân tự nhiên B = 5 bit hoạt động 
theo nguyên tắc làm tròn gần nhất (rounding) với khoảng lượng tử 
đều Q = 1.1@ (biết 0 là giá trị lượng tử nhỏ nhất). 
a) Xác định giá trị lượng tử lớn nhất? 
b) Kiểm tra xem liệu giá trị 20.10 có là giá trị lượng tử hay không? 
c) Xác định giá trị lượng tử tương ứng với từ mã 10011? 
d) Xác định từ mã của mẫu tín hiệu ngõ vào 20.10? 
e) Làm lại câu d trong trường hợp B = 8 bit? 
Digital Signal Processing 
Homework 2 
26 Quantization 
 Cho bộ lượng tử và mã hóa nhị phân tự nhiên 8 bit hoạt động theo 
nguyên tắc làm tròn gần nhất (rounding) với khoảng lượng tử đều 
Q = 0.4@ (biết 0 là giá trị lượng tử nhỏ nhất). 
a) Xác định giá trị lượng tử lớn nhất? 
b) Kiểm tra xem liệu giá trị 24.04 có là giá trị lượng tử hay không? 
c) Xác định giá trị lượng tử tương ứng với từ mã 00111101? 
d) Xác định từ mã của mẫu tín hiệu ngõ vào 20.13? 
e) Dùng giải thuật test bit, xác định từ mã của mẫu tín hiệu ngõ vào 
25.03? 
f) Đề xuất 1 giải pháp để thực hiện lượng tử theo nguyên tắc rút bớt 
(làm tròn xuống) trong trường hợp vẫn sử dụng bộ lượng tử và mã 
hóa hoạt động theo nguyên tắc làm tròn trên? 
Digital Signal Processing 
Homework 3 
27 Quantization 
 Cho bộ lượng tử và mã hóa nhị phân tự nhiên 8 bit hoạt động theo 
nguyên tắc làm tròn với khoảng lượng tử đều Q = 0.1@ (biết 0 là 
giá trị lượng tử nhỏ nhất). 
a) Xác định giá trị lượng tử lớn nhất? 
b) Xác định giá trị lượng tử tương ứng với từ mã 11100011? 
c) Xác định từ mã của mẫu tín hiệu ngõ vào 22.07? 
d) Dùng giải thuật test bit, xác định từ mã của mẫu tín hiệu ngõ vào 
9.05? 
e) Giả sử tín hiệu phân bố đều trong tầm hoạt động, tính tỉ số công 
suất tín hiệu trên nhiễu SNR của bộ lượng tử trên? 
Digital Signal Processing 
Homework 4 
28 Quantization 
 Cho bộ lượng tử lưỡng cực đối xứng hoạt động theo nguyên tắc 
làm tròn với khoảng lượng tử đều Q = 0.2@ (biết 0 là một giá trị 
lượng tử) và mã hóa nhị phân 8 bit dạng bù 2. 
a) Xác định giá trị lượng tử lớn nhất và nhỏ nhất? 
b) Xác định giá trị lượng tử tương ứng với từ mã 10001000? 
c) Xác định từ mã của mẫu tín hiệu ngõ vào 1.64? 
d) Dùng giải thuật test bit, xác định giá trị lượng tử của mẫu tín hiệu 
ngõ vào 1.64? 
Digital Signal Processing 
Homework 5 
29 Quantization 
Một tín hiệu rời rạc được lượng tử và mã hóa bằng bộ chuyển 
đổi A/D 4 bit có tầm toàn thang R=1@ V dùng giải thuật xấp xỉ 
liên tiếp làm tròn xuống (truncation). 
a) Hãy xác định khoảng lượng tử Q? 
b) Tìm giá trị lượng tử xQ cho giá trị rời rạc x=2.75 V và từ mã 
b=[b1 b2 b3 b4] tương ứng cho mã offset? 
c) Lặp lại câu b) cho mã bù hai? 

File đính kèm:

  • pdfbai_giang_digital_signal_processing_chapter_2_quantization_n.pdf