You are on page 1of 38

Faculty of Information Technology

Misurata University

CN 413: Telephony Switching and


VOIP
Pulse Code Modulation (PCM)
The tendency today is to change an analog signal to digital
data. The most common technique to change an analog
signal to digital data (digitization) is called pulse code
modulation (PCM).A PCM encoder has three processes:
1. The analog signal is sampled.

2. The sampled signal is quantized.

3. The quantized values are encoded as streams of bits.

Spring 2017 CN311: Communication Theory 2


Pulse Code Modulation
Components of PCM encoder

Spring 2017 CN311: Communication Theory 3


Pulse Code Modulation

Spring 2017 CN311: Communication Theory 4


Pulse Code Modulation: Sampling
The first step in PCM is sampling. The analog signal is
sampled every Ts, where Ts is the sample interval or
period. The inverse of the sampling interval is called the
sampling rate or sampling frequency.

Sampling rate : number of samples per second

fs = 1 / Ts

Spring 2017 CN311: Communication Theory 5


Pulse Code Modulation: Sampling
There are three sampling methods:

A. Ideal Sampling.

B. Natural Sampling

C. Top-Flat Sampling

Spring 2017 CN311: Communication Theory 6


Pulse Code Modulation: Sampling
The most common sampling method, called sample and hold,
however, creates flat-top samples by using a circuit.

The sampling process is sometimes referred to as pulse


amplitude modulation (PAM). We need to remember,
however, that the result is still an analog signal with non-
integral values.

Sampling Rate One important consideration is the sampling rate


or frequency. What are the restrictions on Ts?

Spring 2017 CN311: Communication Theory 7


Pulse Code Modulation: Sampling
The most important is that how can we reproduce the analog
signal after it is converted to digital.

According to the Nyquist theorem, the sampling rate must be


at least 2 times the highest frequency contained in the signal.

We need to elaborate on the theorem at this point.

First, we can sample a signal only if the signal is band-limited. In


other words, a signal with an infinite bandwidth cannot be
sampled.

Second, the sampling rate must be at least 2 times the highest


frequency, not the bandwidth.
Spring 2017 CN311: Communication Theory 8
Pulse Code Modulation: Sampling

Spring 2017 CN311: Communication Theory 9


Pulse Code Modulation: Sampling
 For an intuitive example of the Nyquist theorem, let us
sample a simple sine wave at three sampling rates: fs = 4f
(2 times the Nyquist rate), fs = 2f (Nyquist rate), and
fs = f (one-half the Nyquist rate). Figure 4.24 shows the
sampling and the subsequent recovery of the signal.

 It can be seen that sampling at the Nyquist rate can


create a good approximation of the original sine wave
(part a). Oversampling in part b can also create the
same approximation, but it is redundant and
unnecessary. Sampling below the Nyquist rate (part c)
does not produce a signal that looks like the original
sine wave.

Spring 2017 CN311: Communication Theory 10


Pulse Code Modulation: Sampling

Spring 2017 CN311: Communication Theory 11


Pulse Code Modulation: Sampling
Example
A complex low-pass signal has a bandwidth of 200 kHz. What is the minimum
sampling rate for this signal?
Solution
The bandwidth of a low-pass signal is between 0 and f, where f is the maximum
frequency in the signal. Therefore, we can sample this signal at 2 times the
highest frequency (200 kHz). The sampling rate is therefore 400,000 samples
per second.
Example
A complex bandpass signal has a bandwidth of 200 kHz. What is the minimum
sampling rate for this signal?
Solution
We cannot find the minimum sampling rate in this case because we do not
know where the bandwidth starts or ends. We do not know the maximum
frequency in the signal.

Spring 2017 CN311: Communication Theory 12


Pulse Code Modulation: Sampling
Example
Telephone companies digitize voice by assuming a maximum frequency
of 4000 Hz.What is the sampling rate?
Solution
The sampling rate therefore is 8000 samples per second.
Example
What sampling rate is needed for a signal with a bandwidth of 10,000
Hz (1000 to 11,000 Hz)?
Solution
The sampling rate must be twice the highest frequency in the signal:
Sampling rate = 2 x 11000 Hz = 22000 sample/sec

Spring 2017 CN311: Communication Theory 13


Pulse Code Modulation: Quantization
The result of sampling is a series of pulses with amplitude
values between the maximum and minimum amplitudes of
the signal.

Quantization:
is the second step in
analog-to-digital conversion.
Once an analog signal has been
sampled, each sample must be
represented in a fixed number
of bits.

Spring 2017 CN311: Communication Theory 14


Pulse Code Modulation: Quantization
So that :

Quantization is a method of assigning


integer values in a specific range to sampled
instances.

Spring 2017 CN311: Communication Theory 15


Pulse Code Modulation: Quantization
Quantization Levels

Mean how many levels we can divide the amplitude of the


signal and how many bits we can represent per each
level. The challenge question is this:

How do we know the proper number of bits to be


used in each sample?

Quantization Error is the difference between the actual


value of the analog signal, for the particular sampling
time, and the nearest quantization interval value.

Spring 2017 CN311: Communication Theory 16


Pulse Code Modulation: Quantization
 The quantization error depends on the number of
quantization levels L.

 As L increase quantization error decrease.

 In audio digitizing, L is normally chosen to be 256; in


video it is normally thousands.

 However, the quantization error is NOT really noise, it


changes the signal to noise ratio of the signal, which in
turn reduces the upper limit capacity according to
Shannon.

Spring 2017 CN311: Communication Theory 17


Pulse Code Modulation: Quantization
It can be proven that the contribution of the quantization
error to the SNRdB of the signal depends on the number
of quantization levels L, or the bits per sample nb‘ can be
simply expressed:

SNRdB =6.02nb + 1.76 dB

Spring 2017 CN311: Communication Theory 18


Pulse Code Modulation: Quantization

Spring 2017 CN311: Communication Theory 19


Pulse Code Modulation: Quantization
Example

What is the SNRdB in last example if we have a signal with


8 levels, 3 bits each?

Solution
SNRdB =6.02(3) + 1.76 = 19.82 dB

Increasing the number of levels increases the


SNR.

Spring 2017 CN311: Communication Theory 20


Pulse Code Modulation: Quantization
Example
A telephone subscriber line must have an SNRdB above
40 dB. What is the minimum number of bits per
sample?

Solution
We can calculate the number of bits as:
SNRdB = 6.02 (nb) + 1.76 = 40 dB
nb = 6.35 bits

Telephone companies usually assign 7 or 8 bits per sample.

Spring 2017 CN311: Communication Theory 21


Pulse Code Modulation: Binary Encoding
The last step in PCM is encoding. After each sample is
quantized and the number of bits per sample is decided,
each sample can be changed to a bit code word. For
example, a voice signal, each quantized samples is
translated into 7-bit binary equivalent. The eighth bit
indicates the sign ( - or + ).

Spring 2017 CN311: Communication Theory 22


Pulse Code Modulation: Line Encoding
The binary digits are then transformed to a digital signal
using one of the line encoding.

Spring 2017 CN311: Communication Theory 23


Pulse Code Modulation (PCM)
Example
A signal is sampled. Each sample requires at least 12 levels
of precision (+0 to +5 and -0 to -5). How many bits
should be sent for each sample?

Solution
We need 4 bits; 1 bit for the sign and 3 bits for the value.
A 3-bit value can represent 2^3= 8 levels (000 to 111),
which is more than what we need. A 2-bit value is not
enough since 2^2= 4. A 4-bit value is too much because
2^4= 16.

Spring 2017 CN311: Communication Theory 24


Pulse Code Modulation (PCM)
Example
We want to digitize the human voice. What is the bit rate,
assuming 8 bits per sample?

Solution
The human voice normally contains frequencies from 0 to
4000 Hz.
Sampling rate = 4000 x 2 = 8000 samples/s
Bit rate = sampling rate x number of bits per sample
= 8000 x 8 = 64,000 bps = 64 Kbps.
Spring 2017 CN311: Communication Theory 25
Components of a (PCM) decoder

Spring 2017 CN311: Communication Theory 26


TRANSMISSION MODES
The transmission of binary data across a link can be
accomplished in either parallel or serial mode. In
parallel mode, multiple bits are sent with each clock tick.
In serial mode, 1 bit is sent with each clock tick. While
there is only one way to send parallel data, there are
three subclasses of serial transmission:

asynchronous, synchronous, and isochronous.

Spring 2017 CN311: Communication Theory 27


TRANSMISSION MODES
Data transmission and modes

Spring 2017 CN311: Communication Theory 28


TRANSMISSION MODES
Parallel transmission
It means that we can send data n bits at a time instead of
1bit. The mechanism for parallel transmission is very
simple by using n wires to send n bits at one time. That
way each bit has its own wire, and all n bits of one
group can be transmitted with each clock tick from one
device to another. The next slide`s figure shows how
parallel transmission works for n =8. Typically, the eight
wires are bundled in a cable with a connector at each
end.

Spring 2017 CN311: Communication Theory 29


TRANSMISSION MODES: Parallel transmission

The advantage of parallel transmission is speed, where it can


increase the transfer speed by a factor of n over serial
transmission.

The disadvantage of parallel transmission is significant cost as it


requires n communication lines. Because this is expensive, parallel
transmission is usually limited to short distances.
Spring 2017 CN311: Communication Theory 30
TRANSMISSION MODES
Serial Transmission
In serial transmission one bit follows another, so we need
only one communication channel rather than n to
transmit data between two communicating devices.

Spring 2017 CN311: Communication Theory 31


TRANSMISSION MODES: Serial Transmission
The advantage of serial over parallel transmission is
that with only one communication channel, serial
transmission reduces the cost of transmission over
parallel by roughly a factor of n.

Since communication within devices is parallel, conversion


devices are required at the interface between the
sender and the line (parallel-to-serial) and between the
line and the receiver (serial-to-parallel).

Serial transmission occurs in one of three ways:


asynchronous, synchronous, and isochronous.
Spring 2017 CN311: Communication Theory 32
Asynchronous Transmission
Without synchronization, the receiver cannot use timing to
predict when the next data (group of bits or bytes) will
arrive. To alert the receiver to the arrival of next group of
data, therefore, an extra bit is added to the beginning of each
byte. To let the receiver know that the byte is finished, 1 or
more additional bits are appended to the end of the byte.

In asynchronous transmission, we send 1 start


bit (0) at the beginning and 1 or more
stop bits (1s) at the end of each byte. There
may be a gap between each byte.
Spring 2017 CN311: Communication Theory 33
Asynchronous Transmission
The mechanism of adding start, stop bits and gaps
between group of bytes is called asynchronous at the byte
level, the sender and receiver do not have to be
synchronized. But within each byte, the receiver must still
be synchronized with the incoming bit stream.

Asynchronous here means "asynchronous at


the byte level;
but the bits are still must be synchronized;
their durations are the same.
Spring 2017 CN311: Communication Theory 34
Asynchronous Transmission

Advantages of asynchronous Transmission gives a synchronization for


situations such as low-speed communication such as keyboard to a
computer.

Disadvantages of asynchronous Transmission is slow transmission in


comparison with other types of transmission, because of additional
bits and the insertion of gaps into the bit stream.

Spring 2017 CN311: Communication Theory 35


Synchronous Transmission
In synchronous transmission, the bit stream is combined into longer
"frames," which may contain multiple bytes. Each byte, however, is
introduced onto the transmission link without a gap between it and
the next one.

In synchronous transmission, we send bits one after


another without start or stop
bits or gaps. It is the responsibility of the receiver to
group the bits.
If the sender wishes to send data in separate bursts, the gaps between
bursts must be filled with a special sequence of Os and Is that
means idle. The receiver counts the bits as they arrive and groups
them in 8-bit units.
Spring 2017 CN311: Communication Theory 36
Synchronous Transmission

Advantages of synchronous transmission is speed where


synchronous transmission is faster than asynchronous
transmission. Byte synchronization is accomplished in the
data link layer.

Spring 2017 CN311: Communication Theory 37


Isochronous Transmission
In real-time audio and video, in which uneven delays between
frames are not acceptable, synchronous transmission fails.
For example, TV images are broadcast at the rate of 30
images per second; they must be viewed at the same rate. If
each image is sent by using one or more frames, there should
be no delays between frames. For this type of application,
synchronization between characters is not enough; the entire
stream of bits must be synchronized.

The isochronous transmission guarantees that the


data arrive at a fixed rate.
Spring 2017 CN311: Communication Theory 38

You might also like