Sunteți pe pagina 1din 19

DIGITAL COMMUNICATION

EC – 301

Submitted by: Submitted to:


KUNAL KASHYAP Mr. RAJESH BIROK
2K17/EC/090 Associate Professor
INDEX

S.No. Experiment Date Done Signature


1. PAM wave using MATLAB 29/08/2019
2. PWM wave using MATLAB 29/08/2019
3. PPM wave using MATLAB 29/08/2019
ASK modulated wave using
4. 05/09/2019
MATLAB
FSK modulated wave using
5. 12/09/2019
MATLAB
B-PSK modulated wave using
6. 03/10/2019
MATLAB
EXPERIMENT – 1

Aim: To study Pulse Amplitude Modulation using MATLAB.

Theory:
Pulse Amplitude Modulation (PAM) is an analog modulating scheme in
which the amplitude of the pulse carrier varies proportional to the
instantaneous amplitude of the message signal.
The pulse amplitude modulated signal, will follow the amplitude of the
original signal, as the signal traces out the path of the whole wave. In
natural PAM, a signal sampled at the Nyquist rate is reconstructed, by
passing it through an efficient low pass frequency (LPF) with exact cutoff
frequency.
Though the PAM signal is passed through an LPF, it cannot recover the
signal without distortion. Hence to avoid this noise, flat-top sampling is
done.
Flat-top sampling is the process in which sampled signal can be represented
in pulses for which the amplitude of the signal cannot be changed with
respect to the analog signal, to be sampled. The tops of amplitude remain
flat. This process simplifies the circuit design.

MATLAB Code:
clc;
close all;
clear all;

fc = 20;
fm = 2;
fs = 1000;
t = 1;
n = 0:1/fs:1;
n = n(1:end – 1);
s = square(2*pi*fc*n);
s(find(s<0)) = 0;
m = sin(2*pi*fm*n);
pam = s.*m;

subplot(3,1,1);
plot(n,s,’LineWidth’,2);
ylim([-0.2 1.2]);
title(“Carrier pulse train”);
xlabel(“time”);
ylabel(“amplitude”);
subplot(3,1,2);
plot(n,m,’LineWidth’,2);
ylim([-1.2 1.2]);
title(“Message signal”);
xlabel(“time”);
ylabel(“amplitude”);
subplot(3,1,3);
plot(n,pam,’LineWidth’,2);
ylim([-1.2 1.2]);
title(“PAM output”);
xlabel(“time”);
ylabel(“amplitude”);

Output:

Learning Outcomes:
PAM has extensive uses in varied fields, including being a standard for some
versions of Ethernet communication, being used in the study of
photosynthesis, being used in the control of light-emitting diodes (LEDs),
and for broadcast of data that makes up the television signal.
EXPERIMENT – 2

Aim: To study Pulse Width Modulation using MATLAB.

Theory:
Pulse Width Modulation (PWM) or Pulse Duration Modulation (PDM) or
Pulse Time Modulation (PTM) is an analog modulating scheme in which the
duration or width or time of the pulse carrier varies proportional to the
instantaneous amplitude of the message signal.
The width of the pulse varies in this method, but the amplitude of the signal
remains constant. Amplitude limiters are used to make the amplitude of the
signal constant. These circuits clip off the amplitude, to a desired level and
hence the noise is limited.

There are three variations of PWM. They are −


• The leading edge of the pulse being constant, the trailing edge varies
according to the message signal.
• The trailing edge of the pulse being constant, the leading edge varies
according to the message signal.
• The center of the pulse being constant, the leading edge and the
trailing edge varies according to the message signal.
MATLAB Code:
clc;
close all;
clear all;

F2 = 10;
F1 = 15;
A = 5;
t = 0:0.001:1;
c = A.*sawtooth(2*pi*F1*t);
m = 0.75*A.*sin(2*pi*F2*t);
n = length(c);
for i=1:n
if(m(i)>=c(i))
pwm(i) = 1;
else
pwm(i) = 0;
end
end

