DATA ENCODING
Digital signaling
→ Data source g(t) encoded into digital signal x(t)
→ g(t) itself may be analog or digital
→ Actual form of x(t) dependent on encoding technique, chosen to optimize use of transmission
medium
Analog signaling
→ Based on a continuous constant-frequency signal, called the carrier signal
→ Carrier signal frequency chosen to be compatible with transmission medium
→ Data transmitted by carrier signal modulation
Modulation
→ Process of encoding source data onto a carrier signal with frequency fc
→ Operation on one or more of three fundamental frequency-domain parameters - amplitude,
frequency, and phase
Input signal m(t)
→ can be analog or digital
→ Also called modulating signal or baseband signal
Modulated signal s(t)
→ result of modulating carrier signal
→ Location of bandwidth on the spectrum related to carrier frequency fc
Different possible combinations
1. Digital data, digital signal - Simple and inexpensive equipment
2. Analog data, digital signal - Data needs to be converted to digital form
3. Digital data, analog signal - Needed to take advantage of existing transmission media that only allows the
transmission of analog signal
4. Analog data, analog signal
- Transmitted as baseband signal easily and cheaply
- Modulation to shift the bandwidth of baseband signal to another portion of spectrum
- Multiple signals on different position on the spectrum can share the same transmission medium
(frequency-division multiplexing)
Page 1 of 21
Digital Data, Digital Signals
Digital signal
- Sequences of discrete, discontinuous voltage pulses
- Binary data transmitted by encoding each data bit into signal elements
Key data transmission terms.
In data communications, our aim is to send data elements (1s and 0s). A data element is the smallest
entity that can represent a bit. A signal element carries data elements. Data elements are being carried; signal
elements are the carriers. We define a ratio r which is the number of data elements carried by each signal
element.
Line Coding or Encoding
Line coding is the process of converting digital data to digital signals. We assume that data, in the
form of text, numbers, graphical images, audio, or video, are stored in computer memory as sequences of
bits. Line coding converts a sequence of bits to a digital signal. At the sender, digital data are encoded into a
digital signal; at the receiver, the digital data are recreated by decoding the digital signal.
Line coding schemes
The Encoding methods/schemes are broadly categorized into three as shown below:
Page 2 of 21
Unipolar encoding
Unipolar encoding uses only one voltage level, either above or below zero level. A Unipolar scheme
was designed as a non-return-to-zero (NRZ) scheme in which the positive voltage defines bit 1 and the zero
voltage defines bit 0. It is called NRZ because the signal does not return to zero at the middle of the bit. The
figure shows a Unipolar NRZ scheme.
Polar encoding
Polar encoding uses two voltage levels (positive and negative).
Types of Polar Encoding
NRZ-L and NRZ-I Encoding
In polar NRZ encoding, we use two levels of voltage amplitude. We can have two versions of polar
NRZ: NRZ-Land NRZ-I. In the first variation, NRZ-L (NRZ-Level), the level of the voltage determines the
value of the bit. In the second variation, NRZ-I (NRZ-Invert), the change or lack of change in the level of
the voltage determines the value of the bit. If there is no change, the bit is 0; if there is a change, the bit is 1.
RZ Encoding
The main problem with NRZ encoding occurs when the sender and receiver clocks are not
synchronized. The receiver does not know when one bit has ended and the next bit is starting. One solution
Page 3 of 21
is the return-to-zero (RZ) scheme, which uses three values: positive, negative, and zero. In RZ, the signal
changes not between bits but during the bit.
Manchester and Diff. Manchester Encoding
The idea of RZ (transition at the middle of the bit) and the idea of NRZ-L are combined into the
Manchester scheme. In Manchester encoding, the duration of the bit is divided into two halves. The voltage
remains at one level during the first half and moves to the other level in the second half.
The transition at the middle of the bit provides synchronization. Differential Manchester, on the other hand,
combines the ideas of RZ and NRZ-I. There is always a transition at the middle of the bit, but the bit values
are determined at the beginning of the bit. If the next bit is 0, there is a transition; if the next bit is 1, there is
none.
Types of Bipolar Encoding
In bipolar encoding (sometimes called multilevel binary), there are three voltage levels: positive,
negative, and zero. The voltage level for one data element is at zero, while the voltage level for the other
element alternates between positive and negative.
AMI and pseudoternary: A common bipolar encoding scheme is called bipolar alternate mark inversion
(AMI). In the term alternate mark inversion, the word mark comes from telegraphy and means 1. So AMI
means alternate 1 inversion. A neutral zero voltage represents binary 0. Binary 1s are represented by
alternating positive and negative voltages. A variation of AMI encoding is called pseudoternary in which the
1 bit is encoded as a zero voltage and the 0 bit is encoded as alternating positive and negative voltages.
Page 4 of 21
Bipolar AMI Encoding
Scrambling
Biphase schemes that are suitable for dedicated links between stations in a LAN are not suitable for
long-distance communication because of their wide bandwidth requirement. One solution is called
scrambling. We modify part of the AMI rule to include scrambling, as shown in the following figure.
Note that scrambling, as opposed to block coding, is done at the same time as encoding. The system
needs to insert the required pulses based on the defined scrambling rules. Two common scrambling
techniques are B8ZS and HDB3.
B8ZS Encoding
Same as bipolar AMI, except that any string of eight zeros is replaced by a string with two code
violations, as follows:
Page 5 of 21
HDB3 Encoding
Same as bipolar AMI, except that any string of four zeros is replaced by a string with
one code violation, as follows:
Digital data, analog signals
The most familiar use of this transformation is for transmitting digital data through the public
telephone network. The telephone network was designed to receive, switch, and transmit analog signals in
the voice-frequency range of about 300 to 3400 Hz. The digital devices are attached to the network via a
modem, which converts digital data to analog signals, and vice versa.
Encoding Techniques
The Digital-to-Analog modulation involves operation on one or more of the three characteristics
of a carrier signal: amplitude, frequency, and phase. Accordingly, there are four basic encoding or
modulation techniques for transforming digital data into analog signals.
1. Amplitude Shift Keying (ASK)
2. Frequency Shift Keying (FSK)
Page 6 of 21
3. Phase Shift Keying (PSK)
4. Quadrature Amplitude Modulation(QAM)
I. Amplitude Shift Keying (ASK)
In amplitude shift keying, the amplitude of the carrier signal is varied to create signal elements. Both
frequency and phase remain constant while the amplitude changes. ASK is normally implemented using
only two levels. This is referred to as binary amplitude shift keying (BASK) or on-off keying (OOK). The
peak amplitude of one signal level is 0; the other is the same as the amplitude of the carrier frequency.
Bandwidth for ASK is proportional to the signal rate (baud rate). However, there is normally another factor
involved, called d, which depends on the modulation and filtering process. The value of d is between 0 and
1. This means that the bandwidth can be expressed as shown below, where S is the signal rate and the B is
the bandwidth.
Relationship between baud rate and bandwidth in ASK
II. Frequency Shift Keying
In frequency shift keying, the frequency of the carrier signal is varied to represent data. The
frequency of the modulated signal is constant for the duration of one signal element, but changes for the next
signal element if the data element changes. Both peak amplitude and phase remain constant for all signal
elements.
Page 7 of 21
Relationship between baud rate and bandwidth in FSK
III. Phase Shift Keying
In phase shift keying, the phase of the carrier is varied to represent two or more different signal
elements. Both peak amplitude and frequency remain constant as the phase changes. Today, PSK is more
common than ASK or FSK. QAM, which combines ASK and PSK, is the dominant method of digital-to-
analog modulation.
PSK constellation
Page 8 of 21
The 4-PSK method
The 8-PSK characteristics
Relationship between baud rate and bandwidth in PSK
IV. Quadrature Amplitude Modulation
Quadrature amplitude modulation is a combination of ASK and PSK so that a maximum contrast
between each signal unit (bit, dibit, tribit, and so on) is achieved. The possible variations of QAM are
numerous.
Page 9 of 21
The 4-QAM and 8-QAM constellations
Time domain for an 8-QAM signal
Bandwidth for QAM
The minimum bandwidth required for QAM transmission is the same as that required for ASK and
PSK transmission. QAM has the same advantages as PSK over ASK.
Analog data, digital signals
Analog-to-Digital conversion is a process of converting analog data into digital data, known as
digitization.
Pulse Code Modulation (PCM)
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.
Sampling
The first step in PCM is sampling. The analog signal is sampled every T s sec, where Ts is the sample
interval or period. The inverse of the sampling interval is called the sampling rate or sampling frequency
(f=1/Ts). According to the Nyquist theorem, the sampling rate must be at least 2 times the highest frequency.
Page 10 of 21
The sampling process is referred to as pulse amplitude modulation (PAM). We need to remember, however,
that the result is still an analog signal with nonintegral values.
Quantization
The result of sampling is a series of pulses with amplitude values between the maximum and
minimum amplitudes of the signal. The set of amplitudes can be infinite with nonintegral values between the
two limits. These values cannot be used in the encoding process. The following are the steps in quantization:
1. We assume that the original analog signal has instantaneous amplitudes between
Vmin and Vmax.
2. We divide the range into L zones, each of height, Δ(delta).
3. We assign quantized values of 0 to L - I to the midpoint of each zone.
4. We approximate the value of the sample amplitude to the quantized values.
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 an llb-bit code word.
Quantizing by using sign and magnitude
Page 11 of 21
PCM
From analog signal to PCM digital code
Delta Modulation (DM)
PCM is a very complex technique. Other techniques have been developed to reduce the complexity
of PCM. The simplest is delta modulation. PCM finds the value of the signal amplitude for each sample;
DM finds the change from the previous sample. Following figure shows the process. Note that there are no
code words here; bits are sent one after another.
Modulator
The modulator is used at the sender site to create a stream of bits from an analog signal.
The process records the small positive or negative changes, called delta O. If the delta is positive, the
process records a I; if it is negative, the process records a O. However, the process needs a base against
which the analog signal is compared. The modulator builds a second signal that resembles a staircase.
Finding the change is then reduced to comparing the input signal with the gradually made staircase signal.
Page 12 of 21
Demodulator
The demodulator takes the digital data and, using the staircase maker and the delay unit, creates the
analog signal. The created analog signal, however, needs to pass through a low-pass filter for smoothing.
Analog data, analog signals
Analog-to-analog conversion, or analog modulation, is the representation of analog information by
an analog signal. Modulation is needed if the medium is bandpass in nature or if only a bandpass channel is
available to us. An example is radio. Analog-to-analog conversion can be accomplished in three ways:
amplitude modulation (AM), frequency modulation (FM), and phase modulation (PM). FM and PM are
usually categorized together.
Amplitude Modulation
In AM transmission, the carrier signal is modulated so that its amplitude varies with the changing
amplitudes of the modulating signal. The frequency and phase of the carrier remain the same; only the
amplitude changes to follow variations in the information. The modulating signal is the envelope of the
carrier. AM is normally implemented by using a simple multiplier because the amplitude of the carrier
signal needs to be changed according to the amplitude of the modulating signal.
AM Bandwidth
Bandwidth Allocation for AM Radio
The bandwidth of an audio signal (speech and music) is usually 5 kHz. Therefore, an AM radio
station needs a bandwidth of 10 kHz. In fact, the Federal Communications Commission (FCC) allows 10
kHz for each AM station. AM stations are allowed carrier frequencies anywhere between 530 and 1700 kHz.
Page 13 of 21
However, each station's carrier frequency must be separated from those on either side of it by at least 10 kHz
(one AM bandwidth) to avoid interference.
Frequency Modulation
In FM transmission, the frequency of the carrier signal is modulated to follow the changing voltage
level (amplitude) of the modulating signal. The peak amplitude and phase of the carrier signal remain
constant, but as the amplitude of the information signal changes, the frequency of the carrier changes
correspondingly.
FM Bandwidth
FM band allocation
The bandwidth of a stereo audio signal is usually 15 KHz. Therefore, an FM station needs at least a
bandwidth of 150 KHz. The FCC requires the minimum bandwidth to be at least 200 KHz (0.2 MHz). FM
stations are allowed carrier frequencies anywhere between 88 and 108 MHz. Stations must be separated by
at least 200 kHz to keep their bandwidths from overlapping and to create privacy.
Page 14 of 21
Phase Modulation
In PM transmission, the phase of the carrier signal is modulated to follow the changing voltage level
(amplitude) of the modulating signal. The peak amplitude and frequency of the carrier signal remain
constant, but as the amplitude of the information signal changes, the phase of the carrier changes
correspondingly. PM can be used as an alternative to FM, due to lower hardware requirements. PM is the
same as FM with one difference. In FM, the instantaneous change in the carrier frequency is proportional to
the amplitude of the modulating signal; in PM the instantaneous change in the carrier frequency is
proportional to the derivative of the amplitude of the modulating signal.
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 two subclasses of serial transmission:
asynchronous and synchronous.
Parallel Transmission
Binary data, consisting of 1s and 0s, may be organized into groups of n bits each. Parallel
transmission use 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 advantage of parallel
transmission is speed. But there is a significant disadvantage: cost. Because this is expensive and parallel
transmission is usually limited to short distances.
Page 15 of 21
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. The advantage of serial over parallel
transmission is that it 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).
Asynchronous Transmission
Asynchronous transmission is so named because the timing of a signal is unimportant. Instead,
information is received and translated by agreed upon patterns. 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. The start and stop bits and the gap alert the receiver to the beginning and end of each
byte and allow it to synchronize with the data stream. This mechanism is called asynchronous because, 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. When the receiver detects a start bit, it sets a timer
and begins counting bits as they come in. After n bits, the receiver looks for a stop bit. As soon as it detects
the stop bit, it waits until it detects the next start bit.
Synchronous Transmission
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. The receiver counts the bits as they arrive and groups them in
8-bit units. Timing becomes very important, because the accuracy of the received information is completely
dependent on the ability of the receiving device to keep an accurate count of the bits as they come in.
The advantage of synchronous transmission is it is faster than asynchronous transmission. For this
reason, it is more useful for high-speed applications such as the transmission of data from one computer to
another. Byte synchronization is accomplished in the data link layer.
Page 16 of 21
Line configurations (for data link)
Topology
The topology of a data link refers to the physical arrangement of stations on a transmission medium.
If there are only two stations, (e.g., a terminal and a computer or two computers), the link is point-
to-point.
If there are more than two stations, then it is a multipoint topology. Traditionally, a multipoint link
has been used in the case of a centralized computer (server) and a set of terminals (nodes) . In today's
environments, the multipoint topology is found in local area networks.
If each terminal has a point-to-point link to its computer, then the computer must have one I/O port
for each terminal. Also, there is a separate transmission line from the computer to each terminal. In a
multipoint configuration, the computer needs only a single I/O port, thereby saving hardware costs. Only a
single transmission line is needed, which also saves costs.
Full-duplex or Half-duplex
Data exchanges over a transmission line can be classified as full-duplex or half-duplex. With
half-duplex transmission, only one of two stations on a point-to-point link may transmit at a time. For
full-duplex transmission, two stations can simultaneously send and receive data from each other. Thus, this
mode is known as two-way simultaneous. For computer-to-computer data exchange, this form of
transmission is more efficient than half-duplex transmission.
Interfacing
Most digital data-processing devices have limited distance across which they can transmit data. But,
it is rare for such a device (terminal, computer) to attach directly to a transmission or networking facility.
The more common situation is depicted in the following figure.
Page 17 of 21
The devices we are discussing, which include terminals and computers, are generically referred to
as data terminal equipment (DTE). A DTE makes use of the transmission system through the mediation of
data circuit-terminating equipment (DCE). An example of the latter is a modem.
On one side, the DCE is responsible for transmitting and receiving bits, one at a time, over a
transmission medium or network. On the other side, the DCE must interact with the DTE. The two DCEs
that exchange signals over the transmission line or network must understand each other. That is, the
receiver of each must use the same encoding scheme (e.g., Manchester, PSK) and data rate as the
transmitter of the other. In addition, each DTE-DCE pair must be designed to interact cooperatively.
Standards have been developed to specify the nature of interface between DTE and DCE with four
important characteristics:
1. Mechanical
- Actual physical connection
- Matching male/female connectors
2. Electrical
- Determine data rates and distances possible
- Voltage level and timing of voltage change
- Both DTE and DCE must use the same code (such as NRZ-L)
- Voltage levels must mean the same thing
3. Functional
- Function performed by assigning meaning to interchange circuits
- Data, control, timing, electrical ground
4. Procedural
- Sequence of events for transmitting data
- Based on functional characteristics of interface
V.24/EIA-232-E
Most widely used interface, specified in ITU-T standard as V.24. The equivalent standard is EIA-
232-E and it is originally called the RS-232 standard. It is used to connect DTE to voice grade modems for
use on public telecom network.
Mechanical specification
The mechanical specification for EIA-232-E is illustrated in the following figure. It ia a 25-pin
connector, defined in IS0 2110, with a specific arrangement of leads. This connector is the terminating
plug or socket on a cable running from a DTE (e.g., terminal) or DCE (e.g., modem). Thus, in theory, a 25-
wire cable could be used to connect the DTE to the DCE. In practice, fewer interchange circuits are used in
most applications.
Page 18 of 21
Pin assignments for V.241EIA-232
Electrical Specification
-Defines signaling between DCE and DTE
-Digital signaling on all interchange circuits
-Electrical values interpreted as binary data or control based on function
Voltage less than -3 volts is binary 1
Voltage more than +3 volts is binary 0
-Uses NRZ-L encoding
-Same voltage level for control signals
Voltage less than -3 volts is OFF
Voltage more than +3 volts is ON
Functional specification
The circuits can be grouped into the categories of data, control, timing, and ground. There is one
data circuit in each direction, so full-duplex operation is possible. In addition, there are two secondary data
circuits that are useful when the device operates in a half-duplex fashion. There are fifteen control circuits
for synchronous and asynchronous transmissions. The Data Signal Rate Selector circuits are used to change
speeds; either the DTE or DCE may initiate the change.
The last group of control signals relate to loopback testing. These circuits allow the DTE to
cause the DCE to perform a loopback test. In the local loopback function, the transmitter output of the
modem is connected to the receiver input, disconnecting the modem from the trans-
mission line. A stream of data generated by the user device is sent to the modem and looped back to the
user device. For remote loopback, the local modem is connected to the transmission facility in the usual
fashion, and the receiver output of the remote modem is connected to the modem's transmitter input.
During either form of test, the DCE turns ON the Test Mode circuit.
Page 19 of 21
The timing signals provide clock pulses for synchronous transmission. Finally, the signal
ground/common return serves as the return circuit for all data leads.
Procedural Specification
The procedural specification defines the sequence in which the various circuits are used for a
particular application.
Example: A dial-up operation
Page 20 of 21
NULL Modem
In certain situations the distances between devices are so close as to allow two DTEs to directly
signal each other. In this case, the V.24/EIA-232 interface can still be used, but no DCE equipment is
provided. For this, a null modem is needed, which interconnects leads in such a way as to fool both
DTEs into thinking that they are connected to modems.
Example of a null modem
Page 21 of 21