Sie sind auf Seite 1von 3

CARE, IIT Delhi

CRP718 2017-18/1st semester


Experiment on quantization of signals and system transfer functions

1. Objectives

1. Effect of quantization of signals.


2. Effect of quantization system.
3. Study of -law and A-law.

2. Introduction

In digital signal processing, quantization is the process of approximating a continuous


range of values (or a very large set of discrete values) by a relatively small set of
discrete symbols or integer values.

A common purpose of quantization is to convert a discrete-time signal (a sampled


continuous-time signal) into a digital signal. Both these steps viz. sampling and
quantization are performed in analog-to-digital converters with the quantization level
specified in bits per sample. A specific example would be a compact disc (CD) audio
which is sampled at 44,100 Hz and quantized with 16 bits per sample (2 bytes) which
can be one of 65,536 (i.e. 216) possible values per sample.

2.1 Mathematical description

The simplest and best-known form of quantization is referred to as scalar quantization,


since it operates on scalar (as opposed to multi-dimensional vector) input data. In
general, a scalar quantization operator can be represented as:

where x is a real number to be quantized, . is the floor function, yielding an integer


result that is sometimes referred to as the quantization index, f (x) and g (i)
are arbitrary real-valued functions.

The integer-valued quantization index i is the representation that is typically stored or


transmitted, and then the final interpretation is constructed using g (i) when the data is
later interpreted.

In computer audio and most other applications, a method known as uniform


quantization is most commonly used. If x is a real-valued number between -1 and 1, a
mid-rise uniform quantization operator that uses M bits of precision to represent each
quantization index can be expressed as:

.
(M1)
The value 2 is often referred to as the quantization step size. Using this
quantization law and assuming that quantization noise is approximately uniformly
distributed over the quantization step size (an assumption typically accurate for rapidly
varying x or high M) and further assuming that the input signal x to be quantized is

1
approximately uniformly distributed over the entire interval from -1 to 1, the signal to
noise ratio (SNR) of the quantization can be computed as:

From this equation, it is often said that the SNR increases approximately by 6 dB per
additional bit of quantization.

In digital telephony, two popular quantization schemes are the 'A-law' (dominant in
Europe) and '-law' (dominant in North America and Japan). These schemes map
discrete analog values to an 8-bit scale that is nearly linear for small values and then
increases logarithmically as the amplitude grows. This non-uniform quantization
provides higher signal-to-noise ratio for non-stationary signals with varying amplitude
such as speech for a given number of bits. This scheme approximates the ideal
compander in which the signal-to-quantization noise ratio (SQNR) is independent of
the signal level. The -law is given as,

where = 255 (8 bits) in the North American and Japanese standards, and A-law is:

where A = 87.6.

3. Experiment Objectives

Objective 1: Quantization of sinusoidal signals.

1. Generate one time-period of a sine wave of unit amplitude and frequency 500
Hz and sampling rate of 8000 Hz. Plot it. Label the axes.
2. Use 10, 8 and 4 bits to represent the values of the sine wave with a uniform
quantizer. Plot the quantized waveforms and label the axes.
3. Obtain the mean squared quantization errors between the unquantized and
quantized waveforms obtained by using the different bit representations.
4. Compute the SQNR for the different quantization cases from the results of step
3 and the mean squared signal energy of the unquantized signal over the signal
duration.

2
5. Repeat the experiment for 8-bit case by adding Gaussian noise of different
variances to the sine wave and plot the relation between SQNR and SNR.
6. Comment on the results.

Objective 2: Filter coefficient quantization.


Consider the filter transfer function:

1. Plot the magnitude frequency response in dB, and pole-zero plot of the filter.
2. Represent the coefficients using 2-bit quantization for each coefficient. Plot the
magnitude response in dB. Also, plot the pole-zeros in the z-plane.
3. Repeat step 2 with 3-bit quantization for each coefficient and comment on the
result.

Objective 3: -law quantization.


Generate one time-period of a sine wave with unit amplitude, frequency of 500
Hz, and sampled at 8000 Hz.
1. Assume = 255, and plot F(x) as a function of x.
2. Repeat the experiment for = 31.
3. Give the binary represention of the signal for 8-bit quantization and = 255.
4. Compute the mean square quantization error in each case in step 3 above and
compare the results with uniform quantization.
5. Draw one time-period of -law quantized sine wave.
6. Comment on the results.

Objective 4: Uniform quantization of an audio file.


1. Use the music.wav file to study the effect of quantization.
2. Read the file in Matlab using wavread function.
3. Study the effect of uniform quantization on this music file by using 4, 8 and 12
bits per sample quantization using wavwrite function. Observe by listening to
the music.
4. Comment on the results.

Self-study Component

Topics: Uniform and non-uniform scalar quantization, signal-to-quantization noise


ratio for n-bit uniform quantizer, compander or logarithmic quantizer, effect of
coefficient quantization in FIR and IIR digital filters.

Reference: 1) A. Gersho and R. M. Gray, Vector quantization and signal compression,


Kluwer Academic Publishers, 1991.
2) A. V. Oppenheim, R. W. Schafer, Discrete-time signal processing, Third edition,
Pearson, 2014.

Das könnte Ihnen auch gefallen