Beruflich Dokumente
Kultur Dokumente
Aim: To employ pulse coded modulation technique on a message signal in 3 steps namely
sampling, quantization and encoding. Also, perform demodulation by decoding the
encoded signal in order to get back the message signal.
Theory:
ADVANTAGES:
The PCM (pulse code modulation) convenient for long distance communication.
It has a higher transmitter efficiency.
It has a higher noise immunity.
DISADVANTAGES:
The PCM (pulse code modulation) requires large bandwidth as compared to analog
system.
Encoding, decoding and quantizing circuit of PCM is very complex.
APPLICATIONS:
The PCM is used in the satellite transmission system.
It is used in space communication.
It is used in telephones.
MATLAB Code:
am=5;
fm=100;
fs=100000;
t=0:1/fs:1/fm;
n=3;
M=8;
SS=(am-(-am))/(M-1);
v=-am:SS:am;
m=(am)*(sin(2*pi.*fm.*t));
d=SS/2;
for j=1:length(t)
for i=-am:SS:am
if((m(j)<i+1 && m(j)>i-1))
y(j)=i; Quantization
end
end
end
k=1;
for j=1:length(t)
if y(j)==-am
s(k)=0;
s(k+1)=0;
s(k+2)=0;
k=k+3;
end
if y(j)==-am+1*SS
s(k)=0;
s(k+1)=0;
s(k+2)=1;
k=k+3;
end
if y(j)==-am+2*SS
s(k)=0;
s(k+1)=1;
s(k+2)=0;
k=k+3; Encoding
end
if y(j)==-am+3*SS
s(k)=0;
s(k+1)=1;
s(k+2)=1;
k=k+3;
end
if y(j)==-am+4*SS
s(k)=1;
s(k+1)=0;
s(k+2)=0;
k=k+3;
end
if y(j)==-am+5*SS
s(k)=1;
s(k+1)=0;
s(k+2)=1;
k=k+3;
end
if y(j)==-am+6*SS
s(k)=1;
s(k+1)=1;
s(k+2)=0;
k=k+3;
end
if y(j)==-am+7*SS
s(k)=1;
s(k+1)=1;
s(k+2)=1;
k=k+3;
end
end
l=1;
for j=1:length(t)-1
q=((s(l)*100) + (s(l+1)*10) + (s(l+2)*1));
l=l+3;
if q==000
b(j)=-am;
end
if q==001
b(j)=-am+1*SS;
end
if q==010
b(j)=-am+2*SS;
end
if q==011
b(j)=-am+3*SS;
end
if q==100 Decoding
b(j)=-am+4*SS;
end
if q==101
b(j)=-am+5*SS;
end
if q==110
b(j)=-am+6*SS;
end
if q==111
b(j)=-am+7*SS;
end
end
subplot(3,2,1)
plot(t,m);
title('Message Signal EDM(30,32)');
xlabel('t');
ylabel('m(t)');
subplot(3,2,2)
plot(t,m);
title('Sampled Signal EDM(30,32)')
xlabel('t')
ylabel('m_s(t)')
hold on
stem(t,m,'-','b');
hold off
subplot(3,2,3)
plot(y)
title('Quantized Signal')
xlabel('t')
ylabel('m_q(t)')
hold on
plot(m)
hold off
subplot(3,2,4)
stem(s)
title('Encoded Signal')
xlabel('t')
ylabel('enc(t)')
subplot(3,2,5)
plot(b)
title('Decoded Signal')
xlabel('t')
ylabel('A')
hold on
plot(m)
hold off
wc=(2*pi*185)/fs;
a=1;
n=-50:50;
f=(wc).*(sinc(wc*n));
md = filter(f,a,b); Demodulation
subplot(3,2,6)
plot(md,'g')
title('Demodulated Signal')
xlabel('t')
ylabel('A')
hold on
plot(m)
hold off
Inference:
The quantized signal which has 7 levels (i.e., split into 8 intervals) is encoded by
assigning 3 bits to each level. The quantized output can be improvised by using a greater
number of levels as SQNR increases by doing so. But the cost paid is the increase in the
bandwidth of PCM wave.
The decoded signal, when passed through the filter gets demodulated and results in
the input signal. The more the number of coefficients used in the filter design, the sharper
the output is. The phase shift is visible in the graph which is due to the quantization error
involved in the process.
Result:
The pulse coded modulation technique has been employed on the message signal
through the 3 aforementioned steps and also decoded to get back the message signal suing
MATLAB. Also, the effect of number of quantization levels on the bandwidth and SQNR of
the PCM wave is analysed.