Download as pdf or txt
Download as pdf or txt
You are on page 1of 67

SDR IN COGNITIVE RADIO WITH SPECTRAL ANALYSIS AND

WINDOW MANAGEMENT

Submitted by

KONDAVEETI PHANI KIRAN (U17EC371)


DUVVURU BHANU PRAKASH YADAV (U17EC375)
SINGALA VIJAY KUMAR (U17EC373)

In partial fulfillment for the award of the degree of


BACHELOR OF TECHNOLOGY
IN
ELECTRONICS & COMMUNICATION ENGINEERING
PROJECT GUIDED BY
Dr.S.V.MAHESH KUMAR

ASSOCIATE PROFESSOR

DEPARTMENT OF ELECTRONICS& COMMUNICATION


ENGINEERING
BHARATH INSTITUTE OF HIGHER EDUCATION AND RESEARCH
APRIL 2021

BHARATH INSTITUTE OF HIGHER EDUCATION AND RESEARCH


BHARATH INSTITUTE OF SCIENCE AND TECHNOLOGY

CHENNAI – 600073, INDIA.

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

BONAFIDE CERTIFICATE
This is to certify that this project entitled “SDR IN COGNITIVE RADIO WITH
SPECTRAL ANALYSIS AND WINDOW MANAGEMENT “is the bonafide
work of KONDAVEETI PHANI KIRAN (U17EC371), DUVVURU BHANU
PRAKASH YADAV (U17EC375),SINGALA VIJAY KUMAR (U17EC373), who
carried out the project work under our supervision. Certified further that to the best
of my knowledge the work reported herein does not form part of any other thesis or
dissertation on the basis of which a degree or award was conferred on an earlier
occasion on this or any other candidate.

HEAD OF THE DEPARTMENT SUPERVISOR


Dr. M. SANGEETHA Dr.S.V.MAHESH KUMAR
Professor, Associate Professor,
Department of ECE Department of ECE
BIHER, BIHER
Chennai – 600073 Chennai - 600073

Submitted for the Project Viva-Voce examination held on ……...…………….

INTERNAL EXAMINER EXTERNAL EXAMINER


ACKNOWLEDGEMENT

First of all, I express my sincere thankfulness to the almighty, for bestowing his blessings
throughout this project work. I express my gratitude to my parents for their care, support, prayers
and love.

My sincere thanks to our Honorable Chairman Dr.S. Jagathrakshakan, Honorable President, Dr.
J.SundeepAanand and Managing director Dr .E.Swetha Sundeep Aanand, Bharath Institute of
Higher Education and Research, for their kind words and enthusiastic motivation which has
inspired me a lot in completing my Project.

I would like to express my deep gratitude to our Vice Chancellor Dr.V.Kanagasabai, Pro Vice
Chancellor Academics Dr.M.Sundararajan,Pro Vice Chancellor Research Dr.K.Vijaya Bhaskar
Raju, Registrar Dr.S.Bhuminathan, Director Professor. S.Theagarajan, Pro Vice Chancellor and
Controller of Examinations Dr. R.M.Suresh, Dean-Engineering Dr. J.Hameed Hussain who are
responsible for moulding my thoughts in completing my Project.

I am grateful to Dr.M. Prem Jayakumar (Dean R & D) for his valuable suggestions, kind co-
operation and encouragement during the course of my study.

I wish to express my sincere profound gratitude to my esteemed and endowed Project guide Dr
.s.v.Mahesh Kumar, for his inspiring guidance, healthy criticism, valuable suggestions and
constant encouragement throughout the period of project.

I am thankful to the Head of the Department Dr M.Sangeetha, Project co- coordinator


Dr.M.Jasmin,and all staff members of the Department of Electronics &Communication
Engineering, BIHER, for their encouragement and guidance throughout the course of this project
work.

I sincerely wish to express my thanks to the staff members of Library, BIHER for their valuable
support during this project work. I would like to thank the authors of various journals and books
whose works and results are used in the project.
CHAPTER TITLE
NO PAGE
NO

ABSTRACT 5

1 INTROUCTION 6

1.1 Introduction To Software Defined 6


Ratio
1.2 A Brief History of Software 7
Defined Radio
1.3 Role of Software Defined Radio 7

1.3.1 Problems Faced by Wireless 7


Communication Industry
1.3.2 How SDR Solves The Problems 8

1.4 Features of SDR Technology 9

2 LITERATURE REVIEW

2.1 A Vision of Cognitive Radio 10

2.2 History Leading to Cognitive Radio 10

2.3 Information on Cognitive Radio 11

2.3.1 What is Cognitive Radio 11

2.3.2 Types of Cognitive Radio 13

2.4 Cognitive Radio Network 14


Paradigms
2.4.1 Underlay Paradigm 14

2.4.2 Overlay Paradigm 15

2.4.3 Interweave Paradigm 15

1
3 PROPOSED METHOD

3.1 Algorithm 16

3.2 Spectrum Sensing Technique 18

4 IMPLEMENTATION

4.1 Related Theory 19

4.1.2 About MATLAB & SIMULINK 19


MATLAB
4.2 Software Descriptions 20

4.3 The MATLAB consist of These 21


Main Parts
4.3.1 Desktop Tools And Development 20
Environment
4.3.2 MATLAB Mathematical Function 20
Library
4.3.3 MATLAB Language 21

4.4 Graphics 22

4.5 MATLAB Applications 22

4.5.1 MATLAB External Interfaces 22

4.5.2 Image Processing Toolbox 22

4.6 Key features 23

4.7 Importing And Exporting Images 23

4.8 Displaying And Exploring Images 24

4.9 Preprocessing and Postprocessing 25


Images
4.10 Analyzing Images 26

4.11 Working With Large Images 28

2
5 SOFTWARE IMPLEMENTATION 29

5.1 Toolboxes Available in MATLAB 29

5.1.1 Communications Toolbox 29

5.1.2 Control System Toolbox31 29

5.1.3 Data Acquisition Toolbox 30

5.1.4 Filter Design Toolbox 30


5.1.5 Financial Derivatives Toolbox 31

5.1.6 Financial Toolbox34 31


5.1.7 Fuzzy Logic Toolbox 31
5.1.8 Instrument Control Toolbox34 31

5.1.9 Mapping Toolbox 32

5.1.10 Model Predictive Toolbox 32

5.1.11 Neural Network Toolbox 33

5.1.12 Optimizing Toolbox 33

5.1.13 Partial Differential Equation 33

5.1.14 Robust control Toolbox38 34

5.1.15 Signal Processing Toolbox 34

5.1.16 Spline Toolbox 34

5.1.17 Statics Toolbox 35

5.1.18 Symbolic Math Toolbox 35

5.1.19 System Identification Toolbox 36

5.1.20 Wavelet Toolbox 36

3
5.2 DSB-SC AM Modulation 37

5.3 Power Spectral Density 37

5.4 MATLAB Code 38

6 SPECTRAL 39
ANALYSIS
6.1 Computing The DFT,IDFT, and 39
Using Them for Filtering
6.2 Sampled Signal 42

6.3 DFT Computation 43

6.4 Spectral resolution and Windowing 46

7 RESULTS 57

8 CONCLUSION 63

4
SDR IN COGNITIVE RADIO WITH SPECTRAL
ANALYSIS

Abstract:
Software Defined Radio (SDR) is one of possibilities to realize the structure of
device with a high mobility, flexibility and reconfigurability. Extending the flexibility
further, a system capable to sense the spectrum space available for communication and
adapt to it is Cognitive Radio.Cognitive radio is envisioned as the ultimate system that
can sense, adapt and learn from the environment in which it operates. Sensing the
available bandwidth an SDR (Software defined radio) in a Cognitive System, tunes the
circuits in the System for transferring data at optimum data rates, permissible by the
space available. So it is a must for the SDR to accordingly add processing circuits to
maintain the System performance at variable working frequencies. Cognitive radio and
also presents some useful results obtained to configure the SDR for higher bandwidth
available in Cognitive Radio. Results of Frequency Hopping Spread Spectrum (FHSS)
implementation, Codec Algorithm modifications, and decoder iterations variation and
Performance improvement using OQPSK are depicted in the paper

5
CHAPTER 1
INTRODUCTION

1.1 Introduction to Software-Defined Radio


With the exponential growth in the ways and means by which people need to
communicate - data communications, voice communications, video communications,
broadcast messaging, command and control communications, emergency response
communications, etc. - modifying radio devices easily and cost-effectively has become
business critical. Software defined radio (SDR) technology brings the flexibility, cost
efficiency and power to drive communications forward, with wide-reaching benefits
realized by service providers and product developers through to end users.

Simply put Software Defined Radio is defined as:


"Radio in which some or all of the physical layer functions are software defined"

