You are on page 1of 6

Southeast University

Electrical &Electronic Eng.


Md. Zahedul Islam Roman
ID : 2019000520062
EEE 324.2

4 No Lab report

Objective :

To understand the theoretical foundations of analog


communications as well as Delta and adaptive delta
modulation algorithm using Matlab.

Theory :

This is a type of delta modulation technique. In digital


modulation, there is a problem in determining the step
size, which may have an influence on the quality of
the wave, which is produced as output. We require a
larger step size in the steep slope of the modulating
signal, and a small step size is required when the
message has a small slope.
Code :
% MATLAB code for modulation
% ID 2019000520062
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;
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) %Modulation part
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; %demodulation part
end
end
plot(xn,'c'); %plot delta graph% adaptive delta
modulation for sinwave
clear all
t=[0:2*pi/100:4*pi];
a=10*sin(t);
n=length(a);
xhat(1:n)=0;
x(1:n)=a;
d(1:n)=1;
for k=2:n
if ((x(k)-xhat(k-1)) > 0 )
d(k)=1;
d(k)=1;
else d(k)=-1;
end
if k==2
xhat(k)=d(k)+xhat(k-1);
end
if ((xhat(k)-xhat(k-1)) > 0)
if (d(k-1) == 1 &d(k) ==1)
xhat(k+1)=xhat(k)+1.15*(xhat(k)-xhat(k-1));
elseif (d(k-1) == 1 &d(k) ==-1)
xhat(k+1)=xhat(k)-0.5*(xhat(k)-xhat(k-1));
elseif (d(k-1) == -1 &d(k) ==-1)
xhat(k+1)=xhat(k)-1.15*(xhat(k)-xhat(k-1));
end
else
if (d(k-1) == -1 &d(k) ==1)
xhat(k+1)=xhat(k)-0.5*(xhat(k)-xhat(k-1));
elseif (d(k-1) == 1 &d(k) ==1)
xhat(k+1)=xhat(k)-1.15*(xhat(k)-xhat(k-1));
elseif (d(k-1) == -1 &d(k) == -1)
xhat(k+1)=xhat(k)+1.15*(xhat(k)-xhat(k-1));
end
end
end
hold on;
plot(a);
plot(xhat);

Figure :
Conclusion :

it's good experience with matlab output with delta


adaptive modulation ,key to future experience in
relevant course & work place.
relevant course & work place.

Last modified: 6:59 p.m.

You might also like