Sei sulla pagina 1di 188

DATA

COMMUNICATIONS

Dr. AShraf Afifi


Dr. Fahd Ar-Radday Prof. Mostafa Nofal
DATA
COMMUNICATIONS
Dr.Fahd
Dr. FahdAr-Radday
Al-Raddady

Prof.Mostafa
Prof. Mostafa Nofal
Nofal

Dr.
Dr. Ashraf
AShraf Afifi
Afifi

Dr.
Dr. Amira
Amira Ashour
Ashour
Course Specifications
College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Course Title: Data Communications

Course Code: 503431-3

Prerequisite: Intr. to Probability and Statistics

Course Description
1- Meaning/need of data communications
2- Overview of data communication system
3- Digital transmission of analog data
4- Transmission of digital data
5- Common transmission Media
6- Error control of data transmission
7- Cellular Mobile Radio

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Course Title: Data Communications

Course Code: 503431-3

Prerequisite: Intr. to Probability and Statistics

Credit Hours: 3 Hrs.

Lectures: 42 Hrs.

Depts.: CE and CS.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

 M. Nofal; Data Communications, to be published.

Textbook

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

 B. Fourozan; Data Communications and


Networking, The McGraw-Hill Companies, Inc.,
2004.

 W. Stallings; Data and Computer Communications,


Prentice-Hall, 2001.

References

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

 K. S. Shanmugam; Digital and Analog


Communication Systems, John Wiley, 1979.

 R. P. Singh and S. D. Spare; Communication


Systems: Analog and Digital; Tata McGraw-Hill
Education Private Ltd., 2010.
Bibliography
 S. Sharma; Communication Systems (Analog and
Digital); S.K. Kataria & Sons, 2008.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

General objective
 The course is deigned to provide the students with
the fundamental concepts and techniques of data
communications.

Objectives
Course
CO1: 1- Introduce essential components of an end-to-end
Objectives
data communication system

CO2: Present analog and digital coding and transmission


of data.

CO3: Develop techniques for error control during data


transmission.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

On completion of this course, the student will has:


CLO1: Ability to analyze and design data communication
system.

CLO2: Ability to develop techniques for transmission and


reception of analog and digital data.
Learning
CLO3: Ability to compare between various transmission
Outcomes
media.

CLO4: Ability to deal with errors encountered during data


transmission.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lecture Schedule
 One 60-minute session + one 120-minute per week.

Course Exams
 There will be two exams in the course.

Course 1- Mid-term exam about week 8.

assessment  Mid-Term Exam: 30%

2- Final exam by end of term.

 Final Exam: 40%.

 During term period: Assignment: 30%

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

1- Introduction
 Meaning of data communications
 History of Data Communications
 Types of data
 Importance of Data Communications

2- Overview of Data Communications


Course  Model of a Communication System
Topics  Classification of Communication Systems
 Digital Communication System
 Line Configuration
 Direction of Data Flow
 Modes of Transmission
 Signal Characteristics

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

3- Digital Transmission of Analog Data


 Sampling Theory
 Pulse Modulation Techniques
 Wave Coding of Analog Signals
 Pulse Code Modulation
 Delta Modulation
 Data Compression
Course
Topics 4- Transmission of Digital Data
 Analog Transmission of Digital Data
 Digital Transmission of Digital Data

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

5- Transmission Media
 Categories of transmission media
 Twisted pair cable
 Coaxial cable
 Optical fiber cable
 Wireless transmission media
 Transmission impairments
Course  Channel capacity
Topics  Multiplexing Techniques

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

6- Error Control of Data Transmission


 Channel Encoder/Decoder
 Methods of Controlling Errors
 Types of Errors
 Error Detection Codes
 Automatic Repeat Request (ARQ) Schemes
 Error Correcting Codes
Course
Topics

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

INTRODUCTION
 Meaning of data communications
 History of Data Communications
 Types of data
 Importance of Data Communications
Chapter 1
CLO1

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Objectives of Chapter 1
By the end of this chapter, the student will be able to:
 Understand the meaning of data communications.
 Trace the history of data communication industry.
 Identify the main types of data and visualize the
techniques of data digitization.
 Appreciate the importance of data communications.

Chapter 1

CLO1

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Meaning of Data Communications

What is Data?
 Data refers to the raw facts, concepts and instructions that
are collected.
 Information refers to processed data that enables us to take
decisions.
 In general, data refers to symbolic representations that
convey meaning in agreed and accepted upon rules between
the two partners.
 In computer systems, data are usually represented in binary
form of 1s and 0s.
Prof. Mostafa Nofal
College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Meaning of Data Communications

What is Communication?
 Communication refers to the process of imparting,
conveying or exchanging of information via a specific
transmission medium.
 Telecommunication implies the exchange of diverse types of
information over a long distance.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Meaning of Data Communications

What is Data Communications?


 Data communications is the process of communicating
information in binary form between two points.
 It is sometimes called digital communications as the word
digit comes from the Latin word for finger.
 It is also called computer communications because most of
the information interchanged is between computers.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Meaning of Data Communications

What is Data Communications System?


 Electronic equipments which are used for communications
are called communication equipments.
 These equipments when assembled together form a data
communication system consisting of hardware and software.
 The hardware involves sending and receiving devices and
intermediate stuff through which the data passes.
 The software refers to the protocol that specifies the rules
governing the communication process.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

History of Data Communications

1- Early Visual Data Communication Systems

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

History of Data Communications

2- Early Electrical Communication Systems


 In 1758, Scottish inventor proposed an electrostatic
telegraph system in which 26 wires from town to town.
 A Swiss inventor built a prototype system, but the
technology of wire making eliminated that idea.
 In 1833, Gauss used a code based on 5×5 matrix to send
messages by deflecting a needle.
 The first set of deflections indicated the row; the second the
column.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

History of Data Communications

3- Early Telegraph
 Morse developed the telegraph in 1832, but
demonstrated its use in 1844.
S. Morse
Station A Station B

Key

Sounder
+ Telegraph line
-

Transmitter Morse code Receiver


A:  ―
B: ―   

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

History of Data Communications

4- Telephone and Radio


 A. G. Bell invented telephone in 1875.
 He patented his invention in 1876.
A. G. Bell
I=V/R

V
I
R
Carbon Sound
microphone

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

History of Data Communications

4- Telephone and Radio


 Hertz worked out the principles of radio
transmission from 1885 to 1889.
 Marconi from 1896 to 1897 made the first practical N. R. Hertz

radio transmission system.


 By 1930's large networks of telephones, telegraphs,
and radios were in existence.

G. Marconi

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

History of Data Communications


5- Computers and Modern Data Communications
 First large-scale automatic digital computer, Mark I,
developed between 1939 and 1944.
 In 1946, the first electronic computer, ENIAC, was made.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

History of Data Communications

5- Computers and Modern Data Communications


 In 1960s, data communication across telephone lines
became more commonplace.
 The first Internet was ARPANET, funded in 1969 by
Department of Defense.
 Online real-time systems were developed in 1970s.
 In 1980s, there was a widespread adoption of PC and
Internet was born.
 In 1990, web appeared and data communication systems
span the entire world.
Prof. Mostafa Nofal
College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Types and Digitization

Types of data

Text Number Image audio Video

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Types and Digitization

1- Text
 A text is a sequence of symbols used to represent an idea in
