Frequency Domain Techniques For Void Spectrum Detection in Cognitive Radio Network
Frequency Domain Techniques For Void Spectrum Detection in Cognitive Radio Network
Frequency Domain Techniques For Void Spectrum Detection in Cognitive Radio Network
PROJECT REPORT
By
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.
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.
Users which are not transmitting will have void sub bands.
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];
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))
t=0:Ts:1*cyc/f(u);
xc=sin(2*pi*f(u)*t);
XC=[XC xc];
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);
%% Receiver
spec=abs(real(fft(xr)));
plot(spec,'b-');
grid on;
hold on;
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;
else
FREQ=[FREQ 0];
end
k=k+band;
end
plot(POS,MX,'r*');
hold off;
title('spectrum sensing');
FREQ
void_user=find(FREQ==0);
disp(void_user);
d=0;
k=0;
for(i=2:length(FREQ))
d=d+FREQ(i)-FREQ(i-1);
k=k+1;
end
end
d=d/k
fa=1;
try
fa=void_user(1);
fa=FREQ(fa-1)+d;
catch ex
return
end
COMMAND WINDOW:
FREQ =
d=
94.4310
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
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
Quadrature amplitude modulation (QAM), which uses two AM carriers to encode two or
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
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: