Ecm Exp4 Pulse Code Modulation
Ecm Exp4 Pulse Code Modulation
OBJECTIVES
1. To analyze the Pulse Code Modulation through sampling and quantizing.
2. To examine the effects associated with channel bandwidth reduction and noise.
LIST OF EQUIPMENT
MATLAB software
THEORY
Pulse Code Modulation (PCM) is a method of converting an analog signal into a digital signal (A/D conversion)
for digital transmission. PCM is a binary system where a pulse or lack of pulse within a prescribed time slot
represents either a logic 1 or a logic 0 condition.
1
CEEE/OCT 2023/ECM241/LABORATORY
The essential operations performed in the transmitter of a PCM system are sampling, quantizing, and
encoding. The quantizing and encoding operations are usually performed in the same circuit, which is analog-
to-digital (A/D) converter.
Sampling
Sampling is a process in which a continuous-time signal (analog signal) is sampled by measuring its amplitude
at discrete instants. Sampling converts a continuous-time signal to a discrete-time signal. Figure 4.2 shows an
example of sampling.
Most important factor in sampling is the rate at which analog signal is sampled. The sampling rate, fs is defined
as the number of samples obtained in one second. The restriction, stated in terms of the sampling rate, is known
as the Nyquist sampling theorem. From the Nyquist sampling theorem, it states that "For a sample to be
reproduced accurately at the receiver, the sampling rate, fs must be sampled at least twice of the highest audio
output signal, fm(max)".Consequently, the minimum sampling rate is equal to twice the highest audio input
frequency. If fs is less than two times fm(max), distortion will result. This distortion is called aliasing or
foldover distortion.
2
CEEE/OCT 2023/ECM241/LABORATORY
Quantization
Quantization is the process of representing the sampled values of the amplitude by a finite set of discrete levels.
Every discrete pattern from sampling shows the amplitude of the analog signal at that instance. The quantization
is done between the maximum amplitude value and the minimum amplitude value. Quantization is
approximation of the instantaneous analog value.The quantization level of a PCM system is expressed in the
following equation:
L 2n (4.2)
where, L is the quantization level, and n is the number of bits per sample.The quantizing operation is illustrated
in Figure 4.3 for the L = 8 levels case. The quantizer output is a quantized(i.e., only L possible amplitude
values) PAM signal. The PCM signal is obtained from the quantized PAM signal by encoding each quantized
sample value into a digital word. Since the analog sample values are approximated by using a finite number of
levels ( L = 8), error is introduced into the recovered output analog signal because of the quantizing effect. The
Quantization error(Qe) is also called quantization
noise(Qn) consists of the difference between the analog signal at the sampler input and the output of the
quantizer. Note that the peak value of the error (±1) is half of the quantizer step size.
Encoding
Encoding is a process where each quantized sample is digitally encoded into n-bits codeword. Usually the code
number is converted to its representation in binary sequence. The binary sequence is converted to a string of
sequential string of pulses (0’s and 1’s) for transmission. In this case, the system is referred to as binary PCM.
The essential features of binary PCM are shown in Figure 4.3. The analog
signal m(t) is confined to the range –4 V to 4 V. The step size is set to 1 V. Thus, eight quantizing
levels are employed; these are located at –3.5, –2.5,…, +3.5 V. We assign the code number 0 to the level of –3.5
V, the code number 1 to the level of –2.5 V, and so on until the level of +3.5 V, which is assigned the code
number 7. Each code number has its binary code representation, ranging from 000
for code number 0 to 111 for code number 7 (refer to Table 4.1). Each sample of m(t) the is assigned to
quantizing level closest to the sampled value.
3
CEEE/OCT 2023/ECM241/LABORATORY
Table: 4.1 : Summary of assigned Quantization level, Code Number and PCM
Code
0 → 0.99 +0 4 100
0 → -0.99 -0 3 011
4
CEEE/OCT 2023/ECM241/LABORATORY
∆𝑉
𝑄𝑄𝑒𝑚𝑎𝑥 = ±
2
The signal-to-noise ratio (SNR) is defined as the ratio of average signal power to average noise power. The
channel distorts the signal, and noise accumulates along the path. The SNR can degrade in two ways: (1)
through the decrease of the desired signal power, and (2) through the increase of noise power or the increase of
interfering signal power. The degradations of signals can be caused by loss such as attenuation and noise(or
interference).
5
CEEE/OCT 2023/ECM241/LABORATORY
PROCEDURES
a) Open Matlab Simulink. Go to File > New > Model. A blank window will be opened. Then save the
blank window with suitable name i.e PCM.
b) Develope the circuit as in Figure 4.4 by using Simulink library to search the blocks.
6
CEEE/OCT 2023/ECM241/LABORATORY
SIMULATION PARAMETER
By double clicking the function block, the dialog box will appear. Insert the parameters of each function block as
follows:
7
CEEE/OCT 2023/ECM241/LABORATORY
c) For "Scope 1" block, two input ports should be inserted as shwon in Figure 4.7 (a) and an appropriate
name of the signal should be given i.e. “input sine wave” for the first scope display. Then, insert the
minimum and maximum value for Y-limits. After that, click apply. Repeat the same steps for the second
active display (Title i.e. “sample pulse”).
(a) (b)
Figure 4.7 : (a) Insert number of ports (b) Signal labelling
f) Repeat the same step as in (c) for "Scope 2" by giving an appropriate name for every signal i.e.
"input sine wave", "sample pulse" and "quantized signal" for display 1,2 and 3 respectively.
(a) (b)
Figure 4.7 : (a) Insert number of ports (b) Signal labelling
DISCUSSION / QUESTIONS
1. Explain the function for each of the block used in PCM simulation as follows:
a) Sine Wave
b) Sample and Hold
c) Quantizer
2. Insert the value for input sine wave and quantized signal inTable 4.2
3. In the same table, insert the code number and PCM code by referring to Table 4.3.
4. Define Quantization error. Next, calculate the Quantization error (%) produced from the simulation and
insert in Table 4.3.
CONCLUSION
Summarize the main ideas that you have gained from the discussion section.
REFERENCES
1. Sklar, B. (2001). Digital communications: Fundamental and applications (2nd ed.). Upper Saddle
River, N. J.: Prentice Hall PTR.
2. Haykin, S. (2001).Communication systems (4th ed.). New York: John Wiley & Sons, Inc.
3. Lathi, B. P. (1998). Modern digital and analog communication systems (3rd ed.). New York: Oxford
University Press, Inc.
9
CEEE/OCT 2023/ECM241/LABORATORY
4. Hsu, H. P. (2003). Schaum’s outlines: Analog and digital communications (2nd ed.). Singapore: McG
5. S. Shetty, S. Varghese and K.Wagh, "Design and Implementation of Pulse Code Modulation using
MATLAB Simulink", International Journal of Advanced Research in Electronics and
Communication Engineering (IJARECE), Vol. 4, Nov 2015
10
CEEE/OCT 2023/ECM241/LABORATORY
RESULT
Scope 2 Wave
11
CEEE/OCT 2023/ECM241/LABORATORY
RESULT SHEET
EXPERIMENT 4: PULSE CODE MODULATION
(PCM)
Table: 4.2
Quantized Quantization
Sampling Input Sine Code number PCM Code
sample value error, Qe (%)
Pulse Wave (V)
(V)
Table: 4.3
12