You are on page 1of 9

2015

Quantization

Author: Rakesh
Email id: rakesh@tenettech.com

What is Gnu radio?


GNU Radio is a software library, which can be used to develop complete applications for
radio engineering and signal processing.
Introduction
GNU Radio is a free and open-source software development toolkit that provides
signal processing blocks to implement software radios. It can be used with readilyavailable low-cost external RF hardware to create software-defined radios, or without
hardware in a simulation-like environment.
GNU Radio is licensed under the GNU General Public License (GPL) version 3. All of
the code is copyright of the Free Software Foundation. While all the applications are
implemented using python language while critical signal processing path is done using
C++ language.
Idea behind GNURADIO
The goal is to give ordinary software people the ability to 'hack' the electromagnetic
spectrum, i.e. to understand the radio spectrum and think of clever ways to use it.
Why GNURADIO
Instead of purchasing multiple expensive radios, a single generic radio can be
implemented using GNU Radio software and with support of minimal hardware to
receive and transmit processed signal at required frequencies and any data type can be
passed from one block to another i.e.it can be in bits, bytes, vectors, bursts or more
complex data types
Since the performance critical blocks are implemented in C++ using processor floating
point extensions the developers are able to implement real-time, high-throughput radio
systems in a simple-to-use, rapid-application-development environment.

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726, Website: www.tenettech.com, Email: info@tenettech.com

One can use it to write applications to receive data out of digital streams or to send data
into digital streams, which is then transmitted using hardware. GNU Radio has filters,
channel codes, synchronisation elements, equalizers, demodulators, vocoders, decoders,
and many other elements which are called as blocks that are typically found in radio
systems.
Features
The main features of GNU Radio are flexibility and configurability.
Extending GNU Radio is also quite easy, if you find a specific block that is missing you
can quickly create and add it.

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726, Website: www.tenettech.com, Email: info@tenettech.com

What do you mean by quantization?


Quantization, in mathematics and digital signal processing, is the process of mapping a
large set of input values to a (countable) smaller set such as rounding values to some
unit of precision. A device or algorithmic function that performs quantization is called a
quantizer. The round-off error introduced by quantization is referred to as quantization
error.
In analog-to-digital conversion, the difference between the actual analog value and
quantized digital value is called quantization error or quantization distortion. This error is
either due to rounding or truncation. The error signal is sometimes modeled as an
additional random signal called quantization noise because of its stochastic behaviour.
Quantization is involved to some degree in nearly all digital signal processing, as the
process of representing a signal in digital form ordinarily involves rounding. Quantization
also forms the core of essentially all lossy compression algorithms.
Because quantization is a many-to-few mapping, it is an inherently non-linear and
irreversible process (i.e., because the same output value is shared by multiple input
values, it is impossible in general to recover the exact input value when given only the
output value).
The set of possible input values may be infinitely large, and may possibly be
continuous and therefore uncountable (such as the set of all real numbers, or all real
numbers within some limited range). The set of possible output values may be finite or
countably infinite. The input and output sets involved in quantization can be defined in
a rather general way. For example, vector quantization is the application of quantization
to multi-dimensional (vector-valued) input data.
There are two substantially different classes of applications where quantization is used:
The first type, which may simply be called rounding quantization, is the one employed
for many applications, to enable the use of a simple approximate representation for
some quantity that is to be measured and used in other calculations. This category
includes the simple rounding approximations used in everyday arithmetic. This
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726, Website: www.tenettech.com, Email: info@tenettech.com

category also includes analog-to-digital conversion of a signal for a digital signal


processing system (e.g., using a sound card of a personal computer to capture an audio
signal) and the calculations performed within most digital filtering processes. Here the
purpose is primarily to retain as much signal fidelity as possible while eliminating
unnecessary precision and keeping the dynamic range of the signal within practical
limits (to avoid signal clipping or arithmetic overflow). In such uses, substantial loss of
signal fidelity is often unacceptable, and the design often centers around managing the
approximation error to ensure that very little distortion is introduced.
The second type, which can be called ratedistortion optimized quantization, is
encountered in source coding for "lossy" data compression algorithms, where the
purpose is to manage distortion within the limits of the bit rate supported by a
communication channel or storage medium. In this second setting, the amount of
introduced distortion may be managed carefully by sophisticated techniques, and
introducing some significant amount of distortion may be unavoidable. A quantizer
designed for this purpose may be quite different and more elaborate in design than an
ordinary rounding operation. It is in this domain that substantial ratedistortion theory
analysis is likely to be applied. However, the same concepts actually apply in both use
cases.

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726, Website: www.tenettech.com, Email: info@tenettech.com

1) Quantization
The GNUradio Companion with basic blocks (Options block and Variable block)

Options block defines the ID, Title and Description of the experiment.

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726, Website: www.tenettech.com, Email: info@tenettech.com

Variable Block defines to declare variables globally. This block maps a value to a unique
variable. This variable block has no graphical representation. The variable can be referenced
(by ID) from other blocks in the flowgraph.
o ID = samp_rate
o Value = 32KHz

Signal source is a wave form genrator. Very first block genrates the sine wave, second block
genrates the square wave, third block genrates triangler wave and finaly fourth block genrates the
sawtooth waveform.

o ID:analog_sig_source_x_0
#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726, Website: www.tenettech.com, Email: info@tenettech.com

o Output type: float


o Freq: 1KHz
o Amplitude: 1V
Quantizer: Quantization is the procedure of constraining something from a continuous set of
values (such as the real numbers) to a relatively small discrete set (such as the integers).
o ID: channels_quantizer_0
o Bits: 3

WX GUI scope sink: The WX GUI Scope sink is the destination block of the flow chart. This
block is used to view the time domain representation of the output. The simulation output of
the received signal is seen with this block.
o ID: wxgui_scopesink2_0
o Type: float

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726, Website: www.tenettech.com, Email: info@tenettech.com

The Complete block representation

Genrated output

#9/3, Shree Lakshmi Complex, 2nd Floor, Opp. To Vivekananda Park, Girinagar, Bangalore - 560085.
Ph. No: 080-26722726, Website: www.tenettech.com, Email: info@tenettech.com