a specific language.
 To deal with electronically, each symbol should be
represented with a unique bit pattern of 1s and 0s.
 International codes have been designed to represent text.
 These include: ASCII, Extended ASCII, EBCDIC, Unicode,
and ISO codes

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Types and Digitization

ASCII Code

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Types and Digitization

EBCDIC code

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Types and Digitization

2- Numbers
 Numbers are represented using the binary system.
 The number is not represented by ASCII code but directly
converted to a binary number.
 This is to simplify mathematical operations on numbers.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Types and Digitization

3- Images
 We cannot transmit an image in its original form.
 We need encoded description in terms of 1s and 0s.
 Images can be represented by one of two methods: bitmap
graphic or vector graphic.
00111000

00100000

00111000

00100000

00100000

image Matrix
representation

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Types and Digitization

3- Audio
 Audio refers sound or music. It is continuous, not discrete.
 We use a microphone to change voice from an acoustic to a
continuous electric signal.
 To get digital format, sequence of operations is carried out:
1- Sampling
2- Quantization.
3- Encoding to binary patterns.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Types and Digitization


5- Video
 Video is a representation of images (called frames) in times.
 The frames are shown one after another to create the
illusion of motion.
 Each frame is changed to a set of bit patters and stored.
 The combination of images
represents the video.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Importance of Data Communications


Why do we study Data Communications?
 It has significance in our today's world.
 The key technology of the information age is
communications.
 Data communication is commonly used in business,
education, medicine, industry, military and homes as well.
 Data communication is becoming an integral part of our
daily activities.
 It would be impossible to conduct activities without the use
of data communication.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

OVERVIEW OF DATA
COMMUNICATIONS
 Model of a Communication System
 Classification of Communication Systems
 Digital Communication System
 Line Configuration

Chapter 2  Direction of Data Flow


 Modes of Transmission
 Signal Characteristics
CLO1 + CLO2

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Objectives of Chapter 2
By the end of this chapter, the student will be able to:
 Get insight into the operational processes of data
communications.
 Specify the main functional elements of a data
communication system.
 Understand the modes of data transmission as well
as direction of data flow.
Chapter 2  Understand the salient characteristics of the
electrical signals as a means of conveying data.

CLO1 + CLO2

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Model of a Communication System

Information source
and input Transmitter
transducer

Electrical Electrical
waveform commun.
channel

Output transducer Receiver


Commun.
System

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Model of a Communication System


1- The information Source
 The message produced by the information source may not
be electrical in nature such as voice.
 An input transducer converts the message to a time-varying
electrical quantity called a message signal.
 At the destination, output transducer converts the electrical
waveform to the appropriate message.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Model of a Communication System


2- The Transmitter
 Data generated by a source can not transmitted directly.
 A transmitter transforms information to EM signals that can
be transmitted across the transmission system.
 It processes and modifies the input for efficient
transmission over a channel.
 Signal processing operations performed by the transmitter
include amplification, filtering, and modulation.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Model of a Communication System


3- The Communication Channel
 The channel provides the electrical connection between the
distant source and destination user.
 The channel may be wired or wireless.
 During transmission, the signal gets distorted due to noise.
 Noise is always random in character and has a great effect
on the signal.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Model of a Communication System


4- The Receiver
 The receiver extracts the input signal from the degraded
version coming from the channel.
 The receiver performs this function through the process of
demodulation in addition to amplification and filtering.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Classification of Communication Systems

Communications Systems

Analog Digital
communications communications
systems systems

 It is designed to transmit analog  It is designed to transmit digital data


data using analog modulation. using digital or analog modulation.
 The AM, FM and TV transmissions  The data may be binary or binary
are examples. coded of analog data.
 May be wired or wireless.  It is termed as data commun system.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Criteria for Communications Systems


1. Data delivery
 The data should be delivered to the correct destination to
assure confidentiality and privacy.
2. Data integrity
 Data should be delivered accurately without no errors, no
loss, no addition and no duplication.
3. Timeliness of data transfer
 Data should be delivered without violating the delay
constraints specific for each service.
 Uneven jitter in packet arrival may be annoying to the user.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Why Digital?
1- Use of modern digital technology
 Advent of VLSI technology reduces cost, size and reliability
of digital transmission circuitry.
2- Data integrity
 Due to repeaters, signal impairments does not affect digital
transmission as analog.
3- Ease of multiplexing and robust transmission
 Efficient utilization of link capacity can be achieved with
digital rather than analog techniques.
 Digital system has can operate at relatively low SNR.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Why Digital?
4- Security and privacy
 Encryption can be readily applied to digital signals.
5- Integration of diverse services
 By treating all signals digitally, transmission system does
not have to provide special attention to individual services.
 Traffic of different types can be intermixed in a single
transmission medium without mutual interference.
6- Performance monitorability
 Quality of digital received signal can be ascertained with no
knowledge of the nature of the traffic.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Elements of digital communication system

information Source Channel


encoder Modulator
source encoder

Analog
signal

Sequence Binary bit Electrical


Binary bit Noise
of symbols stream communication
stream
channel

Analog
signal

Source Channel
Destination decoder decoder Demodulator

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Elements of digital communication system


1- Information source
information
 Based on its output, it may be analog or digital. source

i- Analog information source


 Like a microphone actuated by speech or a TV camera.
 It emits continuously varying amplitude signals.
 It can be transformed into digital format.
ii- Discrete information source
 Its output consists of a sequence of binary bits.
 A familiar example of discreet data is text or character
strings.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Elements of digital communication system


2- Source encoder/decoder Source
encoder
 Its input is a string of symbols at a rate rs symbols/sec.
 It converts input to a binary sequence of 0‟s and 1‟s.
 The source decoder converts this back to a symbol sequence.
3- Channel encoder/decoder
 Channel encoder adds extra bits to output of the source
encoder to detect or correct errors at the channel decoder.
 Channel encoder/decoder can realize high transmission
reliability and efficiency. Channel
encoder

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Elements of digital communication system


3- Modulator/demodulator
Modulator
 Modulator accepts a bit stream and converts it to an
electrical waveform suitable for transmission over channel.
 Demodulator extracts the message from the information-
bearing waveform.
 The modulation process serves several purposes in
communication systems.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Elements of digital communication system


Why modulation?
1- Overcoming some equipment limitations
 It may be difficult to design a system at a specific frequency.
 With modulation we translate to a practicable band.
 When wireless transmission is applied, we need antenna.
 Antenna dimension should be comparable to operating λ.
 If f= 5 KHz, λ/4=5 km; impracticable to construct.
 Migrating to 5 MHz allows an antenna of 5 m to be used.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Elements of digital communication system


Why modulation?
2- Removing interference
 Most signals occupy the same frequency range.
 For transmission without modulation interference will occur.
3- Reducing noise
 The limitation of communication is the unavoidable noise.
 Modulation schemes could minimize the effect of noise.
4- Allowing efficient capacity utilization
 With modulation, multiplexing results in efficient and cost-
effective utilization of the communication link.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Elements of digital communication system


Why modulation?
5- Matching signal to channel
 Modulation allows matching the signal characteristics to the
channel characteristics.
 Consider for example electrical signal to be transmitted over
an optical fiber or wireless medium.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Line configuration
 It refers to the way through which two or more
communicating devices attach to the transmission line.
Categories of line configuration