Software-Defined Radio (SDR) refers to the technology wherein software modules


running on a generic hardware platform consisting of DSPs and general purpose
microprocessors are used to implement radio functions such as generation of
transmitted signal (modulation) at transmitter and tuning/detection of received radio
signal (demodulation) at receiver.

SDR technology can be used to implement military, commercial and civilian radio
applications. A wide range of radio applications like Bluetooth, WLAN, GPS, Radar,
WCDMA, GPRS, etc. can be implemented using SDR technology.

Traditional hardware based radio devices limit cross-functionality and can only be
modified through physical intervention. This results in higher production costs and
minimal flexibility in supporting multiple waveform standards. By contrast, software
defined radio technology provides an efficient and comparatively inexpensive solution
to this problem, using software upgrades. SDR defines a collection of hardware and
software technologies where some or all of the radio’s operating functions are
implemented through modifiable software or firmware operating on programmable
processing technologies.

6
1.2 A Brief History of SDR

An SDR is a radio in which the properties of carrier frequency, signal bandwidth,


modulation, and network access are defined by software. Today’s modern SDR also
implements any necessary cryptography; forward error correction (FEC) coding; and
source coding of voice, video, or data in software as well.
The roots of SDR design go back to 1987, when Air Force Rome Labs (AFRL) funded
the development of a programmable modem as an evolutionary step beyond the
architecture of the integrated communications, navigation, and identification
architecture (ICNIA).

Today’s SDR, in contrast, is a general-purpose device in which the same radio tuner
and processors are used to implement many waveforms at many frequencies. The
advantage of this approach is that the equipment is more versatile and cost effective.

1.3 Role of SDR

1.3.1 Problems faced by Wireless Communication Industry


 Commercial Wireless network standards are continuously evolving from 2G to
2.5G/3G and then to 4G. The difference in networks of each generation being
significantly in link-layer protocol standards cause problems to subscribers,
wireless network operators and equipment vendors.

 Subscribers are forced to buy new handsets whenever a new generation of


network standards is deployed. Wireless network operators face problems
during migration of the network from one generation to next due to presence of
large number of subscribers using legacy handsets that may be incompatible
with newer generation network. The network operators also need to incur high
equipment costs when migrating from one generation to next. Equipment
vendors face problems in rolling out newer generation equipment due to short
time-to-market requirements.

7
 The air interface and link-layer protocols differ across various geographies (for
e.g. European wireless networks are predominantly GSM/TDMA based while
in USA the wireless networks are predominantly IS95/CDMA based). This
problem has inhibited the deployment of global roaming facilities causing great
inconvenience to subscribers who travel frequently from one continent to
another. Handset vendors face problems in building viable multi-mode handsets
due to high cost and bulky nature of such handsets.

 Wireless network operators face deployment issues while rolling-out new


services/features to realize new revenue-streams since this may require large-
scale customizations on subscribers’ handsets.

1.3.2 How SDR solves the problems

 For equipment manufacturers SDR enables a family of products to be


implemented using common platform architecture, allowing new products to be
more quickly introduced into the market.

 Software can be reused across the products, reducing development costs


dramatically.

 For Wireless Network Operators SDR enables new features and capabilities to
be added to existing infrastructure without requiring major new capital
expenditures.

 Remote software downloads, through which capacity can be increased,


capability upgrades can be activated and new revenue generating features can
be inserted.

 For subscribers SDR technology reduces costs by enabling them to communicate


with whomever they need, whenever they need to and in whatever manner is
appropriate.

8
SDR technology has some drawbacks like higher power consumption, higher
processing power (MIPS) requirement and higher initial costs. SDR technology may
not be suitable for all kinds of radio equipment due to these factors. Hence these factors
should be carefully considered before using SDR technology in place of complete
hardware solution. For e.g., SDR technology may not be appropriate in pagers while it
may offer great benefits when used to implement base-stations.

1.4 Features of SDR technology

Reconfigurability: The SDR provides flexibility in system design. Reconfigurability


provides essential mechanisms to terminals and network segments to adapt
dynamically, transparently and securely to the most appropriate radio access
technology via selecting pre-installed software components or via software
downloading and installation. The wireless network infrastructure can reconfigure itself
to subscriber's handset type or the subscriber's handset can reconfigure itself to network
type.

Ubiquitous Connectivity: SDR helps in realizing global roaming facility. If the


terminal is incompatible with the network technology in a particular region, an
appropriate software module needs to be installed onto the handset resulting in
seamless network access across various geographies.

Interoperability: SDR facilitates implementation of open architecture radio systems.


End-users can seamlessly use innovative third-party applications on their handsets as
in a PC system. This enhances the appeal and utility of the handsets.

9
CHAPTER 2
LITERATURE REVIEW

2.1 A vision of Cognitive Radio


The long term vision of cognitive radio technology is one in which handsets would
automatically make use of underutilized spectrum across a broad frequency range,
allowing the high bandwidth requirements of the future. If a radio were smart, it could
learn services available in locally accessible wireless computer networks, and could
interact with those networks in their preferred protocols, to have no confusion in finding
the right wireless network for a video download or a printout. Additionally, it could use
the frequencies and choose waveforms that minimize and avoid interference with
existing radio communication systems. It might be like having a friend in everything
that’s important to your daily life.

2.2 History Leading to Cognitive Radio

The sophistication possible in a software-defined radio (SDR) has now reached the
level where each radio can conceivably perform beneficial tasks that help the user, help
the network, and help minimize spectral congestion.

The development of digital signal processing (DSP) techniques arose due to the efforts
of such leaders as Alan Oppenheim, Lawrence Rabiner, Ronald Schaefer, Ben Gold,
Thomas Parks, James McClellen, James Flanagan, Fred Harris, and James Kaiser.
These pioneers recognized the potential for digital filtering and DSP, and prepared the
seminal textbooks, innovative papers, and breakthrough signal processing techniques
to teach an entire industry how to convert analog signal processes to digital processes.
Meanwhile, the semiconductor industry, continuing to follow Moore’s law, evolved to
the point where analog functions implemented with large discrete components were
replaced with digital functions implemented in silicon, and consequently were more
producible, less expensive, more reliable, smaller, and of lower power.

During this same period, researchers all over the globe explored various
techniques to achieve machine learning and related methods for improved machine
behavior. Among these were analog threshold logic, which lead to fuzzy logic and
neural networks, a field founded by Frank Rosenblatt. In networking, DARPA and
industrial developers

10
at Xerox, BBN Technologies, IBM, ATT, and Cisco each developed computer-
networking techniques, which evolved into the standard Ethernet and Internet we all
benefit from today. The researchers are exploring wireless networks that range from
access directly via a radio access point to more advanced techniques in which
intermediate radio nodes serve as repeaters to forward data packets toward their
eventual destination in an ad hoc network topology. Cognitive radios are nearly always
applications that sit on top of an SDR, which in turn is implemented largely from digital
signal processors and general-purpose processors (GPPs) built in silicon.

2.3 Information on Cognitive Radio


2.3.1 What is Cognitive Radio?
There are many definitions of CR and definitions are still being developed both in
academia and through standards bodies such as defined in as :
A cognitive radio is a wireless communication system that intelligently utilizes any
available side information about the –
a) Activity,
b) Channel conditions,
c) Codebooks,
d) Messages of other nodes with which it shares the spectrum.

CR implies intelligent signal processing (ISP) at the physical layer of a wireless system,
i.e. the layer that performs functions such as communications resource management,
access to the communications medium, etc. Usually, it is accompanied by ISP at higher
layers of the Open System Interconnection (OSI) model. If ISP is not implemented at
these higher layers then a CR will be restricted in what it can do. Because a
communication exchange uses all seven OSI layers, ideally all seven layers need to be
flexible if the CR’s intelligence is to be fully exploited. Without optimization of all the
layers, spectrum efficiency gains may not be optimized.

11
Fig 2.1 The 7 layers of OSI Model
The idea of cognitive radio was born because of spectrum shortage. These devices
utilize advanced radio and signal-processing technology along with novel spectrum-
allocation policies to support new wireless users operating in the existing crowded
spectrum without degrading the performance of entrenched users. A cognitive radio
must collect and process information about coexisting users within its spectrum, which
requires advanced sensing and signal-processing capabilities. The larger barrier is the
requirement for significant changes in the way wireless spectrum is currently allocated
to enable cognitive techniques.

Licensed frequency bands today are the radio and television bands, cellular and satellite
bands, and air traffic control bands. The main advantage of the licensing approach is
that the licensee completely controls its assigned spectrum, and can thus unilaterally
manage interference between its users and hence their quality of service (QoS).

