<< Chapter < Page Chapter >> Page >

Quantization can be thought of as a functional mapping y = f ( x ) of a real-valued input to a discrete-valued output. An example of a quantization function is shown in [link] , where the x-axis is the input value, and the y-axis is the quantizedoutput value.

Input-output relation for a 7-level uniform quantizer.

Quantization and compression

Quantization is sometimes used for compression. As an example, suppose we have a digital image which isrepresented by 8 different gray levels: [0 31 63 95 159 191 223 255].To directly store each of the image values, we need at least 8-bits for each pixel since the values range from 0 to 255.However, since the image only takes on 8 different values, we can assign a different 3-bit integer (a code) to represent each pixel:[000 001 ... 111].Then, instead of storing the actual gray levels, we can store the 3-bit code for each pixel.A look-up table, possibly stored at the beginning of the file, would be used to decode the image.This lowers the cost of an image considerably: less hard drive space is needed, and less bandwidth is required to transmit the image (i.e. itdownloads quicker). In practice, there are much more sophisticated methods of compressing imageswhich rely on quantization.

Image quantization

Download the file fountainbw.tif for the following section.

The image in fountainbw.tif is an 8-bit grayscale image. We will investigate what happens when we quantize it to fewer bitsper pixel (b/pel). Load it into Matlab and display it using the following sequence ofcommands:

y = imread('fountainbw.tif');

image(y);

colormap(gray(256));

axis('image');

The image array will initially be of type uint8 , so you will need to convert the image matrix to type double before performing any computation. Use the command z=double(y) for this.

There is an easy way to uniformly quantize a signal. Let

Δ = M a x ( X ) - M i n ( X ) N - 1

where X is the signal to be quantized, and N is the number of quantization levels.To force the data to have a uniform quantization step of Δ ,

  • Subtract Min(X) from the data and divide the result by Δ .
  • Round the data to the nearest integer.
  • Multiply the rounded data by Δ and add Min(X) to convert the data back to its original scale.

Write a Matlab function Y = Uquant(X,N) which will uniformly quantize an input array X (either a vector or a matrix) to N discrete levels. Use this function to quantize the fountain image to7 b/pel, 6, 5, 4, 3, 2, 1 b/pel, and observe the output images.

Remember that with b bits, we can represent N = 2 b gray levels.
Print hard copies of only the 7, 4, 2, and 1 b/pel images, as well as the original.

Inlab report

  1. Describe the artifacts (errors) that appear in the image as the number of bits is lowered?
  2. Note the number of b/pel at which the image quality noticeably deteriorates.
  3. Hand in the printouts of the above four quantized images and the original.
  4. Compare each of these four quantized images to the original.

Audio quantization

Download the files speech.au and music.au for the following section.

If an audio signal is to be coded, either for compression or for digital transmission, it must undergo some form of quantization.Most often, a general technique known as vector quantization is employed for this task, but this technique must be tailored to thespecific application so it will not be addressed here. In this exercise, we will observe the effect of uniformlyquantizing the samples of two audio signals.

Questions & Answers

how to create a software using Android phone
Wiseman Reply
how
basra
what is the difference between C and C++.
Yan Reply
what is software
Sami Reply
software is a instructions like programs
Shambhu
what is the difference between C and C++.
Yan
yes, how?
Hayder
what is software engineering
Ahmad
software engineering is a the branch of computer science deals with the design,development, testing and maintenance of software applications.
Hayder
who is best bw software engineering and cyber security
Ahmad
Both software engineering and cybersecurity offer exciting career prospects, but your choice ultimately depends on your interests and skills. If you enjoy problem-solving, programming, and designing software syste
Hayder
what's software processes
Ntege Reply
I haven't started reading yet. by device (hardware) or for improving design Lol? Here. Requirement, Design, Implementation, Verification, Maintenance.
Vernon
I can give you a more valid answer by 5:00 By the way gm.
Vernon
it is all about designing,developing, testing, implementing and maintaining of software systems.
Ehenew
hello assalamualaikum
Sami
My name M Sami I m 2nd year student
Sami
what is the specific IDE for flutter programs?
Mwami Reply
jegudgdtgd my Name my Name is M and I have been talking about iey my papa john's university of washington post I tagged I will be in
Mwaqas Reply
yes
usman
how disign photo
atul Reply
hlo
Navya
hi
Michael
yes
Subhan
Show the necessary steps with description in resource monitoring process (CPU,memory,disk and network)
samuel Reply
What is software engineering
Tafadzwa Reply
Software engineering is a branch of computer science directed to writing programs to develop Softwares that can drive or enable the functionality of some hardwares like phone , automobile and others
kelvin
if any requirement engineer is gathering requirements from client and after getting he/she Analyze them this process is called
Alqa Reply
The following text is encoded in base 64. Ik5ldmVyIHRydXN0IGEgY29tcHV0ZXIgeW91IGNhbid0IHRocm93IG91dCBhIHdpbmRvdyIgLSBTdGV2ZSBXb3puaWFr Decode it, and paste the decoded text here
Julian Reply
what to do you mean
Vincent
hello
ALI
how are you ?
ALI
What is the command to list the contents of a directory in Unix and Unix-like operating systems
George Reply
how can i make my own software free of cost
Faizan Reply
like how
usman
hi
Hayder
The name of the author of our software engineering book is Ian Sommerville.
Doha Reply
what is software
Sampson Reply
the set of intruction given to the computer to perform a task
Noor
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Purdue digital signal processing labs (ece 438). OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10593/1.4
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?

Ask