Point-to-point Multipoint

 It provides a dedicated link between


two devices.
 Entire link capacity is reserved for
transmission between two devices. link

 Infrared remote control is a p-t-p


connection. Workstation Workstation

 It utilized in star and ring topology of


computer networks.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Line configuration
 It refers to the way through which two or more
communicating devices attach to the transmission line.
Categories of line configuration

Point-to-point Multipoint

Workstation Workstation
 More than two specific devices share
a single link.
link  The capacity of the channel is shared
between multiple devices.
 This type of connection is employed in

Server
the bus network topology.
Workstation  It is also called multidrop.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Direction of Data Flow


 Two linked devices can communicate with each other by
sending and receiving data.
Direction of data flow

Simplex Half-duplex Full-duplex

 The transmission is unidirectional.


 Only one station can transmit; the
other can only receive. Transmission is in one direction only
 There is no ACK of reception, so errors
cannot be conveyed to transmitter.
 The paging systems, TV, and FM radio
are examples of this mode.
 Also, Keyboards and monitors.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Direction of Data Flow


 Two linked devices can communicate with each other by
sending and receiving data.
Direction of data flow

Simplex Half-duplex Full-duplex

 Each station can both transmit and


receive, but not at the same time.
 When one station is sending, the
Transmission of data at time t1
other can only receive and vice versa.
 Entire capacity is taken over by
Workstation Transmission of data at time t2 Workstation transmitting station at the time.
 The “Push-to-talk” walkie-talkies is
half-duplex systems.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Direction of Data Flow


 Two linked devices can communicate with each other by
sending and receiving data.
Direction of data flow

Simplex Half-duplex Full-duplex

 Both stations can transmit and receive


simultaneously.
Transmission of data all the time  Signals going in either direction share
the capacity of the link.
 One example is telephone network.
Workstation Workstation  Two people can talk and listen at the
same time.
 Also, videoconferencing.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
 The transmission of binary data across a link can be
accomplished in either parallel or serial mode.

Transmission modes

Parallel Serial

Synchronous Asynchronous

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
Parallel transmission
 Multiple bits are sent with each clock tick.
 Data are organized into groups of n bits transmitted through
n wires.

Sender Receiver

8 bits are sent together

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
Advantages of Parallel transmission
 It is characterized by high speed of data transmission.
 It can increase the transfer speed by a factor of n over serial
transmission.
Disadvantages of Parallel transmission
 High cost as it requires n lines just to transmit data stream.
 It is practical only for short distances.
 Consequently, parallel transmission is usually limited to
shorter distances.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
Serial transmission
 One bit follows another so it needs only one channel.
 As communication within devices is parallel, conversion
devices are required at the interface.
 It is designated as synchronous or asynchronous depending
on how the timing and framing information is transmitted.

0 0
8 bits are sent one after another
1 1
1 0 1 1 0 1 1 0 0 1
0 0
Sender 1 1 Receiver
1 1
0 0
serial/Parallel
0 Parallel/serial 0
converter
converter

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
Advantages of Serial transmission
 Only one channel is required; consequently cost is reduced.
 It has few errors, and is practical for long distances.
Disadvantages of Serial transmission
 It is slow.
 There is a need for serial to parallel conversions.
 Consequently, serial transmission is usually practical for
long distances.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
Asynchronous Serial Transmission
 Timing of a signal is unimportant.
 Bits are grouped into bytes.
 Each bit is sent independently along the link as a unit.
 To alert the receiver to the arrival of a new group, a start bit
is added at byte beginning of each byte.
 To alert the receiver know that the byte is finished, a stop
bit is appended to the end of the byte.
 Each byte is thus increased to 10 bits.
 The transmission of each byte is followed by a gap.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
Asynchronous Serial Transmission
 Synchronization is required only for duration of a single
byte
Stop bit Start bit

0 1 1 0 1 1 0 0 0 1 0 1 1 0 1 1 0 0 0 1 0 1 1 0 1 1 0 0
Sender Receiver

Gap between Gap between


data units data units

Direction of data flow

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
Advantages of Asynchronous transmission
 It is cheap and cost-effective.
 This makes it an attractive choice for situations like low
speed communications.
Disadvantages of Asynchronous transmission
 It provides slower data rate due to the addition of stop and
start bits as well as the insertion of gaps into the bit stream.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
Synchronous Serial Transmission
 The bit stream is combined into longer frames that may
contain multiple bytes.
 Bits are sent one after another without start/stop bits or
gaps.
 Receiver will group the bits into bytes or characters to
reconstruct the information by counting the arrived bits.

0 1 1 0 1 0 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 0 0
Sender Receiver

Direction of data flow

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Transmission Modes
Synchronous Serial Transmission
 There are synchronization characters that are transmitted at
beginning of every data block to achieve synchronization.
 Such systems are more expensive and complex but
extremely efficient.
Advantages of synchronous transmission
 It provides higher speed than asynchronous transmission
and therefore, it is more useful for high-speed applications.
Disadvantages of synchronous transmission
 The timing becomes very important.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Need for Signals
 Data are entities that convey meaning while signals are
electric or electromagnetic representations of these data.
 Signal is represented as a function of time.
 The frequency domain representation of the signal leads to
the concepts of spectrum and bandwidth.
 Its spectrum is the range of frequencies that it contains.
 The bandwidth of a signal is the width of the spectrum.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Analog and Digital Concepts
 Data can take either analog or digital form.
 Analog refers to something that is continuous.
 Digital refers to something that is discrete.
 Like data, signals can be either analog or digital.
Value Value

time time

a- Analog signal b- Digital signal

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Periodic and Aperiodic Signals
 Analog and digital signals can be periodic and aperiodic.
 A periodic signal completes a pattern within a period.
 It repeats that pattern over identical subsequent periods.
x(t  T )  x(t ),  t  
 The completion of one pattern is called a cycle.
 A period is amount of time required to complete one cycle.
Value Value

time time

T T T T

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Periodic and Aperiodic Signals
 An aperiodic, or non-periodic, signal changes constantly
without exhibiting a pattern or cycle that repeats over time.
 Any aperiodic signal can be decomposed into an infinite
number of periodic signals.

Value Value

time time

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Deterministic and random Signals
 Deterministic signal has a regular pattern.
 It can be modeled by an explicit mathematical expression.
 Example: x(t)=10 sin 30t.
 The pattern of a random signal is quite irregular.
 Example is noise.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Simple Analog Signals
 Analog signals can be classified as simple or composite.
 A simple analog signal, or a sine wave, cannot be
decomposed into simpler signals.
 A composite signal is composed of multiple sine waves.
 A sine wave is denned by its amplitude, frequency, and
phase.
 The amplitude of a signal is the value of the signal at any
time.
 The period T is the time needed to complete one cycle.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Simple Analog Signals
 The frequency f is the number of periods in one second.
 The wavelength λ is the distance traveled in one period.
c
  c T
f
Amplitude
One second
Maximum Three periods in one second: f = 3 Hz.
amplitude

time

Minimum
amplitude
Period =1/3 sec T
One cycle

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Simple Analog Signals
 The phase describes the position of the waveform relative
to time zero.

Amplitude Amplitude Amplitude


Amplitude

time time time


time

a- 0 degree a- 90 degree a- 180 degree a- 270 degree

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Time and frequency domains
 A signal is denned by its amplitude, frequency, and phase.
 Time-domain shows changes in signal amplitude with time.
 Frequency-domain plot shows the relationship between
