Vous êtes sur la page 1sur 16

List of Experiments

Exp.No
.

EXPERIMENTS

Time division Multiplexing

Pulse Code Modulation

Delta Modulation

Frequency Shift Keying

Phase Shift Keying

QPSK modulation

EXPERIMENT 1

Time Division Multiplexing


AIM:To plot the wave form for Time Division Multiplexing signal using MATLAB for a stream of
bits
APPARATUS: MATLAB SOFTWARE
PROGRAM:

clc;
close all;
clear all;
% Signal generation
x=0:.5:4*pi;
sig1=8*sin(x);
l=length(sig1);
sig2=8*triang(l);

% siganal taken upto 4pi


% generate 1st sinusoidal signal
% Generate 2nd traingular Sigal

% Display of Both Signal


subplot(2,2,1);
plot(sig1);
title('Sinusoidal Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
subplot(2,2,2);
plot(sig2);
title('Triangular Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
% Display of Both Sampled Signal
subplot(2,2,3);
stem(sig1);
title('Sampled Sinusoidal Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
subplot(2,2,4);
stem(sig2);
title('Sampled Triangular Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
l1=length(sig1);
l2=length(sig2);
for i=1:l1

sig(1,i)=sig1(i);
sig(2,i)=sig2(i);
end

% Making Both row vector to a matrix

% TDM of both quantize signal


tdmsig=reshape(sig,1,2*l1);
% Display of TDM Signal
figure
stem(tdmsig);
title('TDM Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
% Demultiplexing of TDM Signal
demux=reshape(tdmsig,2,l1);
for i=1:l1
sig3(i)=demux(1,i);
% Converting The matrix into row vectors
sig4(i)=demux(2,i);
end
% display of demultiplexed signal
figure
subplot(2,1,1)
plot(sig3);
title('Recovered Sinusoidal Signal');
ylabel('Amplitude--->');
xlabel('Time--->');
subplot(2,1,2)
plot(sig4);
title('Recovered Triangular Signal');
ylabel('Amplitude--->');
xlabel('Time--->');

OUTPUT WAVE FORM:

Result:

EXPERIMENT 2

Pulse Code Modulation


AIM:To plot the wave form for Pulse Code Modulation signal using MATLAB
APPARATUS: MATLAB SOFTWARE
PROGRAM:
clc;
clear all;
t = 0:0.0005:20;
partition = -1:0.1:1;
codebook = -1:0.1:1.1;
x = sin(t);
[index,quants] = quantiz(x,partition,codebook);
subplot(3,1,1);
plot(t,x);
title('Message Signal');
xlabel('Time(s) ---->')
ylabel('Amplitude(V) ---->')
subplot(3,1,2);
plot(t,quants);
title('Quantized Signal');
xlabel('Time(s) ---->')
ylabel('Amplitude(V) ---->')
y = uencode(quants,3);
subplot(3,1,3);
plot(t,y);
title('PCM Signal');
xlabel('Time(s) ---->');
ylabel('Amplitude(V) ---->')

Amplitude(V) ---->

Amplitude(V) ---->

Amplitude(V) ---->

OUTPUT WAVE FORM:

Message Signal

1
0
-1

10
12
Time(s) ---->
Quantized Signal

14

16

18

20

10
12
Time(s) ---->
PCM Signal

14

16

18

20

10
12
Time(s) ---->

14

16

18

20

0
-1

10
5
0

Result:

EXPERIMENT 3

Delta Modulation
AIM:To plot the wave form for Delta Modulation signal using MATLAB
APPARATUS: MATLAB SOFTWARE

PROGRAM:
% DELTA MODULATiON
clc;
clear all;
close all;
a=2;
t=0:2*pi/50:2*pi;
x=a*sin(t);
l=length(x);
plot(x,'r');
delta=0.2;
hold on
xn=0;
for i=1:l;
if x(i)>xn(i)
d(i)=1;
xn(i+1)=xn(i)+delta;
else
d(i)=0; xn(i+1)=xn(i)-delta;
end
end
stairs(xn)
hold on
for i=1:d
if d(i)>xn(i)
d(i)=0;
xn(i+1)=xn(i)-delta;
else
d(i)=1; xn(i+1)=xn(i)+delta;
end
end
plot(xn,'c');
legend('Analog signal','Delta modulation','Demodulation')
title('DELTA MODULATION / DEMODULATION ')

OUTPUT WAVE FORM:

Result:

EXPERIMENT 4

Frequency Shift Keying


AIM:To plot the wave form for FSK signal using MATLAB
APPARATUS: MATLAB SOFTWARE

PROGRAM:
clear;
clc;
b = input('Enter the Bit stream \n '); %b = [0 1 0 1 1 1 0];
n = length(b);
t = 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:.1:i+1
bw(x(i*100:(i+1)*100)) = b_p(i);
end
end
bw = bw(100:end);
wo = 2*(2*pi*t);
W = 1*(2*pi*t);
sinHt = sin(wo+W);
sinLt = sin(wo-W);
st = sin(wo+(bw).*W);
subplot(4,1,1)
plot(t,bw)
grid on ; axis([0 n -2 +2])
subplot(4,1,2)
plot(t,sinHt)
grid on ; axis([0 n -2 +2])
subplot(4,1,3)
plot(t,sinLt)
grid on ; axis([0 n -2 +2])
subplot(4,1,4)
plot(t,st)

grid on ; axis([0 n -2 +2])


Fs=1;
figure %pburg(st,10)
periodogram(st)

OUTPUT WAVE FORMS:

2
0
-2
2

0
-2
2
0
-2
2
0
-2

Periodogram Power Spectral Density Estimate

50

Power/frequency (dB/rad/sample)

0
-50
-100
-150
-200
-250
-300
-350

0.1

0.2

0.3
0.4
0.5
0.6
0.7
0.8
Normalized Frequency ( rad/sample)

Result:

EXPERIMENT 5

0.9

Phase Shift Keying


AIM:To plot the wave form for PSK signal using MATLAB
APPARATUS: MATLAB SOFTWARE

PROGRAM:
clc;
clear all;
close all;
x=input('Enter the input binary sequence');
N=length(x);
x(x==0)=-1;
t=0.01:0.01:N;
c=2*sin(2*pi*t);
for i=1:1:N
m((i-1)*100+1:i*100)=x(i);
end
y=c.*m;
subplot(3,1,1);
plot(t,m);
xlabel('time');
ylabel('amplitude');
title('digital input signal');
subplot(3,1,2);
plot(t,c);
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
subplot(3,1,3);
plot(t,y);
xlabel('time');
ylabel('amplitude');
title('PSK modulated signal');

amplitude

amplitude

amplitude

OUTPUT WAVE FORMS:

Result:

digital input signal

1
0
-1

4
time
sinusoidal signal

0
-2

4
time
PSK modulated signal

0
-2

time

EXPERIMENT 6

Quadrature Phase Shift Keying


AIM:To plot the wave form for QPSK signal using MATLAB
APPARATUS: MATLAB SOFTWARE

PROGRAM:
clear;
clc;
b = input('Enter the bit stream = ');
n = length(b);
t = 0:0.01:n;
x = 1:1:(n+2)*100;
for i = 1:n
if (b(i) == 0)
u(i) = -1;
else
u(i) = 1;
end
for j = i:0.1:i+1
bw(x(i*100:(i+1)*100)) = u(i);
if (mod(i,2) == 0)
bw_e(x(i*100:(i+1)*100)) = u(i);
bw_e(x((i+1)*100:(i+2)*100)) = u(i);
else
bw_o(x(i*100:(i+1)*100)) = u(i);
bw_o(x((i+1)*100:(i+2)*100)) = u(i);
end
if (mod(n,2)~= 0)
bw_e(x(n*100:(n+1)*100)) = -1;
bw_e(x((n+1)*100:(n+2)*100)) = -1;
end
end
end
bw = bw(100:end);
bw_o = bw_o(100:(n+1)*100);
bw_e = bw_e(200:(n+2)*100);
cost = cos(2*pi*t);

sint = sin(2*pi*t);
x = bw_o.*cost;
y = bw_e.*sint;
z = x+y;
subplot(3,2,1);
plot(t,bw);
xlabel('n ---->');
ylabel('Amplitude ---->');
title('Input Bit Stream');
grid on ;
axis([0 n -2 +2]);
subplot(3,2,5);
plot(t,bw_o);
xlabel('n ---->');
ylabel('Amplitude ---->');
title('Odd Sequence');
grid on ;
axis([0 n -2 +2]);
subplot(3,2,3);
plot(t,bw_e);
xlabel('n ---->');
ylabel('Amplitude ---->');
title('Even Sequence');
grid on ;
axis([0 n -2 +2]);
subplot(3,2,4);
plot(t,x);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('Odd Sequence BPSK Modulated Wave');
grid on ;
axis([0 n -2 +2]);
subplot(3,2,2);
plot(t,y);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('Even Sequence BPSK Modulated Wave');
grid on ;
axis([0 n -2 +2]);
subplot(3,2,6);
plot(t,z);
xlabel('Time ---->');
ylabel('Amplitude ---->');
title('QPSK Modulated Wave');

grid on ;
axis([0 n -2 +2]);

Result:

0
-2

4
6
n ---->
Even Sequence

0
-2

4
6
n ---->
Odd Sequence

0
-2

4
n ---->

Amplitude ---->

Even Sequence BPSK Modulated Wave


2
0
-2

4
6
8
Time ---->
Odd Sequence BPSK Modulated Wave
2

Amplitude ---->

Input Bit Stream

Amplitude ---->

Amplitude ---->

Amplitude ---->

Amplitude ---->

OUTPUT WAVE FORM

0
-2

4
6
Time ---->
QPSK Modulated Wave

0
-2

4
Time ---->

Vous aimerez peut-être aussi