0% found this document useful (0 votes)
327 views

Experiment FSK Modulation Simulation

The document describes an experiment to generate and demodulate frequency shift keyed (FSK) signals using Octave. It provides theory on FSK modulation including generating two carrier frequencies to represent binary 1s and 0s. The algorithm section outlines generating FSK modulated signals by multiplying carrier frequencies with message signals, and demodulating by correlating the modulated signal with carrier frequencies and thresholding. The program section implements FSK modulation and demodulation in Octave by generating carriers, modulating a random binary message, and demodulating the signal to recover the original data.

Uploaded by

Vinny Veniz
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
327 views

Experiment FSK Modulation Simulation

The document describes an experiment to generate and demodulate frequency shift keyed (FSK) signals using Octave. It provides theory on FSK modulation including generating two carrier frequencies to represent binary 1s and 0s. The algorithm section outlines generating FSK modulated signals by multiplying carrier frequencies with message signals, and demodulating by correlating the modulated signal with carrier frequencies and thresholding. The program section implements FSK modulation and demodulation in Octave by generating carriers, modulating a random binary message, and demodulating the signal to recover the original data.

Uploaded by

Vinny Veniz
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 9

Experiment No.

FREQUENCY SHIFT KEYING

Aim: To generate and demodulate frequency shift keyed (FSK) signal using OCTAVE

Theory Generation of FSK

Frequency-shift keying (FSK) is a frequency modulation scheme in which digital information is


transmitted through discrete frequency changes of a carrier wave. The simplest FSK is binary FSK
(BFSK). BFSK uses a pair of discrete frequencies to transmit binary (0s and 1s) information. With
this scheme, the "1" is called the mark frequency and the "0" is called the space frequency.

In binary FSK system, symbol 1 & 0 are distinguished from each other by transmitting one of the
two sinusoidal waves that differ in frequency by a fixed amount.

Si (t) = √2E/Tb cos 2πf1t 0≤ t ≤Tb

0 elsewhere
Where i=1, 2 & Eb=Transmitted energy/bit
Transmitted freq= ƒi = (nc+i)/Tb, and n = constant (integer), Tb = bit interval
Symbol 1 is represented by S1 (t)
Symbol 0 is represented by S0 (t)

BFSK Transmitter

X
Binary wave c1 (t) = √2/Tb cos 2πƒ1t +
(On-Off signaling
Form) Σ

Inverter + FSK signal


X

c2 (t) = √2/Tb cos 2πƒ2t

The input binary sequence is represented in its ON-OFF form, with symbol 1
represented by constant amplitude of √Eb with & symbol 0 represented by zero volts.
By using inverter in the lower channel, we in effect make sure that when symbol 1is
at the input, The two frequency f1& f2 are chosen to be equal integer multiples of the
bit rate 1/Tb.By summing the upper & lower channel outputs, we get BFSK signal.
BFSK Receiver x1
X Tbƒdt
0 + x = x1-x2
c1 (t) L Decision
E
Device
FSK signal -
Tbƒdt choose ‘1’ if x >0
X
c2 (t) x2 choose ‘0’ if x < 0

The receiver consists of two correlators with common inputs which are supplied with
locally generated coherent reference signals c1(t) and c2 (t).

The correlator outputs are then subtracted one from the other, and the resulting difference
x is compared with a threshold of zero volts. If x >0, the receiver decides in favour of
symbol 1 and if x <0, the receiver decides in favour of symbol 0.

Algorithm Initialization

commands FSK

modulation

1. Generate two carriers signal.


2. Start FOR loop
3. Generate binary data, message signal and inverted message signal
4. Multiply carrier 1 with message signal and carrier 2 with inverted message signal
5. Perform addition to get the FSK modulated signal
6. Plot message signal and FSK modulated signal.
7. End FOR loop.
8. Plot the binary data and carriers.

FSK demodulation

1. Start FOR loop


2. Perform correlation of FSK modulated signal with carrier 1 and carrier 2 to get two decision
variables x1 and x2.
3. Make decision x = x1-x2 to get demodulated binary data. If x>0, choose ‘1’ else choose ‘0’.
4. Plot the demodulated binary data.

11
Program

% FSK Modulation

clc;
clear all;
close all;
%GENERATE CARRIER SIGNAL
Tb=1; fc1=2;fc2=5; t=0:
(Tb/100):Tb;
c1=sqrt(2/Tb)*sin(2*pi*fc1*t);
c2=sqrt(2/Tb)*sin(2*pi*fc2*t);
%generate message signal
N=8;
m=rand(1,N);
t1=0;t2=Tb
for i=1:N
t=[t1:(Tb/100):t2]
if m(i)>0.5
m(i)=1;
m_s=ones(1,length(t));
invm_s=zeros(1,length(t));
else
m(i)=0;
m_s=zeros(1,length(t));
invm_s=ones(1,length(t));
end
message(i,:)=m_s;
%Multiplier
fsk_sig1(i,:)=c1.*m_s;
fsk_sig2(i,:)=c2.*invm_s;
fsk=fsk_sig1+fsk_sig2;
%plotting the message signal and the modulated signal
subplot(3,2,2);
axis([0 N -2 2]);
plot(t,message(i,:),'r');
title('message signal');
xlabel('t------------------------------>');
ylabel('m(t)');grid on;hold on;
subplot(3,2,5);plot(t,fsk(i,:));
title('FSK signal');
xlabel('t-------------------------->');
ylabel('s(t)');
grid on;
hold on;
t1=t1+(Tb+.01); t2=t2+(Tb+.01);
end
4
hold off

%Plotting binary data bits and carrier signal


subplot(3,2,1);
stem(m);
title('binary data');
xlabel('n---->');
ylabel('b(n)');
grid on;
subplot(3,2,3);
plot(t,c1);
title('carrier signal-1');
xlabel('t------------------------------>');
ylabel('c1(t)');
grid on;
subplot(3,2,4);
plot(t,c2);
title('carrier signal-2');
xlabel('t------------------------------>');
ylabel('c2(t)');
grid on;

% FSK Demodulation

t1=0;t2=Tb
for i=1:N
t=[t1:(Tb/100):t2]
%correlator
x1=sum(c1.*fsk_sig1(i,:));
x2=sum(c2.*fsk_sig2(i,:));
x=x1-x2;
%decision device
if x>0
demod(i)=1;
else
demod(i)=0;
end t1=t1+
(Tb+.01); t2=t2+
(Tb+.01);
end
%Plotting the demodulated data bits
subplot(3,2,6);
stem(demod);
title(' demodulated data');
xlabel('n---->');
ylabel('b(n)');
grid on;
5
Modal Graphs

6
%Additional code for practice

clc %for clearing the command window


close all %for closing all the window except command window
clear all %for deleting all the variables from the memory
fc1=input('Enter the freq of 1st Sine Wave carrier:'); %100
fc2=input('Enter the freq of 2nd Sine Wave carrier:');%200
fp=input('Enter the freq of Periodic Binary pulse (Message):');%5
amp=input('Enter the amplitude (For Both Carrier & Binary Pulse Message):');%4
amp=amp/2;
t=0:0.001:1; % For setting the sampling interval
c1=amp.*sin(2*pi*fc1*t);% For Generating 1st Carrier Sine wave
c2=amp.*sin(2*pi*fc2*t);% For Generating 2nd Carrier Sine wave
subplot(4,1,1); %For Plotting The Carrier wave
plot(t,c1)
xlabel('Time')
ylabel('Amplitude')
title('Carrier 1 Wave')
subplot(4,1,2) %For Plotting The Carrier wave
plot(t,c2)
xlabel('Time')
ylabel('Amplitude')
title('Carrier 2 Wave')
m=amp.*square(2*pi*fp*t)+amp;%For Generating Square wave message
subplot(4,1,3) %For Plotting The Square Binary Pulse (Message)
plot(t,m)
xlabel('Time')
ylabel('Amplitude')
title('Binary Message Pulses')
for i=0:1000 %here we are generating the modulated wave
if m(i+1)==0
m(i+1)=c2(i+1);
else
m(i+1)=c1(i+1);
end
end
subplot(4,1,4) %For Plotting The Modulated wave
plot(t,m)
xlabel('Time')
ylabel('Amplitude')
title('Modulated Wave')

7
Out Put

Result

The program for FSK modulation and demodulation has been simulated in Octave and
necessary graphs are plotted.

conclusion :
_______________________________________________________________________________________________

8
9

You might also like