You are on page 1of 15

VISVESVARAYA TECHNOLOGICAL UNIVERSITY, BELAGAVI 590018

Programming Assignment Report on


SIMULATION OF FREQUENCY HOPPING SPREAD SPECTRUM
By
ANANYA G.M (1BM17CS015), ANJALI NAIR (1BM17CS016),
BATTULA PRAGATI (1BM17CS019), DIKSHA JAIN (1BM17CS024)

Under the Guidance of


Nandhini Vineeth
Assistant Professor, Department of CSE
BMS College of Engineering

Work carried out at

Department of Computer Science and Engineering


BMS College of Engineering
(Autonomous college under VTU)
P.O. Box No.: 1908, Bull Temple Road, Bangalore-560 019
2018-2019

BMS COLLEGE OF ENGINEERING


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

CERTIFICATE

This is to certify that the OOPS with JAVA programming assignment titled
“Simulation of Frequency-hopping spread spectrum” has been carried out
ANANYA G.M (1BM17CS015), ANJALI NAIR (1BM17CS016),
BATTULA PRAGATI (1BM17CS019) and DIKSHA JAIN (1BM17CS024) during the
academic year 2018-2019.

Signature of the guide. Signature of HOD.


Nandhini Vineeth

Signature of the examiner.

BMS COLLEGE OF ENGINEERING


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DECLARATION

We, ANANYA G.M(1BM17CS015), ANJALI NAIR(1BM17CS016), BATTULA PRAGATI


(1BM17CS019) and DIKSHA JAIN(1BM17CS024) students of 4th Semester, B.E,
Department of Computer Science and Engineering, BMS College of Engineering,
Bangalore, hereby declare that, this assignment work entitled "Simulation of
Frequency-hopping spread spectrum" has been carried out by us under the
guidance of Nandhini Vineeth, Assistant Professor, Department of CSE, BMS
College of Engineering, Bangalore during the academic semester Jan-May 2019.
We also declare that to the best of our knowledge and belief, the assignment
reported here is not from part of any other report by any other students.

Signature of the Candidates


ANANYA G.M (1BM17CS015)
ANJALI NAIR (1BM17CS016)
BATTULA PRAGATI (1BM17CS019)
DIKSHA JAIN (1BM17CS024)
Contents:

Chapter 1: Description of the project


1.1 Objective
1.2 Introduction
1.3 Modules and Block Diagram
1.4 Description of the modules

Chapter 2: Screenshots

Chapter 3: New learnings from the programming assignment

Chapter 4: Future Enhancements


CHAPTER 1: DESCRIPTION OF THE PROJECT

1.1 Objective

Simulation of FHSS (Frequency Hopping Spread Spectrum) aims at


replicating the message transmission using FHSS techniques. The
modulator frequency modulates different carrier signals
generated by a frequency synthesizer according to the pseudo
random frequency generator. The demodulator demodulates this
carrier using the previously obtained frequency information.

1.2 Introduction

Frequency Hopping Spread Spectrum (FHSS) is a method of


transmitting radio signals by rapidly switching a carrier among
many frequency channels, using a pseudorandom sequence
known to both transmitter and receiver. The data signal is
modulated with a narrowband carrier signal that "hops" in a
random but predictable sequence from frequency to frequency as
a function of time over a wide band of frequencies. It is used as a
multiple access method in the frequency- hopping code. This
involves the process of modulation and demodulation.

FHSS has many practical applications. Frequency Hopping Spread


Spectrum signals are highly resistant to deliberate jamming and
provides protection against eavesdropping, unless the adversary
has knowledge of the spreading characteristics.
1.3 Block Diagram and Packages
The packages present in the project are as follows:
1. connections
2. signals
3. graphs
4. random Frequencies
5. input
6. modulator
7. demodulator
8. main

Packages used at the modulator end:


1. connections
2. input
3. random Frequencies
4. signals
5. graph
6. modulator
7. main

Packages used at the demodulator end:


1. connections
2. signals
3. demodulator
4. main
1.4 Description of the packages:

1. Connections
CLASS: Server
This class is used to establish a port to port connection. The frequency
information and the modulated stream are read from text files and sent
to the client (demodulator).
CLASS: Client
This class receives the frequency information and modulated stream
from the server (modulator) and stores it in text files.

2. Signals
CLASS: DigitalSignal
The digital signal represents the binary data using NRZL scheme. This
class extends JPanel, paintComponent method is used to draw the
signal. Threads are used to animate the digital signal by making the
thread sleep at regular interval and updating the digital sequence to be
painted, repaint method is called after every update.
CLASS: Analog Signal
In the class, the carrier signal is generated. Sine wave equation is used
to obtain the data points for the wave according to the set frequency
sequence and period. This class extends JPanel. PaintComponent
method is used to draw the signal. Threads are used to animate the
analog signal by making the thread sleep at regular interval and
updating the data points to be painted. Repaint method is called after
every update.
3. Graphs
CLASS: FHSSGraph
FHSS graph is a hopping graph which represents the various frequencies
used as carrier at different intervals of time. The class extends JPanel
and paintComponent method is used to plot this graph.

4. Random frequencies
CLASS: RandomNumberGenerator
This class generates random numbers using the function:
Xn+1 = (a*Xn + b)mod m
The current system time in milliseconds is used as a seed for this
function.
CLASS: PseudoRandomCodeGenerator
This class generates a random frequency sequence within a pre-defined
range of frequencies using the generateRandom method of the
RandomNumberGenerator class.
5. Input
CLASS: InputReader
InputReader takes in the binary data and period from the user. Swings
are used to create the textboxes and the button and add them to a
JPanel. Event listener is used to validate the input data. Action listener
is added to the button and the inputs are stored.

6. Modulator
CLASS: ModulateSignal
Frequency-shift keying (FSK) Modulation is done here. The output of a
FSK modulated wave is high in frequency for a binary high input and is
low in frequency for a binary low input. The modulated frequency
stream is then written out to a file “ModulatedStream.txt”.

7. Demodulator
CLASS: DemodulateSignal
This class reads the frequency information and modulated streams
from their respective text files and obtains the bit stream by
demodulating the modulated stream.
8. Main
CLASS: ModulatorMain
This class puts together all the functionalities required by the
modulator. It creates a JFrame and places all the JPanels thereby,
creating a user interface. This is used to display the input taken from
the user, input signal, carrier signal, modulated signal and FHSS graph.
The modulated stream is then sent to the demodulator by the Server
class using a port to port connection.
CLASS: DemodulatorMain
This class puts together all the functionalities required by the
demodulator. It creates a JFrame and places all the JPanels thereby,
creating a user interface. The Client class receives modulated stream
from the modulator. The demodulated stream is then displayed along
with its NRZL representation.
Chapter 2: SCREEN SHOTS

Modulator:
Demodulator:
Chapter 3: NEW LEARNINGS FROM THE PROGRAMMING
ASSIGNMENT

Through this project we learnt the working of java swings. We learnt to


connect devices over the same network using port to port connection
and transmit data between these devices. This gave us a better
understanding of the Frequency Hopping Spread Spectrum.
Chapter 4. FUTURE ENHANCEMENTS

Our project deal with transmitting data over a single channel. This
project can be further modified to include many channels of data
transmission by multiplexing the signals.
An encryption algorithm can be applied over spreading codes, to
improve the security of FHSS.
The project can be modified to send different kinds of data like images,
text messages, etc.

You might also like