amplitude and frequency.

Amplitude One second Amplitude


Frequency = 6 Hz 12
12
time Frequency
6
b- Frequency domain
a- Time domain

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Composite Signal
 Many waveforms do not change in a single smooth curve.
 For a signal to communicate data, it is usually a composite
signal.
 However, as long as any irregularities are consistent, cycle
after cycle, a signal is still periodic.
 Any periodic signal can be decomposed into a collection of
sine waves.
 This is the result of the work done by Fourier.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Composite Signal
 Time-domain illustrates a composite signal as a single entity.
 Frequency-domain shows it as a series of component
frequencies. Amplitude
Amplitude

1 second
7 7

Amplitude Amplitude time Frequency


0 6
1 second
17 10
7 Amplitude
time Frequency Amplitude
0 6
10
1 second
10

time Frequency
0

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Frequency Spectrum and Bandwidth
 The frequency spectrum of a signal is the collection of all
the frequency components it contains.
 The bandwidth of a signal is the width of the frequency
spectrum.
Amplitude

Frequency
1000 5000

Bandwidth=5000-1000=4000 Hz

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Digital Signals
 Data can be represented by a digital signal.
 Most digital signals are aperiodic.
 The period or frequency is not appropriate to be used.
 Two new terms, bit interval (instead of period) and bit rate
(instead of frequency) are used to describe digital signals.
Amplitude 1 sec = 6 bit interval
Bit rate = 6 bps
1 0 1 1 0 1

time

Bit interval

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Digital Signals
 Bit interval To is the time required to send one single bit.
 Bit rate rs is the number of bit intervals per second.
1
rs  bps
T0
 For a digital signal with a bit rate of 5000 bps, the bit
interval is 1/5000 bps, or 200 sec.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Digital Signals
 A digital signal can be decomposed into an infinite number
of simple sine waves called harmonics.
 This means that when we send a digital signal, we are
sending an infinite number of simple signals.
 No practical medium is capable of transferring the entire
range of frequencies, we always have corruption.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Digital Signals
Amplitude Amplitude

time time

a- Only first harmonic.


b- First, third and fifth harmonics.

Amplitude Amplitude

time time

c- First, third, fifth and seven harmonics. d- Infinite number of harmonics.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Digital Signals
 Digital signal contains an infinite number of frequencies.
 We can recreate it if we send only significant components.
 This is the significant spectrum, and its bandwidth the
significant or effective bandwidth.

Amplitude Amplitude

Frequency Frequency
0 Infinity
Infinite bandwidth x Significant bandwidth y

a: Spectrum for exact replica. b: Significant spectrum.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Some Important Signals
 Sine wave
 Unit impulse.
 Unit step.
 Sampling function.
 Gate function.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Sine Wave
 It is the most fundamental in electrical communications.
 The sin analysis of networks is simple and convenient.
 The response of a sine wave to a linear time invariant
system is also sinusoidal.
 It changes in a smooth curve between a minimum and a
maximum amplitude.
 It is represented mathematically as

x(t )  A sin(2ft )

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Unit Impulse Function
 It is also called Dirac delta function, (t).
 It has an infinite amplitude with zero width and unity
weight. 

  (t )dt  1

(t)

1
 (t )  0 for t  0

0  x(t ) (t  t

o )dt  x(t o )

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Unit Step Function
 It exists only in positive side and is zero in negative side.
 It is discontinuous at t=0.
 It may be expressed as
0 for t  0
u (t )  
1 for t  0
u(t)

t
0

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Sampling Function
 It is called interpolation function or the sinc function.
 It is defined as sin( x)
sinc ( x) 
x
 Its maximum sinc(0) =1.
 It is an even function of x.
 It approaches 0 as x approaches .
 It goes through 0 at x = 1, 2, …

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Gate Function
 It is a rectangular pulse with unity height and width .
 The gate pulse is represented mathematically as
  
t  1 for -  t 
x(t )  rect   2 2
  0 for otherwise

x(t)
1

time
-/2 0 /2

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Exponential Fourier Series
 A periodic signal s(t) with a period To can be represented by
an exponential Fourier series of the form

s(t )   C (nf
n  
s o ) e j 2nfot ; -  t  

where 1
T0 / 2
 j 2nf0t
C s (nf 0 ) 
T0  s(t ) e dt
T0 / 2

 Examples

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Trigonometric Fourier Series
 The periodic signal s(t) can also be expanded into an infinite
sum of sine and cosine trigonometric functions as

s(t )  a0  2 a n cos(2nf 0 t )  bn sin(2nf 0 t )
 where n 1
T0 / 2
1
a0 
T0  s(t )
T0 / 2
dt

T0 / 2
1
an 
T0  s(t ) cos(2nf t )dt;
T0 / 2
0 n  1,2,...

T0 / 2
1
bn 
T0  s(t ) sin(2nf t )dt;
T0 / 2
0 n  1,2,...

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Fourier Transform of Aperiodic Signals
 Fourier series gives the discrete frequency domain of a
periodic signal.
 Fourier transform gives the continuous frequency domain of
a nonperiodic signal that we encounter in communications .

 S ( f )e
j 2ft
s (t )  df ; -   t  


 s(t )e
 j 2ft
S( f )  dt ; -   f  


s(t )  S ( f )

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Frequency Translation Theorem
 In communication, we encounter signals of the form
y(t )  x(t ) cos(2f 0 t )
 Such signals are called modulated signals.
 the Fourier transform of y(t) is related to the Fourier
transform of x(t) by
Y( f )  1
2 X ( f  f 0 )  X ( f  f 0 )
 Because of the shifting of the spectrum, it is known as the
frequency translation. It is conveniently restated as
x(t ) cos 2f 0 t  1
2 X ( f  f 0 )  X ( f  f 0 )

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Signal Characteristics
Frequency Translation Theorem

Y ( f )  12 X ( f  f 0 )  X ( f  f 0 )

X(f) Y(f)

f f
- fx 0 fx -f0- fx -f0 -f0+ fx f0+fx f0 f0+fx

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

DIGITAL TRANSMISSION
OF ANALOG DATA
 Sampling Theory
 Pulse Modulation Techniques
 Wave Coding of Analog Signals
 Pulse Code Modulation
Chapter 3  Delta Modulation
 Data Compression

CLO1 + CLO2

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Objectives of Chapter 3

By the end of this chapter, the student will be able to:


 Understand the sampling theory.
 Compare between pulse modulation schemes.
 Define the elements of PCM technique.
 Explain the operation principles of DM approaches.
 Understand the need for data compression.
 Differentiate between lossless and lossy approaches.
Chapter 2  Apply lossless compression algorithms.
 Understand the operation of the lossy compression
methods.
CLO1 + CLO2

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Digital Transmission
Digital Transmission of Analog Signal
 Analog data is converted to digital signals through sampling.
 The sampled values can be quantized to predefined values.
 These samples can be further encoded into a bit stream
before transmission if needed.

Analog Sampler Digital Decoder


information quantizer commun. and
source encoder system D/A

x(t) s k (t ) s k (t ) x(t)
Continuous Discrete Discrete Continuous
random random random random
signal sequence sequence signal

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Statement of Sampling Theory
 A signal x(t) that is bandlimited to fx may be represented and