In addition to the licensed spectrum, in recent years spectrum has been set aside in
specific frequency bands that can be used without a license by radios following a
specific set of etiquette rules, such as a maximum power per hertz or a shared channel
access mechanism. The purpose of these unlicensed bands is to encourage innovation
without the high cost to entry associated with purchasing licensed spectrum through
auctions. The unlicensed bands have proven a great vehicle for innovation, and the 2.4
GHz unlicensed band currently hosts systems such as Bluetooth, 802.11b/g/n Wifi, and

12
cordless phones. Unfortunately, the unlicensed bands can be killed by their own
success, since the more devices that occupy these bands, the more interference they
cause to each other.

Spectrum allocation is not just limited to licensed and unlicensed paradigms. The
licensed or unlicensed bands may accommodate many additional wireless devices if
these devices can exploit advanced technology to only minimally disrupt the
communications of coexisting non-cognitive devices. Cognitive radio originated in the
form of various solutions to this problem that allow cognitive communication with
minimal impact on non-cognitive users.

2.3.2 Types of Cognitive Radio System:


Depending on the set of parameters taken into account in deciding on transmission and
reception changes, and for historical reasons, we can distinguish certain types of
cognitive radio. The main two are:
• Full Cognitive Radio ("Mitola radio"): In which every possible parameter
observable by a wireless node or network is taken into account.
• Spectrum Sensing Cognitive Radio: In which only the radio frequency spectrum is
considered.
Work presented here is for Configuring the SDR for Spectrum Sensing Cognitive
Radio.

2.4 Cognitive Radio Network Paradigms

Based on the type of available network side information along with the regulatory
constraints, cognitive radio systems seek to underlay, overlay, or interweave their
signals with those of existing users without significantly impacting their
communication. The underlay paradigm allows cognitive users to operate if the
interference caused to non cognitive users is below a given threshold. In overlay
systems, the cognitive radios use sophisticated signal processing and coding to
maintain or improve the communication of non cognitive radios while also obtaining
some additional bandwidth for their own communication. In interweave systems; the

13
cognitive radios opportunistically exploit spectral holes to communicate without
disrupting other transmissions.

2.4.1 Underlay Paradigm


The underlay paradigm encompasses techniques that allow secondary communications
assuming that they have knowledge of the interference caused by its transmitter to the
receivers of the primary users. Specifically, the underlay paradigm mandates that
concurrent primary and secondary transmissions may occur as long as the aggregated
interference generated by the secondary users is below some acceptable threshold. In
the underlay paradigm, the secondary user enters the primary spectrum only when its
activity will not cause considerable interference or capacity penalty to the primary user.
Measure of interference requires knowledge about multiuser CQI. Measurement
challenges for underlay paradigm are:

 Measuring interference at NC receiver


 Measuring direction of NC node for beam steering
 Both easy if NC receiver also transmits, else hard.

Underlay typically coexists with licensed users. Licensed users paid for their
spectrum so they don’t want underlay,Insist on very stringent interference constraints
which severely limits underlay capabilities and applications. That is the main
challenge for underlay policy.

2.4.2 Overlay Paradigm

The overlay paradigm allows the coexistence of simultaneous primary and secondary
communications in the same frequency channel as long as the secondary users
somehow aid the primary users, for example, by means of advanced coding or
cooperative techniques. In particular, in a cooperative scenario the secondary users may
decide to assign part of their power to their own secondary communications and the
remaining power to relay the primary users transmission. The enabling premise for
overlay systems is that the cognitive transmitter has knowledge of the noncognitive

14
users’ codebooks and its messages as well. A noncognitive user message might be
obtained by decoding the message at the cognitive receiver.
On the one hand, the information can be used to completely cancel the interference due
to the noncognitive signals at the cognitive receiver by sophisticated techniques, like
dirty paper coding (DPC). On the other hand, the cognitive users can utilize this
knowledge and assign part of their power for their own communication and the
remainder of the power to assist (relay) the noncognitive transmissions. By careful
choice of the power split, the increase in the noncognitive user’s signal-to-noise power
ratio (SNR) due to the assistance from cognitive relaying can be exactly offset by the
decrease in the noncognitive user’s SNR due to the interference caused by the
remainder of the cognitive user’s transmit power used for its own communication.

2.4.3 Interweave Paradigm


The interweave paradigm was the original motivation for cognitive radio and is based
on the idea of opportunistic communications. The interweave paradigm, where a
secondary user can opportunistically enter temporary spectrum holes and white spaces
existing in both licensed and unlicensed radio spectrum. Fast and reliable spectrum
sensing techniques are the key to the success of interweave cognitive radios.

15
CHAPTER 3
PROPOSED METHOD

3.1 Algorithm

 In the Project, our primary aim was to simulate a working cognitive radio for
which we were required to produce a variable source generator to replicate real
life usage of the frequency channels.
 After completion of the source generator, the signal in channel, if there, have to
be modulated so as for making it suitable for transmission and defining the
frequencies that will be used by it during transmission.
 All the different modulated carrier signals will then multiplexed to give a
continuous spectrum.
 To detect an empty channel, we have used the power spectral density of all the
signals which will provide us the power being transmitted at a particular
frequency channel at the moment.

 Threshold values will be set for determining whether the channel is empty or
not.
 Once the sensing part is over, another user will be introduced acting as secondary
user and will attain the particular frequency for which the PSD is below the
threshold, Thus achieving functionality of cognitive radio.

3.2 SPECTRUM SENSING TECHNIQUES


There are various spectrum sensing techniques which are employed for
spectrum sensing such as:-
1) Energy Detection.
2) Matched Filter Detection.
3) Waveform-Based Detection.
4) Cyclostationary Feature Detection.
5) Cooperative Detection.

16
All these methods are good and each has its own advantages and disadvantages.
The method used in this paper is energy detection method because of its
simplicity and ability with which it can be applied in almost all the cases.
Moreover, it has low computational and implementation complexities and
optimal under no knowledge of primary signal. We have used energy detection
method for building the cognitive radio network.

A. Energy Detection
Energy detector based approach is the most common way of spectrum sensing
because of its low computational and implementation complexities. When the
primary user signal is unknown or the reciever cannot gather sufficient
information about the primary user signal, the energy detection method is used.
About the primary user signal, the energy detection method is used. This
method is optimal for detecting any unknownzero-mean constellation signals
and can be applied to cognitive radios (CRs).

Fig-3.1

17
Fig-3.2
Energy detection & Spectrum Sensing block

18
CHAPTER 4

IMPLEMENTATION

4.1 Related Theory

4.1.2 About MATLAB & SIMULINK

MATLAB

MATLAB® is a high-level technical computing language and interactive environment


for algorithm development, data visualization, data analysis, and numerical
computation. Using MATLAB, you can solve technical computing problems faster
than with traditional programming languages, such as C, C++, and Fortran.

You can use MATLAB in a wide range of applications, including signal and image
processing, communications, control design, test and measurement, financial modeling
and analysis, and computational biology. Add-on toolboxes (collections of special-
purpose MATLAB functions) extend the MATLAB environment to solve particular
classes of problems in these application areas.
MATLAB provides a number of features for documenting and sharing your work. You
can integrate your MATLAB code with other languages and applications, and distribute
your MATLAB algorithms and applications.

Key Features

 High-level language for technical computing


 Development environment for managing code, files, and data

 Interactive tools for iterative exploration, design, and problem solving


 Mathematical functions for linear algebra, statistics, Fourier analysis, filtering,
optimization, and numerical integration
 2-D and 3-D graphics functions for visualizing data
 Tools for building custom graphical user interfaces
 Functions for integrating MATLAB based algorithms with external applications and
languages, such as C, C++, Fortran, Java, COM, and Microsoft Excel
19
4.2 SOFTWARE DESCRIPTIONS

OVERVIEW OFMATLAB

MATLAB is a high-performance language for technical computing. It


integrates computation, visualization, and programming in an easy-to-use environment
where problems and solutions are expressed in familiar mathematical notation.

Typical uses include

• Math and computation

• Algorithm development

• Data acquisition

• Modeling, simulation, and prototyping

• Data analysis, exploration, and visualization

• Scientific and engineering graphics

• Application development, including graphical user interface building

MATLAB is an interactive system whose basic data element is an array that


does not require dimensioning. This allows you to solve many technical computing
problems, especially those with matrix and vector formulations, in a fraction of the time
it would take to write a program in a scalar non interactive language such as C or
Fortran. The name MATLAB stands for matrix laboratory. MATLAB was originally
written to provide easy access to matrix software developed by the LINPACK and
EISPACK projects. Today, MATLAB engines incorporate the LAPACK and BLAS
libraries, embedding the state of the art in software for matrix computation.

MATLAB has evolved over a period of years with input from many users. In
university environments, it is the standard instructional tool for introductory and

