0% found this document useful (0 votes)
68 views

Analog-To-Digital Conversion: Quantization

This document discusses analog-to-digital conversion through quantization of continuous signals into discrete digital signals. Quantization involves sampling the signal at discrete time intervals and encoding the amplitude at each time interval with a limited number of bits. The interval [-1,1] is divided into 2^p equal intervals, and the true value x is rounded to the closest interval center value xq. As the number of bits p decreases, the required storage space decreases but the rounding error introduced by quantization increases. This lab examines the impact of quantization on audio signals by generating quantized versions for varying values of p and measuring the signal-to-noise ratio.

Uploaded by

Adithya Rao
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)
68 views

Analog-To-Digital Conversion: Quantization

This document discusses analog-to-digital conversion through quantization of continuous signals into discrete digital signals. Quantization involves sampling the signal at discrete time intervals and encoding the amplitude at each time interval with a limited number of bits. The interval [-1,1] is divided into 2^p equal intervals, and the true value x is rounded to the closest interval center value xq. As the number of bits p decreases, the required storage space decreases but the rounding error introduced by quantization increases. This lab examines the impact of quantization on audio signals by generating quantized versions for varying values of p and measuring the signal-to-noise ratio.

Uploaded by

Adithya Rao
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/ 2

École Centrale de Nantes — Foundation Master - Signal, Control, Robotics

Computer Programming and Data Analysis

Analog-to-digital conversion: quantization

Theory: quantization principle


Any digital signal processing method requires the preliminary conversion of natural signals
(with continuous time and continuous amplitude) into digital ones (that is, sequences of bits),
which can be processed by a computer or by any digital device. Such analog-to-digital (A/D)
conversion essentially relies on two steps:

i) sampling consists in taking the values of the signal at discrete times;


ii) quantization consists in encoding the amplitude at each time with a limited number of bits.

This lab focuses on uniform quantization. Without loss of generality, we suppose that the given
signal takes values in [−1, 1]. The interval [−1, 1] is split into N = 2p intervals of same size,
say ∆, forming a grid of N points at the center. Then, quantization amounts to rounding the
true value x to its closest value among the interval centers, noted xq .
Figure 1 shows the value of xq as a function of x.
1
0.75
0.5
0.25
0
-0.25
-0.5
-0.75
-1
-1 0 1

Figure 1: Quantification curve: xq is a “rounded” version of x on a grid made of N = 2p points


(here, N = 8). Horizontal lines show the quantization intervals, of size ∆.

1. How many different values can be encoded?


2. What is the expression of ∆ as a function of p?
3. Give a mathematical expression of xq as a function of x and ∆.

Such quantization introduces modifications (rounding errors) on the signal. On the other
hand, removing 1 bit (p → p − 1) decreases the space required in memory / for storage by a
factor of two. In this lab, we study the impact of quantization on the quality of audio signals.
Lab: study of quantization on audio signals
Tip: write all your Matlab instructions in a unique file (example quantization.m).

1. Download the audio file 'LedZeppelin.wav' available on the web server. From Matlab,
read associated information (audioinfo('LedZeppelin.wav')).
What value of p was used for generating this file?

2. Load the audio content in Matlab: [x,Fs] = audioread('LedZeppelin.wav'), where


x contains the data samples and Fs is the sampling rate. Plot the signal as a function of
time, using an appropriate time axis. Play the sound from Matlab: soundsc(x,Fs);

We will now generate quantized signals at a lower number of bits and listen to the results.
Repeat the following steps, for varying values of p (between 16 and 1, use for loop).

6. Build the signal xq obtained after quantization with p bits (see Question 3 in first page).

7. Plot the quantized signal xq as a function of time on the same graph as the initial one (use
appropriate colors, and give a title containing the value of p). Can you see any difference?
Zoom in to see details.

8. Listen to the quantized signal. Can you hear any difference?

9. Measure the error between the two signals by the signal-to-noise ratio:

kxk2
SNRdB = 10 log10 ,
kx − xqk2

and store the value of SNR for each p.

10. You can also plot the error signal x - xq.

11. Draw the graph that represents the signal-to-noise ratio as a function of p. What can you
conclude?

12. Compute and draw the linear regression of such curve (polynomial regression of order 1).
This result has a proof with probabilities. We will discuss it later.

13. Optional, but funny. Record a speech signal with your computer, and repeat the experi-
ment with it. Until which value of p can you understand the speech?

14. Optional, but funny, too. Repeat the experiments with any image of your choice (replacing
soundsc by imagesc!). Example: A=double(imread('cameraman.tif'));.
Be aware, pixel values in black and white or RGB images are usually encoded as integers
(with 8 bits) between 0 and 255. Center and normalize the image first: A = (A-128)/128;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy