Sie sind auf Seite 1von 6

Pulse Coded Modulation

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.

Apparatus Required: MATLAB Software.

Theory:

Pulse-code modulation (PCM) is a method used to digitally represent sampled


analog signals. It is the standard form of digital audio in computers, compact discs, digital
telephony and other digital audio applications. In a PCM stream, the amplitude of the
analog signal is sampled regularly at uniform intervals, and each sample is quantized to the
nearest value within a range of digital steps.
A signal is pulse code modulated to convert its analog information into a binary
sequence, i.e., 1s and 0s. The output of a PCM will resemble a binary sequence. The
following figure shows an example of PCM output with respect to instantaneous values of a
given sine wave.
The transmitter section of a Pulse Code Modulator circuit consists of Sampling,
Quantizing and Encoding, which are performed in the analog-to-digital converter section.
The low pass filter prior to sampling prevents aliasing of the message signal.
The basic operations in the receiver section are regeneration of impaired signals,
decoding, and reconstruction of the quantized pulse train. Following is the block diagram of
PCM which represents the basic elements of both the transmitter and the receiver sections.

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.

SQNR = (Average Signal Power)/ (Average Quantization Power)


= (m2/2) / (SS2/12)
= (3/2) * L2
= (3/2) * 82
= 96
= 19.82 dB

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.

Das könnte Ihnen auch gefallen