Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Frequency Domain Techniques For Void Spectrum Detection in Cognitive Radio Network

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

FREQUENCY DOMAIN TECHNIQUES FOR VOID SPECTRUM

DETECTION IN COGNITIVE RADIO NETWORK

PROJECT REPORT

Submitted for the Course:


Signal Analysis and Processing (ECE1018)

By

SR NO. NAME REGISTRATION NO.

1. OISHEE MAZUMDER 17BIS0100

2. ROSHNI SINGH 17BIS0007

3. SHIVAM GAUR 17BIS0026

4. KARTHIK KUMAR 17BIS0003


ABSTRACT

The goal of this project is to detect the sub void bands in the message
signal transmitted by the user and display the user which is/are absent.
Also, it will provide a frequency which may be given over to a secondary
user for temporary use. We will add AWGN noise to simulate a real
enviroment. Finally the concept of emulation attack and its preventive
measures will be introduced. All the simulation will be shown on
MATLAB.

At the end of the project we will successfully perform the following


activities:

 Plot the message, carrier and the modulated signal corresponding


to the message bits sent by the users.
 Show the various effects of noise on the signal sent.
 Plot the frequency spectrum of the transmitted signal, and detect
the void sub bands
 Calculate the average spacing between two frequencies to tell
what frequency may be allotted to the SU.
 However, we will be taking information from the SU only for the
least void sub band.
CHAPTER 1
INTRODUCTION

Cognitive Radio is relatively new standard for mobile communication,


especially designed to meet the challenges of high spectrum demand for
packet data. As spectrum is limited and expensive, unutilized spectrum is an
economic constraint for the service provider. It provides a solution for this by
providing means of reallocating the unused spectrum to secondary user (SU)
when part of spectrum is unused by primary users (PU).

Some of the Past Techniques used:

Most techniques previously depended upon certain threshold value as the


result of mathematical or filter operations being performed.

One of the major drawback of the above techniques is that the signal
conditions and properties changes significantly under varying conditions.
Hence setting a fixed threshold is difficult.
CHAPTER 2
PROPOSED SYSTEM

We have thus realized that detecting energy in the primary user band is
most efficient way to conclude whether an user is present or not.

Thus FFT of the signal reveals not only the frequencies being present in
the signal but at the same time the energy content of the bands.

We therefore propose our system in which we detect energy in primary


user band to conclude whether an user is present there or not and also
we use FFT of the signal in order to figure out the energy content of the
bands as well as the frequencies.
CHAPTER 3
METHODOLOGY

 Primary user transmits modulated data over AWGN channel.

 A single transmission slot contains all the frequencies of the primary


users.

 Users which are not transmitting will have void sub bands.

 The objective is to detect the absence of users from analysis of this


transmitted signal.

 Each licensed user is allocated with a unique frequency.

 At every transmission frame each primary user can transmit one bit each
encoded with either 1 or -1. If a user has no data to transmit, the base
station will transmit 0.

 But due to sampling noise, channel noise, ideal response is not possible
to get.
CHAPTER 4
MATLAB CODE
clc;

clear all;

close all;

%msg=[1 0 -1 1 -1 -1 -1 -1 1 1];

msg= input('enter message in [1 1 0 -1....]format:');

%% define carrier signal

PrimaryFreq=[100 200 300 400 500 600 700 800 900 1000]

U=1:10;

f=PrimaryFreq(U);

fs=5000;

Ts=1/fs;

me=[];

ME=[];

XC=[];

XA=[];

M=8;
for(u=1:length(U))

% for each msg bit 10 cycles of sine

cyc=1*M; %as each bit is modulated differently

t=0:Ts:1*cyc/f(u);

xc=sin(2*pi*f(u)*t);

XC=[XC xc];

%% msg converterd to pulse

j=1;

k=1;

tm=0:Ts:M/f(u);

me=[];

for(i=1:length(xc))

me(i)=msg(u);

k=k+1;

end

ME=[ME me];

end

%% modulation

xm=XC.*ME;
stem(ME, 'r-');

hold on;

plot(XC,'g-');

hold on;

plot(xm,'b-','LineWidth',1);

title('modulated signal');

legend('Message','Carrier','modulated');

%% channel

SNR=120;

xr=awgn(xm,SNR);

figure

plot(xr);

title('noisy received signal');

%% Receiver

%% detection of the base frequency

spec=abs(real(fft(xr)));

plot(spec,'b-');

grid on;
hold on;

% suppose 5000 HZ represented by 301 point

% suppose 100 HZ represented by 301*100/5000 = 6 point

% now search for 100,200,300........Freq components

band=floor(length(spec)*100/fs); % freq step for stop band

lowF=floor(length(spec)*100/fs); % starting freq

maxF=floor(length(spec)*1000/fs); %as 1000 is max freq

freFraction=fs/length(spec); % amount of freq at each point in FFT

W=3; % search window

k=0;

MX=[];

POS=[];

FREQ=[];

for(i=lowF:band:maxF)

sp=spec(i-W:i+W);

mx=max(sp);

fi=find(sp==mx,1);

MX=[MX mx];

POS=[POS fi+i-W];

frq=(fi+i-W)*freFraction;