subplot(3,1,1);
plot(t,c,’LineWidth’,2);
title(“Carrier sawtooth wave”);
xlabel(“time”);
ylabel(“amplitude”);
subplot(3,1,2);
plot(t,m,’LineWidth’,2);
title(“Message signal”);
xlabel(“time”);
ylabel(“amplitude”);
subplot(3,1,3);
plot(t,pwm,’LineWidth’,2);
title(“PWM output”);
xlabel(“time”);
ylabel(“amplitude”);
Output:

Learning Outcomes:
PWM has extensive uses in varied fields, including in controlling
servomechanisms, in telecommunications, being used to control the
amount of power delivered to a load, being used in efficient voltage
regulators, in subtractive synthesis method of sound synthesis, and in
micro-inverter design.
EXPERIMENT – 3

Aim: To study Pulse Position Modulation using MATLAB.

Theory:
Pulse Position Modulation (PPM) is an analog modulating scheme in which
the amplitude and width of the pulses are kept constant, while the position
of each pulse, with reference to the position of a reference pulse varies
according to the instantaneous sampled value of the message signal.
The transmitter has to send synchronizing pulses (or simply sync pulses) to
keep the transmitter and receiver in synchronism. These sync pulses help
maintain the position of the pulses.
Pulse position modulation is done in accordance with the pulse width
modulated signal. Each trailing of the pulse width modulated signal
becomes the starting point for pulses in PPM signal. Hence, the position of
these pulses is proportional to the width of the PWM pulses.

For some input,


MATLAB Code:
clc;
clear all;
close all;

fc = 20;
fm = 2;
fs = 1000;
t = 1;
n = 0:1/fs:1;
n = n(1:end-1);
duty = 10;
per = fs/fc; %no. of samples in 1 square wave period
on_t = per/duty; %no. of samples in on time

s = square(2*pi*fc*n,duty);
s(find(s<0)) = 0;
m = sin(2*pi*fm*n);

A = 1.25;
c = A.*sawtooth(2*pi*fc*n);

ppm = zeros(1,length(s));

id = find(c > m);


idd = diff(id);
iddd = find(idd -= 1);
temp(1) = id(1);
temp(2:length(iddd)+1) = id(iddd + 1);

for i=1:length(temp)
ppm(temp(i):temp(i) + on_t – 1) = 1;
end

subplot(3,1,1);
plot(n,m,’LineWidth’,2);
title(‘Message signal’);
xlabel(‘time’);
ylabel(‘amplitude’);
hold on;
plot(n,c,’r’,’LineWidth’,2);
subplot(3,1,2);
plot(n,s,’LineWidth’,2);
title(‘Pulse train’);
xlabel(‘time’);
ylabel(‘amplitude’);
ylim([-0.2 1.2]);
subplot(3,1,3);
plot(n,ppm,’LineWidth’,2);
title(‘PPM output’);
xlabel(‘time’);
ylabel(‘amplitude’);
ylim([-0.2 1.2]);

Output:

Learning Outcomes:
PPM has extensive uses in varied fields, including in optical communications
systems, narrowband RF communications, and other related applications.
EXPERIMENT – 4

Aim: To study Amplitude Shift Keying using MATLAB.

Theory:
Amplitude Shift Keying (ASK) is a type of Amplitude Modulation which
represents the binary data in the form of variations in the amplitude of a
signal.
Any modulated signal has a high frequency carrier. The binary signal when
ASK modulated, gives a zero value for Low input while it gives the carrier
output for High input.

MATLAB Code:
clc;
clear all;
close all;

b = [1 1 0 0 1 0 1 0]; %any binary sequence


n = length(b);
t = 0:0.01:n;
x = 1:1:(n+1)*100;
for i = 1:n
for j = i:0.1:i+1
bw(x(i*100:(i+1)*100)) = b(i);
end
end
fc = 5;
bw = bw(100:end);
carrier = sin(2*pi*fc*t);
ask = bw.*carrier;

subplot(3, 1, 1);
plot(t,bw,'LineWidth',2);
grid on;
xlabel('time');
ylabel('amplitude');
title('Message signal');
subplot(3, 1, 2);
plot(t,carrier,'LineWidth',2);
grid on;
xlabel('time');
ylabel('amplitude');
title('Carrier signal');
subplot(3, 1, 3);
plot(t,ask,'LineWidth',2);
grid on;
xlabel('time');
ylabel('amplitude');
title('ASK signal');

