Impact-Site-Verification: dbe48ff9-4514-40fe-8cc0-70131430799e

## Search This Blog

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. It is used as a multiple access method in the code division multiple access (CDMA) scheme frequency-hopping code division multiple access (FH-CDMA).

Each available frequency band is divided into sub-frequencies. Signals rapidly change ("hop") among these in a predetermined order. Interference at a specific frequency will only affect the signal during that short interval. FHSS can, however, cause interference with adjacent direct-sequence spread spectrum (DSSS) systems.

A sub-type of FHSS used in Bluetooth wireless data transfer is adaptive frequency-hopping spread spectrum (AFH).

### MATLAB Program:

clc;
clear all;
close all;

% Generation of bits
N=20;
s=randint(1,N);   % Generating N bits
signal=[];
carrier=[];
T=180;
t=0:2*pi/(T-1):2*pi;     % Creating T samples for one cosine
subplot(5,1,1);
stem(s);
set(gca,'XTick',1:N,'XLim',[0.66 N+0.33]);    %Setting axis limits and scale for the graph
title('Binary information');
ylabel('Amplitude(V)');
xlabel('Time(s)');

% Generation of bit pattern/bit stream(Polar NRZ type)
for k=1:N
if s(1,k)==0
sig=-ones(1,T);    % T no.of MINUS ONES for bit 0
else
sig=ones(1,T);     % T no.of ONES for bit 1
end
c=cos(t);
carrier=[carrier c];
signal=[signal sig];
end
subplot(5,1,2);
stairs(signal);
set(gca,'XTick',0:T:N*T,'XLim',[-60 N*T+60],'YLim',[-1.5 1.5]);      %Setting axis limits and scale for the graph
title('Original Bit Sequence');
ylabel('Amplitude(V)');
xlabel('Time(s)');

% BPSK Modulation of the signal
bpsk_sig=signal.*carrier;   % Modulating the signal
subplot(5,1,3);
plot(bpsk_sig);
set(gca,'XTick',0:T:N*T,'XLim',[-60 N*T+60],'YLim',[-1.5 1.5]);
title('BPSK Modulated Signal');
ylabel('Amplitude(V)');
xlabel('Time(s)');

% Preparation of 6 new carrier frequencies
t1=0:2*pi/8:2*pi;
t2=0:2*pi/9:2*pi;
t3=0:2*pi/17:2*pi;
t4=0:2*pi/35:2*pi;
t5=0:2*pi/89:2*pi;
t6=0:2*pi/179:2*pi;
c1=cos(t1);
c1=[c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1 c1];
c2=cos(t2);
c2=[c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2 c2] ;
c3=cos(t3);
c3=[c3 c3 c3 c3 c3 c3 c3 c3 c3 c3] ;
c4=cos(t4);
c4=[c4 c4 c4 c4 c4];
c5=cos(t5);
c5=[c5 c5];
c6=cos(t6);

% Random frequency hops to form a spread signal
for n=1:N
c=randint(1,1,[1 6]);
switch(c)
case(1)
case(2)
case(3)
case(4)
case(5)
case(6)
end
end
subplot(5,1,4);
set(gca,'XTick',0:T:N*T,'XLim',[-60 N*T+60],'YLim',[-1.5 1.5]);
ylabel('Amplitude(V)');
xlabel('Time(s)');

% Spreading BPSK Signal into wider band with total of 12 frequencies
subplot(5,1,5);
plot(1:N*T,freq_hopped_sig);
set(gca,'XTick',0:T:N*T,'XLim',[-60 N*T+60],'YLim',[-1.5 1.5]);
ylabel('Amplitude(V)');
xlabel('Time(s)');

figure;
subplot(3,1,1);
plot(1:N*T,freq_hopped_sig);
set(gca,'XTick',0:T:N*T,'XLim',[-60 N*T+60],'YLim',[-1.5 1.5]);
ylabel('Amplitude(V)');
xlabel('Time(s)');

% Demodulated BPSK Signal
subplot(3,1,2);
plot(demod_psk);
set(gca,'XTick',0:T:N*T,'XLim',[-60 N*T+60],'YLim',[-1.5 1.5]);
title('Demodulated BPSK Signal');
ylabel('Amplitude(V)');
xlabel('Time(s)');

% Demodulated Binary Signal
demod_sig=[];
for j=0:T:N*T-1
if demod_psk(j+1)<0
sig=-ones(1,T);
else
sig=ones(1,T);
end
demod_sig=[demod_sig sig];
end
subplot(3,1,3);
stairs(demod_sig);
set(gca,'XTick',0:T:N*T,'XLim',[-60 N*T+60],'YLim',[-1.5 1.5]);      %Setting axis limits and scale for the graph
title('Demodulated Binary Signal');
ylabel('Amplitude(V)');
xlabel('Time(s)');