20
advanced courses in mathematics, engineering, and science. In industry, MATLAB is
the tool of choice for high-productivity research, development, and analysis.

MATLAB features a family of add-on application-specific solutions called


toolboxes. Very important to most users of MATLAB, toolboxes allow you to learn
and apply specialized technology. Toolboxes are comprehensive collections of
MATLAB functions (M-files) that extend the MATLAB environment to solve
particular classes of problems. Areas in which toolboxes are available include signal
processing, control systems, neural networks, fuzzy logic, wavelets, simulation, and
many others. The MATLAB System

4.3 The MATLAB system consists of these main parts:

4.3.1 DESKTOP TOOLS AND DEVELOPMENT ENVIRONMENT

This is the set of tools and facilities that help you use MATLAB functions and
files. Many of these tools are graphical user interfaces. It includes the MATLAB
desktop and Command Window, a command history, an editor and debugger, a code
analyzer and other reports, and browsers for viewing help, the workspace, files, and the
search path.

4.3.2 MATLAB MATHEMATICAL FUNCTION LIBRARY

This is a vast collection of computational algorithms ranging from elementary


functions, like sum, sine, cosine, and complex arithmetic, to more sophisticated
functions like matrix inverse, matrix eigenvalues, Bessel functions, and fast Fourier
transforms.

4.3.3 MATLAB LANGUAGE

21
This is a high-level matrix/array language with control flow statements,
functions, data structures, input/output, and object-oriented programming features. It
allows both “programming in the small” to rapidly create quick and dirty throw-away
programs, and “programming in the large” to create large and complex application
programs.

4.4 GRAPHICS

MATLAB has extensive facilities for displaying vectors and matrices as graphs,
as well as annotating and printing these graphs. It includes high-level functions for two-
dimensional and three-dimensional data visualization, image processing, animation,
and presentation graphics. It also includes low-level functions that allow you to fully
customize the appearance of graphics as well as to build complete graphical user
interfaces on THE

4.5 MATLAB applications.

4.5 1 MATLAB EXTERNAL INTERFACES

This is a library that allows you to write C and Fortran programs that interact
with MATLAB. It includes facilities for calling routines from MATLAB (dynamic
linking), calling MATLAB as a computational engine, and for reading and writing
MAT-files.

4.5.2 IMAGE PROCESSING TOOLBOX

Image Processing Toolbox provides a comprehensive set of reference-standard


algorithms and graphical tools for image processing, analysis, visualization, and
algorithm development. You can perform image enhancement, image deblurring,
feature detection, noise reduction, image segmentation, spatial transformations, and
image registration. Many functions in the toolbox are multithreaded to take advantage
of multicore and multiprocessor computers.

22
Image Processing Toolbox supports a diverse set of image types, including high
dynamic range, gigapixel resolution, ICC-compliant color, and tomographic images.
Graphical tools let you explore an image, examine a region of pixels, adjust the contrast,
create contours or histograms, and manipulate regions of interest (ROIs). With the
toolbox algorithms you can restore degraded images, detect and measure features,
analyze shapes and textures, and adjust the color balance of images.

4.6 KEY FEATURES

 Image enhancement, filtering, and deblurring. Image analysis, including


segmentation, morphology, feature extraction, and measurement
 Spatial transformations and image registration

 Image transforms, including FFT, DCT, Radon, and fan-beam projection

 Workflows for processing, displaying, and navigating arbitrarily large images

 Modular interactive tools, including ROI selections, histograms, and distance


measurements
 ICC color management 

 Multidimensional image processing

 Image-sequence and video display

 DICOM import and export

4.7 IMPORTING AND EXPORTING IMAGES

Image Processing Toolbox supports images generated by a wide range of


devices, including digital cameras, satellite and airborne sensors, medical imaging
devices, microscopes, telescopes, and other scientific instruments. You can visualize,
analyze, and process these images in many data types, including single- and double-
precision floating-point and signed and unsigned 8-, 16-, and 32-bit integers.

There are several ways to import and export images into and out of the
MATLAB environment for processing. You can use Image Acquisition Toolbox to

23
acquire live images from Web cameras, frame grabbers, DCAM-compatible cameras,
and other devices. Using Database Toolbo, you can access images stored in
ODBC/JDBC-compliant databases.

MATLAB supports standard data and image formats, including JPEG, JPEG-
2000, TIFF, PNG, HDF, HDF-EOS, FITS, Microsoft Excel, ASCII, and binary files. It
also supports the multiband image formats BIP and BIL, as used by LANDSAT for
example. Low-level I/O and memory mapping functions enable you to develop custom
routines for working with any data format.

Image Processing Toolbox supports a number of specialized image file formats.


For medical images, it supports the DICOM file format, including associated metadata,
as well as the Analyze 7.5 and Interfile formats. The toolbox can also read geospatial
images in the NITF format and high dynamic range images in the HDR format.

4.8 DISPLAYING AND EXPLORING IMAGES

Image Processing Toolbox extends MATLAB graphics to provide image


display capabilities that are highly customizable. You can create displays with multiple
images in a single window, annotate displays with text and graphics, and create
specialized displays such as histograms, profiles, and contour plots.

In addition to display functions, the toolbox provides a suite of interactive tools


for exploring images and building GUIs. You can view image information, zoom and
pan around the image, and closely examine a region of pixels. You can interactively
place and manipulate ROIs, including points, lines, rectangles, polygons, ellipses, and
freehand shapes. You can also interactively crop, adjust the contrast, and measure
distances. The suite of tools is available within Image Tool or from individual functions
that can be used to create customized GUIs.

The toolbox includes tools for displaying video and sequences in either a time-
lapsed video viewer or an image montage. Volume visualization tools in MATLAB let
you create isosurface displays of multidimensional image data sets.

24
4.9 PREPROCESSING AND POSTPROCESSING IMAGES

Image Processing Toolbox provides reference-standard algorithms for


preprocessing and postprocessing tasks that solve frequent system problems, such as
interfering noise, low dynamic range, out-of-focus optics, and the difference in color
representation between input and output devices.

Image enhancement techniques in Image Processing Toolbox enable you to


increase the signal-to-noise ratio and accentuate image features by modifying the colors
or intensities of an image. You can:

 Perform histogram equalization


 Perform decorrelation stretching
 Remap the dynamic range
 Adjust the gamma value
 Perform linear, median, or adaptive filtering

The toolbox includes specialized filtering routines and a generalized


multidimensional filtering function that handles integer image types, offers multiple
boundary-padding options, and performs convolution and correlation. Predefined
filters and functions for designing and implementing your own linear filters are also
provided.

Image deblurring algorithms in Image Processing Toolbox include blind, Lucy-


Richardson, Wiener, and regularized filter deconvolution, as well as conversions
between point spread and optical transfer functions. These functions help correct
blurring caused by out-of-focus optics, movement by the camera or the subject during
image capture, atmospheric conditions, short exposure time, and other factors. All
deblurring functions work with multidimensional images.

Management in Image Processing Toolbox enables you to accurately represent


color independently from input and output devices. This is useful when analyzing the
characteristics of a device, quantitatively measuring color accuracy, or developing
algorithms for several different devices. With specialized functions in the toolbox, you

25
can convert images between device-independent color spaces, such as sRGB, XYZ,
xyY, L*a*b*, uvL, and L*ch.

For more flexibility and control, the toolbox supports profile-based color space
conversions using a color management system based on ICC version 4. For example,
you can import n-dimensional ICC color profiles, create new or modify existing ICC
color profiles for specific input and output devices, specify the rendering intent, and
find all compliant profiles on your machine.

Image transforms such as FFT and DCT play a critical role in many image
processing tasks, including image enhancement, analysis, restoration, and compression.
Image Processing Toolbox provides several image transforms, includingRadon and
fan-beam projections. You can reconstruct images from parallel-beam and fan-beam
projection data (common in tomography applications). Image transforms are also
available in MATLAB and Wavelet Toolbox.

Image conversions between data classes and image types are a common
requirement for imaging applications. Image Processing Toolbox provides a variety of
utilities for conversion between data classes, including single- and double-precision

floating-point and signed or unsigned 8-, 16-, and 32-bit integers. The toolbox includes
algorithms for conversion between image types, including binary, grayscale, indexed
color, and truecolor. Specifically for color images, the toolbox supports a variety of
color spaces (such as YIQ, HSV, and YCrCb) as well as Bayer pattern encoded and
high dynamic range images.

4.10 ANALYZING IMAGES

Image Processing Toolbox provides a comprehensive suite of reference-


standard algorithms and graphical tools for image analysis tasks such as statistical
analysis, feature extraction, and property measurement.

26
Statistical functions let you analyze the general characteristics of an image by:

 Computing the mean or standard deviation


 Determining the intensity values along a line segment
 Displaying an image histogram
 Plotting a profile of intensity value

Edge-detection algorithms let you identify object boundaries in an image. These


algorithms include the Sobel, Prewitt, Roberts, Canny, and Laplacian of Gaussian
methods. The powerful Canny method can detect true weak edges without being
"fooled" by noise.

Image segmentation algorithms determine region boundaries in an image. You


can explore many different approaches to image segmentation, including automatic
thresholding, edge-based methods, and morphology-based methods such as the
watershed transform, often used to segment touching objects.

Morphological operators enable you to detect edges, enhance contrast, remove


noise, segment an image into regions, thin regions, or perform skeletonization on
regions. Morphological functions in Image Processing Toolbox include:

 Erosion and dilation


 Opening and closing
 Labeling of connected components
 Watershed segmentation
 Reconstruction
 Distance transform

Image Processing Toolbox also contains advanced image analysis functions that
let you:

 Measure the properties of a specified image region, such as the area, center of

mass, and bounding box


 Detect lines and extract line segments from an image using the Hough transform

27
 Measure properties, such as surface roughness or color variation, using texture

analysis functions

4.11 Working with Large Images

Some images are so large that they are difficult to process and display with
standard methods. Image Processing Toolbox provides specific workflows for working
with larger images than otherwise possible. Without loading a large image entirely into
memory, you can create a reduced-resolution data set (R-Set) that divides an image into
spatial tiles and resamples the image at different resolution levels. This workflow
improves performance in image display and navigation. You can use a block processing
workflow to apply a function to each distinct block of a large image, which significantly
reduces memory use. An additional option for working with large images is to use the
Parallel Computing Toolbox.

28
CHAPTER 5
SOFTWARE IMPLEMENTATION

5.1 Toolboxes Available in MATLAB

5.1.1 COMMUNICATIONS TOOLBOX

Communications Toolbox extends the MATLAB technical computing


environment with functions, plots, and a graphical user interface for exploring,
designing, analyzing, and simulating algorithms for the physical layer of
communication systems. The toolbox helps you create algorithms for commercial and
defense wireless or wireline systems. The key features of the toolbox are Functions for
designing the physical layer of communications links, including source coding, channel
coding, interleaving, modulation, channel models, and equalization Plots such as eye
diagrams and constellations for visualizing communications signals Graphical user
interface for comparing the bit error rate of your system with a wide variety of proven
analytical results Galois field data type for building communications algorithms.

5.1.2 CONTROL SYSTEM TOOLBOX

Complex arithmetic, eigenvalues, root-finding, matrix inversion, and fast


Fourier transforms are just a few examples of important numerical tools found in
MATLAB. More generally, the MATLAB linear algebra, matrix computation, and
numerical analysis capabilities provide a reliable foundation for control system
engineering as well as many other disciplines. Control System Toolbox builds on the
foundations of MATLAB to provide functions designed for control engineering.
Control System Toolbox is a collection of algorithms, written mostly as M-files, that
implements common control system design, analysis, and modeling techniques.

Convenient graphical user interfaces (GUIs) simplify typical control engineering tasks.
Control systems can be modeled as transfer functions, in zero-pole-gain or state-space
form, allowing you to use both classical and modern control techniques. Both
continuous-time and discrete-time systems can be manipulated.Convessions between
various model representations are provided. Time responses, and root loci an be
computed and graphed.other functions allow

29
pole placement, optimal control, and estimation. Finally, Control System Toolbox is
open and extensible. You can create custom M-files to suit your particular application.

5.1.3 DATA ACQUISITION TOOLBOX

Data Acquisition Toolbox is a collection of M-file functions and a MEX-


file(shared library) built on the MATLAB® technical computing environment. The
toolbox also includes several dynamic link libraries (DLLs) called adaptors, which
enable you to interface with specific hardware. The toolbox provides you with these
main features: A framework for bringing live, measured data into MATLAB using PC-
compatible, plug-in data acquisition hardware Support for analog input (AI), analog
output (AO), and digital I/O (DIO) subsystems including simultaneous analog I/O
conversions Support for these popular hardware vendors/devices: Advantech boards
that use the Advantech Device Manager Agilent Technologies E1432A/33A/34A VXI
modules Keithley boards that use Driver LINX drivers Measurement Computing
Corporation (Computer Boards) boards National Instruments boards that use
Traditional NI-DAQ or NI-DA Qmx software (except SCXI)Parallel ports LPT1-
LPT3Windows sound cards Additionally, you can use the Data Acquisition Toolbox
Adaptor Kit to interface unsupported hardware devices to the toolbox. Event-driven
acquisitions

5.1.4 FILTER DESIGN TOOLBOX

Filter Design HDL Coder accelerates the development of application-specific


integrated circuit (ASIC) and field programmable gate array (FPGA) designs and
bridges the gap between system-level design and hardware development by generating
hardware description language (HDL) code based on filters developed in MATLAB®.
Currently, system designers and hardware developers use HDLs, such as very high
speed integrated circuit (VHSIC) hardware description language (VHDL) and Verilog,
to develop hardware designs. Although HDLs provide a proven method for hardware
design, the task of coding filter designs, and hardware designs in general, is labor
intensive and the use of these languages for algorithm and system-level design is not
optimal.Using Filter Design HDL Coder, system architects and designers can spend
more time on fine-tuning algorithms and models through rapid prototyping and
30
experimentation and less time on HDL coding. Architects and designers can efficiently
design, analyze, simulate, and transfer system designs to hardware developers.

5.1.5 FINANCIAL DERIVATIVES TOOLBOX

Financial Derivatives Toolbox provides components for analyzing individual


derivative instruments and portfolios containing several types of interest-rate-based and
equity-based financial instruments. Interest-Rate-Based Derivatives Equity Derivatives

5.1.6 FINANCIAL TOOLBOX

MATLAB and Financial Toolbox provide a complete integrated computing


environment for financial analysis and engineering.

The toolbox has everything that is needed to perform mathematical and statistical
analysis of financial data and display the results with presentation-quality graphics.
You can quickly ask, visualize, and answer complicated questions.

5.1.7 FUZZY LOGIC TOOLBOX

Fuzzy Logic Toolbox is a collection of functions built on the MATLAB®


numeric computing environment. It provides tools for you to create and edit fuzzy
inference systems within the framework of MATLAB, or if you prefer, you can
integrate your fuzzy systems into simulations with Simulation link

5.1.8 INSTRUMENT CONTROL TOOLBOX

Instrument Control Toolbox is a collection of M-file functions built on the MATLAB®


technical computing environment. The toolbox provides you with these features: A
framework for communicating with instruments that support the GPIB interface (IEEE-
488), the VISA standard, and the TCP/IP and UDP protocols, Note that the toolbox
extends the basic serial port features included with MATLAB. Support for IVI, VXI
plug &play, and MATLAB instrument drivers Functions for transferring data between
MATLAB and your instrument: the data can be binary (numerical) or text. The transfer
can be synchronous and block the MATLAB command line, or asynchronous and allow
access to the MATLAB command line. Event-based communication Functions for

31
recording data and event information to a text file Tools that facilitate instrument
control in an easy-to-use graphical environment

5.1.9 MAPPING TOOLBOX

Mapping Toolbox provides a comprehensive set of functions and for building


map displays and performing geospatial data analysis in MATLAB. You can create
map displays that combine data from multiple modalities and display them in their
correct spatial relationships. The toolbox supports standard analyses, such as line-of-
sight calculations on terrain data or geographic computations that account for the
curvature of the Earth's surface. Most of the functions in Mapping Toolbox are written
in the open MATLAB language. This means that you can inspect the algorithms,
modify the source code, create your own custom functions, and automate frequently
performed tasks.The toolbox supports key mapping and geospatial data analysis,
manipulation, and visualization tasks that are useful in applications such as earth and
planetary scientific research, oil and gas exploration, environmental monitoring,
insurance risk management, aerospace, defense, and security.

5.1.10. MODEL PREDICTIVE CONTROL

Model Predictive Control Toolbox is a collection of software that helps you design,
analyze, and implement an advanced industrial automation algorithm. Like other
MATLAB® tools, it provides a convenient graphical user interface (GUI) as well as a
flexible command syntax that supports customization. A Model Predictive Control
Toolbox controller automates a target system (the plant) by combining a prediction and
a control strategy. An approximate plant model provides the prediction. The control
strategy compares predicted plant signals to a set of objectives, then adjusts available
actuators to achieve the objectives while respecting the plant's constraints. The
controller's constraint-tolerance differentiates it from other optimal control strategies
(e.g., the Linear-Quadratic-Gaussian approach supported in Control System Toolbox).
The impetus for this is industrial experience suggesting that the drive for profitability
often pushes the plant to one or more constraints. The Model Predictive Control
Toolbox controller considers such factors explicitly, allowing it to allocate the available
plant resources intelligently as the system evolves over time.

32
Model Predictive Control Toolbox uses the same powerful linear dynamic modeling
tools found in Control System Toolbox and System Identification Toolbox.

5.1.11 NEURAL NETWORK TOOLBOX

Neural networks are composed of simple elements operating in parallel. These


elements are inspired by biological nervous systems. As in nature, the network function
is determined largely by the connections between elements. You can train a neural
network to perform a particular function by adjusting the values of the connections
(weights) between elements. Commonly neural networks are adjusted, or trained, so
that particular input leads to a specific target output. Such a situation is shown below.
There, the network is adjusted, based on a comparison of the output and the target, until
the network output matches the target. Typically many such input/target pairs are
needed to train a network. Today neural networks can be trained to solve problems that
are difficult for conventional computers or human beings. Throughout the toolbox
emphasis is placed on neural network paradigms that build up to or are themselves used
in engineering, financial, and other practical applications.

5.1.12. OPTIMIZATION TOOLBOX

Optimization Toolbox extends the capability of the MATLAB® numeric


computing environment. The toolbox includes routines for many types of optimization
including Unconstrained nonlinear minimization Constrained nonlinear minimization,
including goal attainment problems, minimax problems, and semi-infinite
minimization problems Quadratic and linear programming Nonlinear least-squares and
curve fitting Nonlinear system of equation solving Constrained linear least squares
Sparse and structured large-scale problems.

5.1.13. PARTIAL DIFFERENTIAL EQUATION

The objectives of Partial Differential Equation Toolbox are to provide you with tools
that Define a PDE problem, e.g., define 2-D regions, boundary conditions, and PDE
coefficients. Numerically solve the PDE problem, e.g., generate unstructured meshes,

33
discretize the equations, and produce an approximation to the solution. Visualize the
results.

5.1.14. ROBUST CONTROL TOOLBOX

Robust Control Toolbox is a collection of functions and tools that help to analyze
and design multi input-multioutput (MIMO) control systems with uncertain elements.
uncertain LTI system models containing uncertain parameters and uncertain dynamics
are given. Analyze tools for MIMO system stability margins and worst case
performance are given.

Robust Control Toolbox includes a selection of control synthesis tools that compute
controllers that optimize worst-case performance and identify worst-case parameter
values. The toolbox simplify and reduce the order of complex models with model
reduction tools that minimize additive and multiplicative error bounds. It provides tools
for implementing advanced robust control methods like H, H2, linear matrix
inequalities (LMI), and µ-synthesis robust control. It can shape MIMO system
frequency responses and design uncertainty tolerant controllers.

5.1.15. SIGNAL PROCESSING TOOLBOX

Signal Processing Toolbox is a collection of tools based on the MATLAB® numeric


computing environment. The toolbox supports a wide range of signal processing
operations, from waveform generation to filter design and implementation, parametric
modeling, and spectral analysis. The toolbox provides two categories of tools,
command-line functions and graphical user interfaces: Command-line functions are
available in the following categories: Discrete-time filter design, analysis, and
implementation Analog filter design, analysis, and implementation Linear system
transformations Windows Spectral analysis and cepstral analysis Transforms Statistical
signal processing Parametric modeling Linear prediction MultiMate signal processing
Waveform generation A suite of interactive graphical user interfaces are available for
Filter design and analysis Window design and analysis Signal plotting and analysis,
spectral analysis, and filtering

5.1.16. SPLINE TOOLBOX


34
This toolbox contains MATLAB versions of the essential programs of the B-
spline package (extended to handle also vector-valued splines) as described in A
Practical Guide to Splines, (Applied Math. Sciences Vol. 27, Springer Verlag, New
York (1978), xxiv + 392p; revised edition (2001), xviii+346p), hereafter referred to as
PGS. The toolbox makes it easy to create and work with piecewise-polynomial
functions.

The typical use envisioned for this toolbox involves the construction and
subsequent use of a piecewise-polynomial approximation. This construction would
involve data fitting, but there is a wide range of possible data that could be fit. In the
simplest situation, one is given points and is looking for a piecewise-polynomial
function that satisfies , all , more or less. An exact fit would involve interpolation, an
approximate fit might involve least-squares approximation or the smoothing spline. But
the function to be approximated may also be described in more implicit ways, for
example as the solution of a differential or integral equation. In such a case, the data
would be of the form , with A some differential or integral operator. On the other hand,
one might want to construct a spline curve whose exact location is less important than
is its overall shape. Finally, in all of this, one might be looking for functions of more
than one variable, such as tensor product splines.

5.1.17 STATISTICS TOOLBOX

Statistics Toolbox extends MATLAB to support a wide range of common


statistical tasks. The toolbox contains two categories of tools:Building-block statistical
functions for use in MATLAB programming Graphical user interfaces (GUIs) for
interactive use of the functions Code for the building-block functions is open and
extensible. It gives MATLAB Editor to review, copy, and edit the M-file code for any
function. It extends the toolbox by copying code to new M-files or by writing M-files
that call toolbox functions.

5.1.18 SYMBOLIC MATH TOOLBOX

Symbolic Math Toolboxes incorporate symbolic computation into the numeric


environment of MATLAB. These toolboxes supplement MATLAB numeric and

35
graphical facilities with several other types of mathematical computation such as
Calculus, Linear Algebra, Simplification, Solution of Equations, Special Mathematical
Functions, Variable-Precision Arithmetic, Transforms.

There are two toolboxes: The basic Symbolic Math Toolbox is a collection of more
than 100 MATLAB functions that provide access to the Maple kernel using a syntax
and style that is a natural extension of the MATLAB language. The basic toolbox also
allows to access functions in the Maple linear algebra package. Extended Symbolic
Math Toolbox augments this functionality to include access to all non graphics Maple
packages, Maple programming features, and user-defined procedures. With both
toolboxes, one can write own M-files to access Maple functions and the Maple
workspace.

5.1.19 SYSTEM IDENTIFICATION TOOLBOX

System Identification Toolbox extends the MATLAB® computation


environment and lets you fit linear and nonlinear mathematical models to input and
output data from dynamic system.System identification is especially useful for
modeling systems that you cannot easily represent in terms of first principles. Examples
of such complex dynamic systems include engine subsystems, flight dynamics systems,
thermo fluid processes, and electromechanical systems. For real-time applications in
adaptive control, adaptive filtering, or adaptive prediction, one can use System
Identification Toolbox to perform recursive parameter estimation. System
Identification Toolbox supports both time- and frequency-domain data with single or
multiple inputs and single or multiple outputs. Time-domain data can be real or
complex. One can also use this Toolbox to estimate models for time-series data. System
Identification Toolbox provides an interactive graphical user interface (GUI) called the
System Identification Tool, which is ideal for getting started with this software.
Alternatively, one can use System Identification Toolbox objects, methods, and
functions in the MATLAB Command Window.

5.1.20. WAVELET TOOLBOX

Everywhere around us are signals that can be analyzed. For example, there are
seismic tremors, human speech, engine vibrations, medical images, financial data,
36
music, and many other types of signals. Wavelet analysis is a new and promising set of
tools and techniques for analyzing these signals.

Wavelet Toolbox is a collection of functions built on the MATLAB® Technical


Computing Environment. It provides tools for the analysis and synthesis of signals and
images, and tools for statistical applications, using wavelets and wavelet packets within
the framework of MATLAB. The MathWorks provides several products that are
relevant to the kinds of tasks you can perform with Wavelet Toolbox.

5.2 DSB-SC AM Modulation

Double-sideband suppressed-carrier transmission(DSB-SC):

Transmission in which frequencies produced by amplitude modulation are


symmetrically spaced above and below the carrier frequency and the carrier level is
reduced to the lowest practical level, ideally completely suppressed.

In the double-sideband suppressed-carrier transmission (DSB-SC) modulation, unlike


AM, the wave carrier is not transmitted; thus, a great percentage of power that is
dedicated to it is distributed between the sideband, which implies an increase of the
cover in DSB-SC, compared to AM, for the same power used.

This is used for RDS (Radio Data System) because it is difficult to decouple.

5.3 Power Spectral Density


The power spectral density (PSD) is a positive real function of a frequency variable
associated with a stationary stochastic process, or a deterministic function of time,
which has dimensions of power per hertz (Hz), or energy per hertz. It is often called
simply the spectrum of the signal. Intuitively, the spectral density measures the
frequency content of a stochastic process and helps identify periodicities.

HARDWARE REQUIREMENTS
• SYSTEM : Pentium IV 2.4 GHz
• HARD DISK : 40 GB
• MONITOR : 15 VGA color
37
• MOUSE : Logitech.
• RAM : 256 MB
• KEYBOARD : 110 keys enhanced.

