You are on page 1of 6

Exp. No.

10

SIMULATION of BASK, BFSK and BPSK

AIM:
To Simulate BASK, BFSK and BPSK using Mat lab and to obtain its time domain
responses.
REQUIREMENTS:
Personal computer
MATLAB 7
THEORY:
Baseband digital signals are suitable for transmission over a pair of wires or coaxial
cables due to its sizable power at low frequencies. These signals cannot be transmitted over a
radio link because this would require impractically large antennas to efficiently radiate the lowfrequency spectrum of the signal. Hence, for such purposes, we use analog modulation
techniques in which the digital signal messages are used to modulate a high-frequency
continuous-wave (CW) carrier.
In binary modulation schemes, the modulation process corresponds to switching (or
keying) the amplitude, frequency or phase of the CW carrier between either of two values
corresponding to binary symbols 0 or 1. The three types of digital modulation are amplitudeshift keying (ASK), frequency-shift keying (FSK) and phase-shift keying (PSK).
PROGRAM:
Amplitude Shift Keying:
clear;
clear all;
t=0:0.0001:0.05;
x=square(2*pi*100*t);
subplot(3,1,1);
plot(t,x);
title('Modulating wave');
xlabel('time->');
ylabel('amp->');

y=sin(2*pi*1000*t);
subplot(3,1,2);
plot(t,y);
title('Carrier wave');
xlabel('time->');
ylabel('amp->');
z=x.*y;
a=z+y;
subplot(3,1,3);
plot(t,a);
title('Modulated wave');
xlabel('time->');
ylabel('amp->');

Simulation Output:

Modulating wave
amp->

1
0
-1

0.005

0.01

0.015

0.02

0.025 0.03
time->
Carrier wave

0.035

0.04

0.045

0.05

0.005

0.01

0.015

0.02

0.035

0.04

0.045

0.05

0.005

0.01

0.015

0.02

0.035

0.04

0.045

0.05

amp->

1
0
-1

0.025 0.03
time->
Modulated wave

amp->

2
0
-2

0.025
time->

0.03

Frequency Shift Keying:


clc;
clear all;
t=0:0.0001:0.05;
disp('ENTER DETAILS OF MESSAGE:');
vm=input('Amplitude');
fm=input('Frequency');
wm=2*pi*fm;
disp('ENTER DETAILS OF CARRIER:');
vc=input('Amplitude');
fc=input('Frequency');
wc=2*pi*fc;
Vm=vm*(square(wm*t));
subplot(3,1,1);
plot(t,Vm);
title('MESSAGE');
xlabel('TIME---->');

ylabel('AMPLITUDE---->');

Vc=vc*(square(wc*t));
subplot(3,1,2);
plot(t,Vc);
title('CARRIER');
xlabel('TIME---->');

ylabel('AMPLITUDE---->');

x=sin(2*pi*(fc+25*Vm).*t);
subplot(3,1,3);
plot(t,x);
title('MODULATED');
xlabel('TIME---->');

ylabel('AMPLITUDE---->');

AMPLITUDE---->

AMPLITUDE---->

AMPLITUDE---->

Simulation Output:
MESSAGE
5
0
-5

0.005

0.01

0.015

0.02

0.025 0.03
TIME---->
CARRIER

0.035

0.04

0.045

0.05

0.005

0.01

0.015

0.02

0.025 0.03
TIME---->
MODULATED

0.035

0.04

0.045

0.05

0.005

0.01

0.015

0.02

0.035

0.04

0.045

0.05

1
0
-1

1
0
-1

0.025 0.03
TIME---->

Binary Phase Shift Keying:


fs=1000000;
fc=1000;
fm=100;
t=(1/fs):(1/fs):(2/fm);
m=square(2*pi*fm*t);
c=sin(2*pi*fc*t);
s=c.*m;
subplot(4,1,1);
plot(t,m);
title('MESSAGE');
xlabel('TIME---->');
subplot(4,1,2);
plot(t,c);
title('CARRIER');

ylabel('AMPLITUDE---->');

xlabel('TIME---->');

ylabel('AMPLITUDE---->');

subplot(4,1,3);
plot(t,s);
title('MODULATING SIGNAL');
xlabel('TIME---->');

ylabel('AMPLITUDE---->');

q=s.*c;
n=1; wn=0.005;
u=butter(n,wn,'low');
subplot(4,1,4);
plot(t,q);
title('DEMODULATING SIGNAL');
xlabel('TIME---->');

ylabel('AMPLITUDE---->');

AMPLITUDE---->
AMPLITUDE---->
AMPLITUDE---->
AMPLITUDE---->

Simulation Output:
MESSAGE
1
0
-1

0.002 0.004 0.006 0.008CARRIER


0.01 0.012 0.014 0.016 0.018
TIME---->

0.02

0.002 0.004 0.006 MODULATING


0.008 0.01 SIGNAL
0.012 0.014 0.016 0.018
TIME---->

0.02

0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018


DEMODULATING
TIME----> SIGNAL

0.02

0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018


TIME---->

0.02

1
0
-1
1
0
-1
1
0
-1

Model Graph:

Result:
BASK, BFSK and BPSK are simulated using Mat lab and its time domain responses are
obtained.

You might also like