recovered from its samples at a rate ≥ 2fx samples/sec.
Electronic switch
xs(t) = x(t) . s(t) x(t)
Input
X
x(t) Output xS(t)
x(t) xs(t)
xs(t)
Sampling function s(t)

 Two questions arise:


1- Are these samples sufficient to describe x(t)?
2- If so, how can we reconstruct x(t) from xs(t)?

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Proof of Sampling Theory
 The sampling function s(t) can be expressed using xs(t) = x(t) . s(t)
Input
X
trigonometric Fourier series as x(t) Output xS(t)

s(t )  a0  2a1 cos(ws t )  2a2 cos(2ws t )  ...


Sampling function s(t)
 The sampled signal xs(t)= x (t). s(t) can now be expressed as
xs (t )  ao x(t )  2a1 x(t ) cos(ws t )  2a2 x(t ) cos(2ws t )  ...
 Using frequency translation property, FT of xs(t) is given by
X s ( f )  a o X ( f )  a1 X ( f  f s )  X ( f  f s )
 a 2 X ( f  2 f s )  X ( f  2 f s )  ...

X s ( f )  ao X ( f )   a . X ( f  nf
n  
n s )
n0

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Proof of Sampling Theory Xs(f)
Ideal LPF can recover
X(f) the signal
Practical LPF

f f
-fx 0 -(fs+fx) -fs -(fs-fx) -fx 0 fx fs-fx fs
fx fs+fx
Guard
a: X(f) c: fs>2fx band

Xs(f) Xs(f)

f
-(fs+fx) -fs -fx 0 fx fs -fs -fx 0 fx
fs+fx fs fs+fx
fs - fx
b: fs=2fx Aliased components
d: fs<2fx

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Important Points about Sampling Theory
 If fs>2fx, the sampling leaves the message spectrum intact.
 In this case a guard band is used as a buffer.
 If fs<2fx, sidebands of the signal overlap and x(t) cannot be
recovered from Xs(f) without distortion.
 This distortion is due to under-sampling is celled aliasing.
 Thus, we use a LP anti-aliasing or band-limiting filter of cut-
off fx Hz prior to sampling.
 Then, the filtered signal is sampled at a rate fs>2fx.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Nyquist Sampling Rate and Period
 The minimum sampling frequency is called Nyquist rate
fs min==2fx samples/sec
 The maximum sampling interval is called Nyquist interval,
Ts max = 1/ 2fx sec

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Recovery of Original Signal
 It is possible to reconstruct x(t) from xs(t) by using LPF with
a cut off frequency of fx Hz, or at a bandwidth of

fx  B  fs  fx

Xs(f)
Ideal LPF can recover
the signal
Practical LPF

f
-(fs+fx) -fs -(fs-fx) -fx 0 fx fs-fx fs fs+fx
Guard
band

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Recovery of Original Signal
 At the receiver, the signal is passed through a simple
holding circuit and a LPF. S

Receiving Recovered xs(t) C


sampled signal signal
Holding circuit LPF

a: Recovery circuit. b: Holding circuit.

Due to charging
Holding circuit
Due to holding output
LPF output
x(t)

t
c: Output of holding circuit. d: Output of LPF.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Example 3.1
 A voice message to be transmitted on a telephone line.
 It is bandlimited to fx=3.3 KHz, and sampled at 8 KHz.
 Find the guard band.
Solution
 The minimum required band is given by
Minimum band = 2fx = 2×3.3 = 6.6 KHz Xs(f)

 The guard band is given by


Guard band = fs - minimum band
= 8 – 6.6 = 1.4 KHz.
f
-(fs+fx) -fs -(fs-fx) -fx 0 fx fs-fx fs fs+fx
Guard
band

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Example 3.2
 Calculate the Nyquist sampling rate and interval for the
composite analog signal x(t )  13 sin 500t  8 cos 60t  2 cos 150t
Solution
 It can represented as x(t )  13 sin w1t  8 cos w2t  2 cos w3t
 The maximum frequency is fmax = f1 = 250 Hz
 The Nyquist sampling rate is
f s  2 f max  2  250  500 samples/sec
 The sampling interval is
Ts  1 / f s  1 / 500  2 msec

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Example 3.3
 Find Nyquist sampling rate and interval for the signal
x(t )  4 cos(3000t ) cos(2000t )
Solution
 We need to determine fmax cos A cos B  12 cos( A  B)  cos( A  B)

 Then x(t )  4
2 cos(3000t  2000t )  cos(3000t  2000t )
 2 cos(5000t )  2 cos(1000t )
 The maximum frequency is fmax = f1 = 2500 Hz

 Nyquist sampling rate = 5000 sample/sec


 Nyquist interval = 1/5000=2×10-4 sec.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Types of Sampling

Sampling techniques

Instantaneous sampling Natural sampling Flat-top sampling

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
1- Instantaneous Sampling
 It is also called the impulse sampling or the ideal sampling.
 It uses a train of impulses and a switching sampler.
x (t ) Input signal Ts(t) sampling function.

t
0 t
-4Ts -3Ts -2Ts -Ts 0 T s 2T s 3T s 4T s

xs(t) sampled signal.

x(t)
xs(t)

3T s 4T s
t t
-Ts 0 T s 2T s
Switching sampler.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
2- Instantaneous Sampling
 The impulse train sampling function is expressed as

 Ts (t )    (t  nTs )


 The sampled signal xs(t) can be expressed as


x s (t )  x(t )   Ts (t )

 x(t )    (t  nTs )


  x(nTs )   (t  nTs )

 The Fourier transform of sampled signal can be given by.

X s ( f )  f s  X ( f  nf s )


Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Few Points about Instantaneous Sampling
 The sampled signal is discrete in time domain with Ts.
 The spectrum will repeat for every fs Hz.
 Aliasing occurs if fs < 2fx, so over-sampling is usually done.
 Ideal sampling is possible only in theory as it is impossible
to have a pulse whose width approaches zero.
 The power content in the instantaneous sampled pulse is
negligible; so it is not suitable for communication purposes.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
2- Natural Sampling
 Sampling is performed by a train of periodic rectangular
pulses with finite width  and frequency equal to fs Hz.
 Tops of samples are not flat but follow the waveform x(t).
x(t) Ts(t) xs(t)

3T s 4T s
t t t t
0 -3Ts -2Ts -Ts 0 Ts 2T s 3T s 4T s -Ts 0 T s 2T s

(a) Input signal (b) sampling function. (c) Natural sampling.

 
Xs( f ) 
Ts
 sin c(nf

s   )  X ( f  nf s )

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Few Points about Natural Sampling
 The spectrum of the sampled signal will repeat itself every fs
with an amplitude weighted by „sinc‟ function envelope.
 Its electronic circuitry is somewhat complicated because the
pulse top shape is to be maintained.
 Natural sampled pulses are received while contaminated by
noise.
 It becomes quite difficult to determine its exact shape.
 The distortion after recovery depends on the ratio (/Ts).

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
3- Flat top Sampling
 It is called rectangular pulse sampling and it is practical.
 The top of the samples remains constant and is equal to
input signal x(t) at the start of sampling.
sampling function Ts(t) xs(t) Flat-top sampling.
x(t) Input signal