SOFTWARE REQUIREMENTS
• Operating system : Windows XP Professional
• Tool : MATLAB2012b

38
CHAPTER 6
SPECTRAL ANALYSIS

6.1 Computing the DFT, IDFT and using them for filtering

To begin this discussion on spectral analysis, let us begin by considering the question
of trying to detect an underlying sinusoidal signal component that is buried in noise.
Such problems occur, for example, very commonly in the area of
telecommunications’.Suppose that such a signal-in-noise situation gives rise to the
observed data record as shown in figure 1.

Here the samples are collected at a spacing of = 0.1 second apart, and are contained in
a MATLAB vector x so that since the samples are plotted

with the command


>> fs=10;

>> t = (0:1:length(x)-1)/fs;

>> plot(t,x)

then, as is the MATLAB plotting default, linear interpolation is performed

between the sample points to give the impression of a continuous signal.

Note also, in the above commands, the specification of fs as fs = 1/ which is the


sampling frequency in Hz.

Now the signal shown in figure 1 does not appear, by eye, to have any underlying
sinusoidal signal component at all; instead it appears to be completely random and
hence completely comprised of noise.

However, to check this, the Discrete Fourier Transform (DFT)


39
N −1 2
π
X (mωs) =xk e−jmωsk ; ωs , N(1)
X
k=0

could be computed to see if a spectral peak is present.

For this purpose,MATLAB has the fft function, which performs the computation DFT
computation (1) in an effi cient manner, and hence is called the Fast Fourier Transform
(FFT). Using it is very simple. Hand it a vector x of time domain samples, and it returns
a vector X of samples X

(mωs), m = 0, 1, · · · , N − 1 of the DFT computation:

>> X = fft(x);

>> plot(abs(X));

These commands result in the plot shown in figure 2. There are s ome interesting
aspects of this plot. Firstly, and most importantly, there are two clear spectral peaks,
which indicate that there is more to this signal than just noise. The second point of
interests arises by trying to interpret from this plot how many spectral components
exist. Are there two clear ones?

In fact there is only one spectral component, since the frequency range used in the
MATLAB DFT computation is as shown in figure 3.

There itis illustrated th at if the underlying continuous time signal has a spectrum X (ω)
= F {x}, then as discussed in lectures, the DFT XN (ω) will be a repeated version of this
spectrum, with the repetition occurring every ω = 2π/ seconds.

40
6.2 Sampled Signal
4

−1

−2

−3

−4
0 5 10 15 20 25 30 35 40
Time (s)

Figure 6.1: Sampled signal record.


Now, if x(t) is real valued, then X (ω) will be symmetric, and hence the part of X N

(ω) in the range ω ∈ [π/ , 2π/Δ) is nothing more than the negative frequency part of X

(ω).

It would actually make more sense to plot XN (ω) in the range ω = [−π/ , π/Δ], and
this would involve taking the `top half' of the vector X computed above, and moving it
to the front of the vector. MATLAB can do this simply by using the fftshift command
as follows

>> N = length(x);
>> ws = 2*pi/N;
>> wnorm = -pi:ws:pi;
>> wnorm = wnorm(1:length(x));
>> w = wnorm*fs;
>> plot(w,abs(fftshift(X)))
>> axis([-30,30,0,160])

41
This results in the diagram shown in figure 4. Actually, this diagram illustrates
something more than just the use of the fft shift command via plot (w,abs(fftshift(X))),
it also illustrates the com-putation of an appropriate x-axis labeling of frequency. In
particular, notice that the `sampling' spacing of the DFT in normalized frequency as


ωs = N

is calculated in the variable ws, and this is used to generate a vector wnorm
which is a frequency axis in the normalised frequency range [−π, π], which in
turn is converted to a `real' frequency range [−π/ , π/Δ] by multiplication with
the sampling frequency fs.

From figure 4 it is now clear that the signal vector x shown in figure 1 actually
contains a clear sinu-soidal component at around 5 rad/s. To find this frequency
accurately, the ginput command may be used as >> [freq,amp]=ginput

42
6.3 DFT computation (Absolute Value)

140

120

100
Magni

80

60

40

20

0
0 50 100 150 200 250 300 350 400
Index m of Normalised
Frequency ω = mωs
Figure 6.2: A plot of the DFT magnitude |XN (mωs)| for the signal x shown in figure 1.

freq =4.9770

amp =159.0643

which creates mouse-controllable cross-hairs on the plot shown in figure 4 that can be
place at the tip of the spectral peak. When the left mouse button is then clicked, and the
return key hit, the x and y axis values if the cross-hair position are reported.
This confirms our estimate of the sine-wave frequency being a t 5 rad/s.

To estimate its amplitude, we need to remember that and N sample data record of and
amplitude A sine/cosine wave, results in a DFT peak of AN/2, and therefore the
estimated underlying sine-wave amplitude is

>> amp*2/N

ans =0.7953

43
|U (ω)|
1

−2πB 2πB ω

Frequency Range Used in


MATLAB FFT function
|Up (ω)|

ω
−2πB 2πB
2πfs =
ωs

Figure 6.3: The frequency range of the DFT computed by the MATLAB FFT
functionis ω ∈ [0, 2π/Δ)

It could be used to perform filtering on the signal shown in figure1 in order to recover
the sinusoidal component that figure 4 indicates is present in the signal, but is buried in
noise.

-This filtering could be achieve by using the filtering vector

>> fil = [zeros(1,160),ones(1,15),zeros(1,50),ones(1,15),zeros(1,160)];

which, as shown in figure 5 by execution of the command

>>plot(w,abs(fftshift(X)),’b’,w,160*fil,’-.r’);

is one which, if multiplied by the vector representing XN (ω) would retain

the sinusoidal signal component of the spectrum, while eliminating the remainder that
44
is due to noise.
This filtering can be performed by execution

of the commands

>> Xf = fil.*fftshift(X);
>> xf = ifft(fftshift(Xf));

>> plot(t,real(xf))

with the results shown in figure 6. Some important points to dr aw from the above
commands are that firstly, the filtered spectrum vector Xf needs to have the function
fftshift applied to it before being passed to the ifft function since the ifft function
expects the frequency axis of figure 3 to be associat ed with its input; that is it expects
the negative frequency components to be stacked in Xf after the positive frequency
ones.

Secondly, although the result of the xf = ifft(fftshift(Xf)) command should be real since
Xf is symmetric, the limited numerical precision of the computing platform being used
will result in small imaginary components of the order of 10−15 being present, and these
need to be discarded by using the real command.
The results of the filtering are shown in figure 6, where a 5 rad/s tone of average
amplitude around 0.8 is shown.

45
|XN(ω)|
160
140
120
100
80

60
40
20


2
−30 0 0 −10 0 10 20 30

Figure 6.4: DFT magnitude |XN (mωs )| plotted over the frequency range
[−π/ , π/Δ].

6.4 Spectral Resolution and Windowing

Now suppose that we have available a new 40 second data record x as shown in figure
7(a). This looks very similar in nature to the original data record shown in fig ure 1,
and indeed the DFT analysis performed by

>> N = length(x);
>> ws = 2*pi/N;
>> wnorm = -pi:ws:pi;
>> wnorm = wnorm(1:length(x));
>> w = wnorm*fs;

46
>> X=fft(x);

>> plot(w,abs(fftshift(X)))

>> axis([-30,30,0,500])

produces a spectral plot shown in figure 8 which indicates (as the plot did in figure 4)
a sine component at 5 rad/s. However, the data record shown in figure 7(b) is of the s
ame signal, except observed for a longer 120 second duration, and the spectral analysis
of this signal gives the spectral plot shown in figure 9 (the command axis([-
10,10,0,500]) has been used to `zoom in' on the spectral peak region) This indicates not
one, but two spectral peaks that are close together at approximately 4.7 and 5 rad/s.
Why are they noticeable in the spectral analysis of the long data-record signal, but not
in the short data-record one?

The answer is to do with windowing. Remember from lectures that the finite data
record DFT XN (ω) is related to the infinite data record sampled spectrum Xp(ω)
according to a convolution
1
XN (ω) = 2π [Up ⊛ W ] (ω)