Output:
Learning Outcomes:
ASK has extensive uses in varied fields, including in telegraph systems (as
Morse code), fibre optic data transmission, and other related applications.
EXPERIMENT – 5

Aim: To study Frequency Shift Keying using MATLAB.

Theory:
Frequency Shift Keying (FSK) is the digital modulation technique in which
the frequency of the carrier signal varies according to the digital signal
changes. FSK is a scheme of frequency modulation.
The output of a FSK modulated wave is high in frequency for a binary High
input and is low in frequency for a binary Low input. The binary 1s and 0s
are called Mark and Space frequencies.

MATLAB Code:
clc;
close all;
clear all;

b = [1 1 0 0 1 0 1 0]; %any binary sequence


fc = 0.8;
n = length(b);
t = 0:0.01:n;
x = 1:1:(n+1)*100;
for i=1:n
if(b(i) == 0)
b_p(i) = -1;
else
b_p(i) = 1;
end
for j = i:0.1:i+1
bw(x(i*100:(i+1)*100)) = b_p(i);
end
end
bw = bw(100:end);
wo = 3*(2*pi*fc*t);
W = 2*(2*pi*fc*t);
sinHt = sin(wo+W);
sinLt = sin(wo-W);
modulated = sin(wo+(bw).*W);

subplot(4,1,1);
plot(t,sinHt,'LineWidth',2);
title('Carrier wave 1');
xlabel('time');
ylabel('amplitude');
subplot(4,1,2);
plot(t,sinLt,'LineWidth',2);
title('Carrier wave 2');
xlabel('time');
ylabel('amplitude');
subplot(4,1,3);
plot(t,bw,'LineWidth',2);
title('Binary message pulses');
xlabel('time');
ylabel('amplitude');
subplot(4,1,4);
plot(t,modulated,'LineWidth',2);
title('FSK signal');
xlabel('time');
ylabel('amplitude');
Output:

Learning Outcomes:
FSK has extensive uses in varied fields, including a two-tone method of
transmitting Morse code, early telephone-line modems, emergency alert
systems, and other related applications.
EXPERIMENT – 6

Aim: To study B-PSK (binary phase shift keying) using MATLAB.

Theory:
Phase Shift Keying (PSK) is the digital modulation technique in which the
phase of the carrier signal is changed by varying the sine and cosine inputs
at a particular time. PSK technique is widely used for wireless LANs, bio-
metric, contactless operations, along with RFID and Bluetooth
communications.
Binary Phase Shift Keying (B-PSK) is also called ‘two-phase PSK’ and ‘Phase
Reversal Keying’. In this technique, the sine wave carrier takes two phase
reversals, i.e. 0° and 180°.
B-PSK is basically a DSB-SC modulation scheme, the message being the
digital information.

MATLAB Code:
clc;
clear all;
close all;

g = [1 1 0 0 1 0 1 0]; %any binary sequence


f = 2;
t = 0:2*pi/99:2*pi;
cp = [];
sp = [];
mod = [];
bit = [];
for n = 1:length(g)
if g(n) == 0
die = -ones(1,100);
se = zeros(1,100);
else
die = ones(1,100);
se = ones(1,100);
end
c = sin(f*t);
cp = [cp die];
mod = [mod c];
bit = [bit se];
end

bpsk = cp.*mod;

subplot(2,1,1);
plot(bit,'LineWidth',2);
grid on;
xlabel('time');
ylabel('amplitude');
title('Input signal');
axis([0 100*length(g) -2.5 2.5])

subplot(2,1,2);
plot(bpsk,'LineWidth',2);
grid on;
xlabel('time');
ylabel('amplitude');
title('BPSK signal');
axis([0 100*length(g) -2.5 2.5])
Output:

Learning Outcomes:
B-PSK has extensive uses in varied fields, including wireless LANs, RFID,
Bluetooth communication, and other related applications.

S-ar putea să vă placă și