3T s 4T s
t t t t
0
-3Ts -2Ts -Ts 0 Ts 2T s 3T s 4T s -Ts 0 T s 2T s

 It is very common, and easily implemented.


 Noise can be easily removed.
 There must be distortion when flat top pulses are involved.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Sampling Theory
Illustrative Sampling Circuit
 It is an emitter follower.
 In absence of clock, the output follows the input.
 The signal x(t) is applied as an input signal.
+Vcc
 The clock is applied to the base with:
1- Its frequency = fs Hz.
Input modulating signal
2- High level is at ground (0 v). x(t)
Output
xs(t)
3- Low level is at negative voltage
that is sufficient to bring
clock t

transistor in the cut-off region.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Modulation Techniques


Types of Pulse Modulation

Pulse modulation techniques

Pulse amplitude modulation Pulse time modulation

Pulse width modulation Pulse position modulation

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Modulation Techniques


Types of Pulse Modulation
Amplitude

a- PAM
Time

b- PDM

c- PWM

d- PPM

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Modulation Techniques


1- Pulse Amplitude Modulation (PAM)
 Waveform is sampled at fixed intervals of Ts  1/2 fx.
 This presents a train of instantaneous samples.
 Flat-top sampled PAM is widely used.
 A sample and hold circuit is used to produce it.
 The original waveform can easily be reproduced by passing
the pulses through a LPF.
Amplitude

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Modulation Techniques


Advantages of PAM
 It is the simplest modulation technique to be generated.
Disadvantages of PAM
 It is very susceptible to noise that deforms the meaning.
 The transmission bandwidth is very large in comparison to
the maximum frequency content in the original signal.
 As the amplitude of the PAM signal varies, this also varies
the peak power by the transmitter.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Modulation Techniques


2- Pulse Duration Modulation (PDM), (PWM)
 The amplitudes are transformed to pulses of fixed height
and variable duration in two forms:
1- All pulses start at the clock timing and information is
retained in position of the trailing edge.
2- The center of the pulse is hold constant and allows both
edges vary on both sides of the center of the pulse.
Amplitude

time

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Modulation Techniques


Advantages of PDM
 It is far less susceptible to noise than PAM.
 Signal and noise separation is very easy.
 It does not require synchronization between Tx and Rx.
Disadvantages of PDM
 Any distortion of the pulse shape will be misrepresented.
 Large bandwidth is required for PWM communication as
compared to PAM.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Modulation Techniques


3- Pulse Position Modulation (PPM)
 As a solution to the distortion of the pulse shape, PPM
transmits only the two edges of the pulse.
 It is based on PDM, but two pulses of fixed amplitude and
duration are transmitted for each sample.
 With clock pulses, only the trailing-edge pulses may be
transmitted.
Amplitude

time

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Modulation Techniques


Advantages of PPM
 It is superior to all PAM, PDM, PWM, as it is not susceptible
to any amplitude or shape distortion.
 Like PWM, signal and noise separation is very easy.
 The transmission power for each pulse is the same due to
the constant widths and amplitudes of the pulses.
Disadvantages of PDM
 Spikes may be mistakenly acknowledged as real pulses.
 Synchronization between Tx and Rx is required.
 Compared to PAM, wider bandwidth is required.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Waveform Coding of Analog Signal


Types of Waveform Coding

Types of waveform coding

Pulse code modulation Delta modulation

Differential PCM Adaptive DM

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Block Diagram of PCM
xsq(t)=xs(t)+eq(t)
bandlimited
signal

Low pass Sampler Quantizer Encoder


x(t) filter xs(t)
A/D converter

Noisy channel

Low pass D/A Matched


x(t) filter xsq(t) converter filter

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


1- Bandlimiting
 Signal passed through LPF with a cut-off frequency fx.

X(f)
H(f) X(f)

f f f
fX fX
Baseband signal Low-pass filter Bandlimited signal

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


2- Sampling
 The sampling frequency fs must exceed 2fx.
 Consider a voice signal. Ts
fs(t)

t
Sampling
f(t) f(t)
fs(t)
Low
Electronic
t Pass t Switch
Filter t

Analog signal 0.3-3.4 kHz Bandlimited PAM sampled signal


to 3.4 kHz
fs=8 ks/s

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


3- Quantizing
 The amplitude of the samples is measured and
approximated to one of a finite set of predefined values.
Quantized value
q7 Sampled
value
q6

q5
Quantized error

q4

q3 time

q2

q1
q0

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


3- Quantizing Output

 Step size
Input/Output

Quantizer
input Input
 Quantizer
output

t b: Transfer characteristic of a quantizer.


a: Quantization process.

Pqe(qe)
1/
Quantization
error (i/p-o/p)

/2 qe
t -/2 +/2
-/2
d: Distribution of quantization error.
c: Range of quantization error.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


4- Coding
 The quantized values is converted into a binary code of 
bits.

Encoder
0 1 0 1 1 0 0 1

Quantized Samples Binary bits

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


5- Signal Recovery at the Receiver
 The matched filter separates signal from noise by making a
single decision of whether a 0 or a1 bit has been received.
 After decoding a group of bits representing the codeword
for quantized value, the receiver assigns a signal level to the
codeword.
 This is the function of (D/A) converter.
 The obtained sequence of levels is filtered to reject any
frequency components lying outside the baseband.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Quantization Noise
 It is produced due to rounding off the sampled values to the
nearest representation level.
 With a uniform step size of , the representation levels are 0,
, 2, ...etc.
 The error qe varies randomly within interval -/2 qe  /2
 The pdf for the quantization error qe is defined as

0 for qe    2 Pqe(qe)
 1/
f qe (qe )   1  for -  2  qe   2
0 for qe   2
 qe
-/2 +/2

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Quantization Noise
 The average power of qe is determined by its mean square

value as 2
qe   qe  f qe (qe )dqe
2



2
 

1 q  2
2 3 2
1
  q e  dq e   e  
2

    3    12

2 2

 The value of qe grows as the square of the step size.


 Small distortion requires small  and large number of levels.
 The number of levels is determined by the desired fidelity.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Signal to Quantization Noise of PCM
 The signal to quantization noise is given by
S Normalized signal power

N Normalized noise power
 The number of levels Q is related to the number of bits per
sample  as Q=2.
 The signal has an amplitude of a range from -xmax to +xmax.
 The total amplitude range is given by 2xmax.
 the step size  is given by
2 x max 2 x max
  
Q 2

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Signal to Quantization Noise of PCM
 The signal to noise ratio is given by
S P 3P
 2
 2
 2 2
N  2 x max  1 x max
   
 2  12
 Let the input signal is normalized such that xmax=1, and the
destination signal power is also normalized such that P  1.
 The signal to noise ratio can be expressed as
S
 3 2 2
N
 In decibels, S S 2
 dB  10 log 10    10 log 10 [3  2 ]
N N
 (4.8  6 ) dB

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Bandwidth Requirements of PCM
 For binary PCM system with  bits per sample, the number
of quantizer levels Q is given by Q  2 levels
 The number of bits per sample is   log 2 Q bits/sample
 Thus, the channel bit rate is
rs  f s  2f x
 The bandwidth BPAM is given by BPAM  rs / 2 Hz
 Therefore, the bandwidth of PCM signal is
BPCM  f x Hz
 Then, BPCM  f x log 2 Q Hz
Prof. Mostafa Nofal
College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Examples

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Regenerative Repeaters in PCM system