if(mx>15) % hard threshold


FREQ=[FREQ frq];

else

FREQ=[FREQ 0];

end

k=k+band;

end

plot(POS,MX,'r*');

hold off;

title('spectrum sensing');

legend('Frequency Spectrum','User bands');

FREQ

void_user=find(FREQ==0);

disp('following users are absent');

disp(void_user);

%% Intermediate BS will reuse the spectrum

% BS will see the diff between subsequent freqs and predict

d=0;

k=0;
for(i=2:length(FREQ))

if(FREQ(i)~=0 && FREQ(i-1)~=0)

d=d+FREQ(i)-FREQ(i-1);

k=k+1;

end

end

disp('Average predicted spacing btn user Freqs=>');

d=d/k

%% BS reallocates first unused freq

fa=1;

try

fa=void_user(1);

fa=FREQ(fa-1)+d;

catch ex

disp('all PU present....no reallocation');

return

end

fprintf('freq reallocated for user=%d\n is %5.1f\n\n',void_user(1),fa);

sd=input('enter data to be sent= ');

COMMAND WINDOW:

enter message in [1 1 0 -1....]format: [1 0 -1 1 -1 0 -1 -1 1 1]


PrimaryFreq =

100 200 300 400 500 600 700 800


900 1000

FREQ =

114.4068 0 309.3220 406.7797 491.5254 588.9831 690.6780


796.6102 889.8305 970.3390

following users are absent


2

Average predicted spacing btn user Freqs=>

d=

94.4310

freq reallocated for user=2


is 208.8

enter data to be sent= -1


CHAPTER 5
MODULATION

MODULATION

Modulation is the process of converting data into radio waves by adding information to an
electronic or optical carrier signal

Types of modulation:

There are many common modulation methods, including the following -- a very incomplete

list:

 Amplitude modulation (AM), in which the height -- i.e., the strength or intensity -- of the

signal carrier is varied to represent the data being added to the signal.

 Frequency modulation (FM), in which the frequency of the carrier waveform is varied to

reflect the frequency of the data.

 Phase modulation (PM), in which the phase of the carrier waveform is varied to reflect

changes in the frequency of the data. In PM, the frequency is unchanged while the

phase is changed relative to the base carrier frequency. It is similar to FM.

 Polarization modulation, in which the angle of rotation of an optical carrier signal is

varied to reflect transmitted data.

 Pulse-code modulation, in which an analog signal is sampled to derive a data stream

that is used to modulate a digital carrier signal.

 Quadrature amplitude modulation (QAM), which uses two AM carriers to encode two or

more bits in a single transmission.


CHAPTER 6
MODULATED SIGNAL
Our modulated signal thus looks as follows where the message signal is
represented in red, the carrier signal is represented in green and the
modulated signal is represented in blue.
CHAPTER 7
SNR VALUE

Signal-to-noise ratio (abbreviated SNR or S/N) is a measure used in science and engineering
that compares the level of a desired signal to the level of background noise. SNR is defined as
the ratio of signal power to the noise power, often expressed in decibels. A ratio higher than 1:1
(greater than 0 dB) indicates more signal than noise.

While SNR is commonly quoted for electrical signals, it can be applied to any form of signal, for
example isotope levels in an ice core, biochemical signaling between cells, or financial trading
signals. Signal-to-noise ratio is sometimes used metaphorically to refer to the ratio of useful
information to false or irrelevant data in a conversation or exchange. For example, in online
discussion forums and other online communities, off-topic posts and spam are regarded as
"noise" that interferes with the "signal" of appropriate discussion.
CHAPTER 8
EFFECT OF CHANGE IN SNR VALUE

We observe that as we increase the signal to noise ratio, the noise is


reduced.
CHAPTER 9
FREQUENCY SPECTRUM OF TRANSMITTED SIGNAL
CHAPTER 10
RESULTS AND DISCUSSION

As spectrum is limited and expensive, unutilized spectrum is an economic constraint for


the service provider. Cognitive radio provides a solution for this by providing means of
reallocating the unused spectrum to secondary user (SU) when part of spectrum is
unused by primary users (PU). Several past works have addressed this issue using
various algorithm which ranges from statistical analysis to predictive analysis. In this
paper we propose a novel solution for spectrum sensing using frequency domain
analysis of the transmitted data. However, one of the lesser addressed issues in this
direction has been the consideration of PU emulation attack. If a SU has sufficient
means of estimating void spectrum, then it can emulate a PU spectrum which then
results is low accuracy in void spectrum detection.

FFT of signal data in a time slot reveals the energy in the bands.

Comparison with QR based spectrum sensing technique reveals that the proposed work
provides better sensing under high noise by triggering fewer false alarms and through
more accurate prediction of the unused spectrum.
CONCLUSION
The project was successfully executed and we are able to perform the
following activities:

 Plot the message, carrier and the modulated signal corresponding


to the message bits sent by the users.
 Show the various effects of noise on the signal sent.
 Plot the frequency spectrum of the transmitted signal, and detect
the void sub bands
 Calculate the average spacing between two frequencies to tell
what frequency may be allotted to the SU.
 However, we will be taking information from the SU only for the
least void sub band.

You might also like