DCS PRACTICAL
AIM: Implementation of delta modulation using MATLAB
MATLAB CODE:
a=2;
t=0:0.1:10;
x=a*sin(t);
l=length(x);
subplot(2,1,1);
plot(x);
title('message signal');
delta=0.2;
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
subplot(2,1,2);
stairs(xn);
title('delta modulated wave');
No comments:
Post a Comment