Decision
Amplitude making
equalizer device
Distorted Regenerated
PCM signal PCM signal

Timing Distorted
circuit PCM signal

Decision
threshold
a: Block diagram of a regenerative repeater.

Sampling
instants
decision
0 1 0 1 0

Regenerated
PCM
output

b: Waveforms of a regenerative repeater.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Non-uniform Quantization and Companding
 The quantization noise depends on the step size (2/12).
 When steps are uniform in size, the small amplitude signals
will have a poorer S/N than the large amplitude signals.
 As the number of levels is fixed, the only way to have a
uniform S/N ratio is to adjust the step size.
 The step size should be small for small amplitude signals
and large for large amplitude signals.
 The non-uniform quantization is practically achieved
through companding (compressing + expanding).

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Non-uniform Quantization and Companding

Output
voltage Compression Linear
characteristics

Expansion

Input voltage
Expansion

Compression

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Non-uniform Quantization and Companding
 We need a linear compressor for small amplitudes of the
input signal and logarithmic characteristics elsewhere.
 In practice, this is achieved by using two methods:
1- -law companding where the compressor characteristic is
continuous.
2- A-law companding where the compressor characteristic is
piecewise made up of a linear segment for low level inputs
and a logarithmic segment for high level inputs.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Pulse Code Modulation (PCM)


Features of PCM
 The PCM may find extensive applications in telephony and
space communications due to its high noise immunity.
Advantages of PCM
 Very high noise immunity.
 Storing possibility due to its digital nature.
Disadvantages of PCM
 The coding, decoding and quantizing circuitry is complex.
 It requires a large bandwidth as compared to other systems.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Differential PCM (DPCM)


Need for DPCM
 The adjacent samples of the signal carry the same
information with a little difference.
 In DPCM, the difference between two successive samples is
quantized, encoded, and transmitted.
 This results in a reduced bit rate.
 Thus, the bandwidth required is less than that for PCM.
 The disadvantage of DPCM is that the modulator and
demodulator circuits are more complicated.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Differential PCM (DPCM)


Circuit of DPCM
Sampled
input + e (nTs)
Quantizer
eq(nTs)
Encoder DPCM
x(nTs)  signal
-
̃x(nTs) +

+
Prediction
filter xq(nTs)
a: DPCM transmitter.
DPCM
input
Decoder +  Output

+
Prediction
filter
b: DPCM receiver.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Delta Modulation (DM)


At the Transmitter
 It exploits the sample-to-sample redundancy in a waveform.
 It uses only one bit per sample to indicate whether the
signal has increased or decreased since the last sample.
 The goal of using DM is to reduce the data rate required to
transmit a specific signal.
 The signal to be transmitted is the pulse waveform Po(t) that
has only two possible weights (binary waveform).

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Delta Modulation (DM)


Circuit and Waveforms of DM Pi(t)

Pulse ~
generator x (t )
Pi(t)
x (t)
+ Po(t)
x(t) (t) Communication
Differential Modulator
amplifier channel
- t
~
x (t )
Integrator
Po(t)

(t) = x(t) - ~
x (t ) t

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Delta Modulation (DM)


At the Receiver
 An integrator can get ~x (t ) from Po(t).
 LPF suppresses the jumps in ~x (t ) and thereby smooth the
signal to follow more smoothly the original x(t).
 LPF can do the job by itself with no need for integrator.
 The output of the filter differs from the original because:
1- the effects of stepwise approximation of delta modulation.
2- errors made by the receiver quantizer due to noise.
 The quantization noise for DM as
2
qe 
3
Prof. Mostafa Nofal
College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Delta Modulation (DM)


Advantages of DM
1- Simplicity
 The A/D conversion is provided by a simple comparator.
 D/A at receiver is provided by a two-polarity pulse
generator.
2- Less stringent requirements
 DM allows the use of relatively simple filters for band-
limiting the input and smoothing output.
3- Low bit rate
 Lower bit rate can be generated to describe the signal.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Delta Modulation (DM)


Disadvantages of DM
 If the rate of rise of x(t) is so high such that the stair case
signal cannot approximate it, a large error occurs.
 This is known as slop overload distortion.
Slop ~
overload
x (t )
distortion
x(t)

t
 To reduce this error, the step size must be increased when
the slop of the signal x(t) is high.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Delta Modulation (DM)


Disadvantages of DM
 Another source of noise in DM; the granular or idle noise.
 It occurs when the step size is too large compared to small
variations in the input signal.
 For almost flat signal, the staircase signal oscillates by 
around the signal.
x(t)
Granular
noise

t
 The solution to this problem is make step size small.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Delta Modulation (DM)


Disadvantages of DM
 Consequently:
1- a large  is required to accommodate wide dynamic range
of the input signal for reducing slop overload distortion, and
2- a small  step sizes are required to reduce granular noise.
 Adaptive DM is a modified DM to overcome these errors.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Adaptive Delta Modulation (ADM)


On the Transmitter Side
 A variable gain amplifier is used before the integrator with
Po(t) as its input.
 Its gain depends on the gain control input
Pulse
generator
obtained by integrating Po(t) P i (t)
+
in an RC-network x (t )
Differential
amplifier
(t)
Modulator
Po(t) Communication
channel
-
and then passing ~
x (t )
Variable gain
Integrator amplifier
the integrator output
Gain control input R
through a square law device. Square law
device
C

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Adaptive Delta Modulation (ADM)


On the Transmitter Side
 Under slop overload, Po(t) is a long sequence of positive or
negative pulses and RC integrator integrates them.
 The output of the integrator is either of a large positive or
large negative value.
 The square law device output is of a large positive value
irrespective of whether the input is positive or negative.
 Thus, the gain control input is large and gain increases.
 Hence, the step size increases to overcome the slop
overload.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Adaptive Delta Modulation (ADM)


On the Transmitter Side
 When the signal variations are within the step size, Po(t) is a
sequence of alternate positive and negative pulses.
 The RC integrator output in this case is zero and hence the
gain control input of the variable gain amplifier is also zero.
 The gain of the variable gain amplifier decreases, resulting
in a reduced step size, which takes care of the situation.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Adaptive Delta Modulation (ADM)


On the Receiver Side
 Signal is fed to a variable gain amplifier whose gain control
input is derived from RC integrator and a square law device.
 Thus, an adaptive adjustment of the step size is obtained at
the receiver.
Communication Variable gain
channel Quantizer Integrator LPF
amplifier

Gain
control
input
R
Square law
device
C

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Adaptive Delta Modulation (ADM)


Advantages of DM
1- It posses the advantages of simple DM.
2- The signal to noise ratio becomes better than DM due to the
reduction in slop overload distortion and idle noise.
3- Thanks to its variable step size, the dynamic range of ADM
is wider than simple DM.
4- Utilization of bandwidth is better than delta modulation.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Comparison between PCM and DM


Based on quality
 At lower bit rates, DM is better than the standard PCM.
 PCM hardware is more expensive and complicated than DM.
 For the same quality, PCM requires less bandwidth than
does DM as DM should use very high sampling rate.
 For a fixed bandwidth, the performance of DM is always
poorer than PCM.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Comparison between PCM and DM


Usage of DM
 The use of DM is recommended in certain circumstances:
