You are on page 1of 8

Analog Communication Systems labratory

8*/5&3SEMESTER–∼

SubmittedBy
'JTFIB5BEEFTF
Reg. No.: 18BEC

# 5FDI. (BEC)–I*YeaS
NameoftheSchool: SENSE


VELLOREINSTITUTEOFTECHNOLOGY
VELLORE–632014
TAMILNADU
INDIA

Date:7–June–
Task 6
MATLAB CODE:
clc;
clear all;
close all;
di = linspace(-15,15,500);
y = sinc(di);
figure(1)
plot(di,y)
d=zeros(1,500);
for i = 1:500
if(rem(i,2)==0)
d(i)=1;
end
end
sampled = y.*d;
figure(2)

plot(sampled);
quan=zeros(1,250);
for i= 1:500
if(rem(i,2)==0)
quan(i/2)=round(sampled(i)*100);
end
end
figure(3)
stem(quan)
di=[];
di=linspace(0,0,length(quan+1));
di(1)=quan(1);
di(2:end)=quan(2:end)-quan(1:end-1);
figure(4)
stem(di)
enc = dec2bin(di+20);
disp = zeros(250*6,1);
k=1;
for i = 1:250
for j=1:6
if(enc(i,j)=='0')
disp(k)=0;
else
disp(k)=1;
end
k=k+1;
end
end
figure(5)
stem(disp)
dec = bin2dec(enc)-20;
figure(6)
stem(dec)
re=[];
re(1)=dec(1);
for k=2:length(dec)
re(k)=re(k-1)+dec(k);
end
figure(7)
stem(re)
for i=1:500
if(rem(i,2)==0)
deci(i)=re(i/2)/100;
end
end
figure(8)
plot(deci)
for i = 2:500
if(rem(i,2)==0)
fin_sig(i) = deci(i);
else
fin_sig(i) = (deci(i+1)+deci(i-1))/2;
end
end
figure(9)
plot(fin_sig)

OUTPUT
1)SIGNAL
2)SAMPLING

3)QUANTIZATION
4)DIFFERENCE

5)ENCODING
6)DECODING

7)RESAMPLING
8)DE-QUANTIZATION

9)FINAL SIGNAL

You might also like