Académique Documents
Professionnel Documents
Culture Documents
Exp.No
.
EXPERIMENTS
Delta Modulation
QPSK modulation
EXPERIMENT 1
clc;
close all;
clear all;
% Signal generation
x=0:.5:4*pi;
sig1=8*sin(x);
l=length(sig1);
sig2=8*triang(l);
sig(1,i)=sig1(i);
sig(2,i)=sig2(i);
end
Result:
EXPERIMENT 2
Amplitude(V) ---->
Amplitude(V) ---->
Amplitude(V) ---->
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 ')
Result:
EXPERIMENT 4
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)
2
0
-2
2
0
-2
2
0
-2
2
0
-2
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
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
Result:
1
0
-1
4
time
sinusoidal signal
0
-2
4
time
PSK modulated signal
0
-2
time
EXPERIMENT 6
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 ---->
4
6
8
Time ---->
Odd Sequence BPSK Modulated Wave
2
Amplitude ---->
Amplitude ---->
Amplitude ---->
Amplitude ---->
Amplitude ---->
0
-2
4
6
Time ---->
QPSK Modulated Wave
0
-2
4
Time ---->