where W (ω) = F {w} is the Fourier transform of the effective `window function' w(t)
which models the truncation of the infinite record to the finite one by multipli cation.

47
|XN(ω)| together with filtering profile

140
←Filtering
profile
120
100
80
Ma

60
40
20

Frequency
(rad/s)
0 −1
−30 −20 0 0 10 20 30

Figure 6.5: DFT magnitude|XN (mωs)|together with proposed


filteringprofile.
Now in the cases shown in figures 7(a),(b), the truncation fun ction w(t) is simply
of rectangular shape and of the form
1 ; t ∈ [0, T ]
w(t) =
0 ; Otherwise
This means that |W (ω) = F {w} | will be of the form
2 sin ωT /2
|W (ω)| =∗ 4 ≈ 0.63rad/s

48
which is greater than the sinusoid separation of 0.3 rad/s, and hence the `smearing'
interaction of the side-lobes blends the two peaks into one. However, for the longer
data record of T = 120 seconds

120∗ 4 ≈ 0.21rad/s

which is less than the sine-wave frequency separation, and hence the `smearing' action
does not blend the peaks and we can resolve them in figure 8

The frequency resolution can be enhanced by use of a window function other than
a rectangular one and which has a Fourier Transform with faster decaying side-lobes
that the sinc-type function. MATLAB im-plements more sophisticated sorts of
windows via the functions triang (triangular window), hamming, hanning and others.
T
For example to generate a hamming window of length N samples, the command

>> win = hamming(N);

49
Filtered signal
1.5
1
0.5
Magn

−0.5
−1

−1.5
0 5 10 15 20 25 30 35 40
Time (s)

Figure 6.6: Filtered version of signal shown in figure 1 with the filtering achieved
byuse of a DFT/IDFTconcatenation.

which produces a vector win which when plotted via plot(win) results in the diagram
shown in fig-ure 10. This can then be used to weight or window the data as

>> xw = win(:). *x(:);


(note the use of the colon notation x(:) to ensure both vectors are of column type
before point-wise multiplication) before the DFT is calculated and plotted via
>> xw = win(:). *x(:);
>> Xw=fft(xw);
>> plot(w,abs(fftshift(Xw)))
>> axis([-10,10,0,80])

50
to produce the diagram shown in figure 11. Notice that with the use of this appropriate
choice of Hamming window, the spectral resolution enhanced to the point where the
two sine-wave components at 4.7 and 5 rad/s can be resolved.

4
3
2
1
0
Ma

−1
−2
−3

−4
0 5 10 15 20 25 30 35 40

Figure-6.6

Sampled Signal

(a) 40 second data record

51
5
4
3
2
1

0
−1
−2
−3

−4 20 40 60 80 100 120
0

Sampled Signal, 120 second record

(b) Longer 120 second record


Figure 6.7: A short 40 second, and a longer 120 second record of the same signal.

52
|XN(ω)|
500
450
400
350
300
250
Mag

200
150
100
50
0
−30 −20 −10 0 10 20 30
Frequency (rad/s)

Figure 6.8: Spectrum of signal shown in figure 7(a).

53
|XN(ω)|
500
450
400
350
300
250
Ma

200
150
100
50

0 −
−10 −8 −6 −4 2 0 2 4 6 8 10

Frequency (rad/s)

Figure 6.9: Spectrum of signal shown in figure 7(b).

54
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 50 100 150 200 250 300 350

Figure-6.9.1

Hamming Window Weighting Sample Number

55
|XN(ω)|
80
70
60
50
40
Mag

30
20
10
0 −
−10 −8 −6 −4 2 0 2 4 6 8 10
Frequency
(radius)

Figure-6.9.2

56
CHAPTER 7

RESULTS

1. Checking the signal to make sure that there is no distortion or flaws in the signal.
2. The below figure depicts that signal has the lowest Bit Error Rate(BER),after
being preprocessed.
3. It is the process of sampling signals that measure real world physical conditions
.and converting the resulting samples into a digital numeric values that can be
manipulated by a computer.

FIGURE-7.1
SIGNAL ACQIUSITION

57
1. The figure represents the channel information which is used to transmitthe signal.
2. The software checks availability of bandwidth before transmitting thesignal.
3. If the followed Bandwidth is good the signal will be preprocessed andthen sent
it to receiver.

FIGURE-7.2

CHANNEL ESTIMATION

58
1. The below figure represents selection of a signal which has less distortions or
any noises .
2. This process is called Frequency Hopping spread sprectrum .
3. In this process software selects best signal among many other signals .

FIGURE-7.3

SPECTRUM ANALYSIS

59
1. This figure represents frequency of a signal and also it shows time
taken by a signal to transmit and receive .
2. The signal which has high frequency will carry the data has shown in
figure.

FIGURE-7.4

FREQUENCY SETUP

60
1. This figure represents signal which is chosen by all above methods and its been transmitted to
the receiver without no distortions or any disturbances.

FIGURE-7.5

COMMUNICATIONS

61
1. It represents performance analysis of all signals which is taken into
consideration.
2. The signal which decreases has low signal error rate and which travels
upwards has high signal error rate.
3. In this graph the blue color curve represents signal which has lowest signal
error rate.

Fig-6
SIGNAL ERROR RATE

62
CHAPTER 8

CONCLUSION

Cognitive users monitor the spectrum and are allowed to use it as long as it is does not interfere with
primary users to whom is has been licensed. SDR will have a key role to play in the cognitive System.
The SDR algorithms for successful data transmission in bandwidth available are proposed here.
CODEC adaptations, OQPSK to replace QPSK, the implementation of FHSS modulation &
demodulation in MATLAB, to be utilized to maintain the BER at high data rates and the perceptual
coding techniques for lossless data compression are presented. The degree of compression and
modification in already existing algorithms is again another critical issue to handle by SDR. Future
work focuses on experimentation of same spectrum sensing techniques for improving the performance
in cognitive radio and also finding out the one which is more suitable to work in wireless
environment. Further this can be extended for simultaneous transmission of multiple signals and use
of multiple frequency bands. Also this work will be quite helpful for implementation of real time
projects such as traffic control which can use this spectrum sensing method for wireless transmission
and detection of traffic video signals data from multiple signal posts to one master check post. This
can be further transferred to control unit which will use this information for controlling the traffic. So
decisive aim of this system is design and implementation of CR based traffic control system

63
REFERENCE
1. Federal Communications Commission, “Spectrum policy task force,” Report ET Docket no
02-135, 2002.View at: Google Scholar
2. S.-S. Byun, K. Kansanen, I. Balasingham, and J.-M. Gil, “Achieving fair spectrum
allocation and reduced spectrum handoff in wireless sensor networks: modeling via
biobjective optimization,” Modelling and Simulation in Engineering, vol. 2014, Article ID
406462, 12 pages, 2014.View at: PublisherSite | Google Scholar
3. J. Mitola and G. Q. Maguire, “Cognitive radio: making software radios more personal,”
IEEE Personal Communications, vol. 6, no. 4, pp. 13–18, 1999.View at: Publisher Site |
Google Scholar 4. B. Wang and K. J. R. Liu, “Advances in cognitive radio networks: a
survey,” IEEE Journal of Selected Topics in Signal Processing, vol. 5, no. 1, pp. 5–23,
2011.View at: Publisher Site | Google Scholar
5. Z. Tong, M. S. Arifianto, and C. F. Liau, “Wireless transmission using universal software
radio peripheral,” in Proceedings of the International Conference on Space Science and
Communication (IconSpace '09), pp. 19–23, Negeri Sembilan, Malaysia, October 2009.View
at: Publisher Site | Google Scholar
6. I. F. Akyildiz, W.-Y. Lee, M. C. Vuran, and S. Mohanty, “NeXt generation/dynamic
spectrum access/cognitive radio wireless networks: a survey,” Computer Networks, vol. 50,
no. 13, pp. 2127–2159, 2006.View at: Publisher Site | Google Scholar
7. H. Urkowitz, “Energy detection of unknown deterministic signals,” Proceedings of the
IEEE, vol. 55, no. 4, pp. 523–531, 1967.View at: Publisher Site | Google Scholar
8. T. Ulversoy, “Software defined radio: Challenges and opportunities,” IEEE
Communications Surveys & Tutorials, vol. 12, no. 4, pp. 531–550, 2010.View at: Publisher
Site | Google Scholar
9. R. Farrell, M. Sanchez, and G. Corley, “Software-defined radio demonstrators: an
example and future trends,” International Journal of Digital Multimedia Broadcasting, vol.
2009, Article ID 547650, 12 pages, 2009.View at: Publisher Site | Google Scholar84
10. E. Blossom,“GNU radio:tools for exploring the radio frequency spectrum,”
for real time video transmission
11. GNU Radio, 2017, http://gnuradio.org/.
12. SDR Kit, 2017, http://sdr-lab.com/.
13. S. Haykin, Communication Systems, John Wiley & Sons, New York, NY, USA, 4th edition,
2001.
14. R. Tandra and A. Sahai,“SNR walls for signal detection,” IEEE Journal of Selected Topics in
Signal Processing, vol. 2, no. 1, pp. 4–17, 2008.

64

You might also like