1- if the bandwidth conservation (reduced the bit rate) is
desirable and limited voice quality is tolerable.
2- if extreme circuit simplicity is of importance and the
accompanying use of a large bandwidth is acceptable.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

DATA COMPRESSION

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Compression
Meaning of Data Compression
 The rate of data demand from the public is ever increasing.
 Users need to download more and more data in a shorter
and shorter time.
 Users want to store more and more data in a smaller space.
 Data compression refers to the process of sending or storing a
smaller number of bits.
 Compressing data can reduce the amount of data sent or stored by
partially eliminating inherent redundancy.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Compression
Need for Data Compression
1- Save the storage capacity needed for large files so that
more files can be stored.
2- Reduce the data traffic across the network which results in
less network congestion (e.g. 1000A).

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Data Compression
Applications of Data Compression
 Digital photography.
 Digital satellite receivers.
 Digital cellular telephony.
 Medical applications.
 Entertainments such as DVD and MP3, 4.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Methods of Data Compression


Methods of Data Compression

Data compression methods

Lossless Methods Lossy methods


(text or programs) (image, video, audio)

Run-Length Huffman Lempel Ziv JPEG MPEG

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Methods of Data Compression


Lossless Compression
 In lossless data compression, the integrity of the data is
preserved.
 The original and recovered data are the same.
 The compression and decompression algorithms are exactly
the inverse of each other.
 No part of the data is lost in this process.
 Redundant data are removed in compression and added
during decompression.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


1- Run-Length Encoding
 It is the simplest method.
 It can be used to compress data of any combination of
symbols.
 It does not need knowledge of the frequency of occurrence
of symbols (only the number of occurrence).
 It is very efficient if:
 data are represented by two symbols as 0, 1.
 frequency of one symbol is greater than another.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


1- Run-Length Encoding of Characters
 Replace the repeated symbol by only one symbol
occurrence, followed by the number of occurrence.

BBBBBBBBB AAAAAAAAAAA N MMMMM

B09 A11 N01 M05

B09A11N01M05

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


1- Run-Length Encoding of Numbers
 The repeated string is replaced by:
1- a special marker (#),
2- followed by the symbol,
3- followed by the number of occurrences
57264444444443213333333333333333333127800000

5726 #409 321 #319 1278 #005


5726#409321#3191278#005
Prof. Mostafa Nofal
College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


1- Run-Length Encoding of Binary data

14 4 0 12
000000000000001000011000000000000

1110 0100 1100

The counts are


represented as 0000
4-b number.

1110010000001100

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


1- Run-Length Encoding of Binary data
 The 4-b number represents only 15 repetitions.
 For more than 15, they are broken into 2 or more groups.
 A sequence of 25 (0‟s), it is represented as (15+10) zeros.

0000000000000000000000000

1111 1010

11111010

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


2- Huffman Coding
 Shorter codes are assigned to symbols that occur more
frequently.
 Longer codes are assigned to symbols that occur less
frequently.
 Assume a file with 5 characters: A, B, C, D, E.

Character A B C D E
Frequency 17 12 12 27 32 100

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


2- Huffman Coding
 Assign each character a weight based on its frequency.
 Build a tree based on those values.
100
Character 0
A B C D E 1
Frequency 17 12 12 27 32
Code 41
00 010 011 10 11 1
0
24 59
0 1 0 1

A B C D E
17 12 12 27 32
Prof. Mostafa Nofal
College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


Points about Huffman Coding
1- The characters with higher frequencies receive a shorter
code.
2- No code is a prefix of another code.

Character A B C D E
Frequency 17 12 12 27 32
Code 00 010 011 10 11

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


Example: Huffman Coding Encoder

A: 00
B: 010
C: 011 EAEBAECDEA
D: 10
E: 11

Send
11 00 11 010 00 11 011 10 11 00
Huffman code

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


Example: Huffman Decoding

Decoder

00: A
010: B
011: C
1100110100011011101100
10: D
11: E

EAEBAECDEA

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


3- LZW Compression Method
 It is originated by Lempel and Ziv and modified by Welch.
 It is a lossless compression where text can be totally recovered.
 It is preferable to Huffman encoding because prior
knowledge of the symbol frequencies is not required.
 It is a dictionary-based encoding.
 The idea is to create a dictionary (table) of strings used
during the communication session.
 Strings can be replaced by their index in the dictionary to
reduce information transmitted.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


Difficulties of LZW Compression
1- How can a dictionary be created for each session?
2- How can the receiver acquires the dictionary made by the
sender (Sending dictionary increases transmitted data)?

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


Compression of LZW Algorithm
1- build an indexed dictionary.
2- compress a string of symbols.
 The algorithm extracts the smallest substring that cannot
be found in the dictionary from the remaining non-
compressed string.
 It then stores a copy of this substring in the dictionary as a
new entry and assigns an index value.
 Compression occurs when the substring, except for the last
character, is replaced with the index found in the dictionary.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


LZW Encoding
1 Parsed string
B
B BAABABBBAABBBBAA
B
Parsed string
1 2
B A
A AABABBBAABBBBAA
B, A
Parsed string
1 2 3
B A AB ABABBBAABBBBAA
AB
B, A, 2B
1 2 3 4 Parsed string
B A AB ABB
ABB ABBBAABBBBAA
B, A, 2B, 3B

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


LZW Encoding
1 2 3 4 Parsed string
B A AB ABB ABBBAABBBBAA
ABB
B, A, 2B, 3B
Parsed string
1 2 3 4 5
B A AB ABB BA
BA BAABBBBAA
B, A, 2B, 3B, 1A
1 2 3 4 5 6 Parsed string
B A AB ABB BA ABBB
ABBB ABBBBAA
B, A, 2B, 3B, 1A, 4B
Parsed string
1 2 3 4 5 6 7
B A AB ABB BA ABBB BAA BAA BAA
B, A, 2B, 3B, 1A, 4B, 5A B, A, 2B, 3B, 1A, 4B, 5A Compressed

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


Decompression of LZW Algorithm
 Decompression is the inverse of the compression process.
 The process extracts the substrings from the compressed
string and tries to replace the indexes with the
corresponding entry in the dictionary.
 The dictionary is empty at first and built up gradually.
 When an index is received, there is already an entry in the
dictionary corresponding to that index.

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


LZW Decoding
1 Parsed string
B
B B, A, 2B, 3B, 1A, 4B, 5A
B

1 2 Parsed string
B A
A A, 2B, 3B, 1A, 4B, 5A
BA

1 2 3 Parsed string
B A AB
2B 2B, 3B, 1A, 4B, 5A
B A AB

1 2 3 4 Parsed string
B A AB ABB
3B, 1A, 4B, 5A
3B
B A AB ABB

Prof. Mostafa Nofal


College of Computers ‫كلية احلاسبات‬
and Information Technology ‫وتقنية املعلومات‬

Lossless Data Compression


LZW Decoding

1 2 3 4 5 Parsed string
B A AB ABB BA
1A, 4B, 5A
1A
B A AB ABB BA

1 2 3 4 5 6 Parsed string
B A AB ABB BA ABBB
4B, 5A
4B
B A AB ABB BA ABBB

1 2 3 4 5 6 7 Parsed string
B A AB ABB BA ABBB BAA
5A
5A
B A AB ABB BA ABBB BAA
B A AB ABB BA ABBB BAA Uncompressed

Prof. Mostafa Nofal

Potrebbero piacerti anche