Line Coding
Line Coding
DIGITAL-TO-DIGITAL
CONVERSION
Signals that represent data can be digital
or analog
We can represent digital data by using
digital signals using three techniques:
line coding
block coding
scrambling
LINE CODING
Line coding is the process of converting
digital data to digital signals.
Data is in the form of text, numbers,
graphical images, audio, or video, and 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
Data rate defines the number of data elements (bits) sent in 1s.
The unit is bits per second (bps). (bit rate)
The signal rate is the number of signal elements sent in 1s. The
unit is the baud. (Pulse rate, the modulation rate, or the baud
rate)
One goal in data communications is to increase the data rate while
decreasing the signal rate
We have a limited bandwidth in our transportation system
We now need to consider the relationship between data rate (N)
and signal rate (S), S = N/r
If we have a data pattern of all 1s or all 0s, the signal rate may be
different from a data pattern of alternating 0s and 1s.
Relationship between data rate and signal rate as
c is the case factor, which varies for each case; S is the number of
signal elements per second
Example 4.1
A signal is carrying data in which one data element
is encoded as one signal element (r = 1). If the bit
rate is 100 kbps, what is the average value of the
baud rate if c is between 0 and 1?
BANDWIDTH
Digital signal that carries information
is non-periodic
Bandwidth of a non-periodic signal is
continuous with an infinite range
Bandwidth is theoretically infinite, but
many of the components have such a
small amplitude that they can be
ignored and effective bandwidth is
finite
RELATIONSHIP BETWEEN
BANDWIDTH AND BAUD RATE
Baud rate, not the bit rate, determines the required
bandwidth for a digital signal
Number of vehicles, not the number of people being carried,
affects the traffic
The bandwidth reflects the range of frequencies we need
We need more information about the bandwidth than just its
value; we need a diagram of the bandwidth
Bandwidth (range of frequencies) is proportional to the signal
rate (baud rate). The minimum bandwidth can be given as
BASELINE WANDERING
In decoding a digital signal, the receiver
calculates a running average of the received
signal power. This average is called the baseline
The incoming signal power is evaluated against
this baseline to determine the value of the data
element
A long string of 0s or 1s can cause a drift in the
baseline (baseline wandering) and make it
difficult for the receiver to decode correctly
A good line coding scheme needs to prevent
baseline wandering
DC COMPONENTS
When the voltage level in a digital signal is constant for a
while, the spectrum creates very low frequencies
(results of Fourier analysis)
These frequencies are around zero, called DC (directcurrent) components, present problems for a system
that cannot pass low frequencies or a system that uses
electrical coupling (via a transformer)
We can say that DC component means 0/1 parity that can
cause base-line wondering. For example, a telephone line
cannot pass frequencies below 200 Hz
Also a long-distance link may use one or more transformers
to isolate different parts of the line electrically. For these
systems, we need a scheme with no DC component
SELF SYNCHRONIZATION
To correctly interpret the signals received from the sender, the
receivers bit intervals must correspond exactly to the
senders bit intervals. If the receiver clock is faster or slower,
the bit intervals are not matched and the receiver might
misinterpret the signals.
Figure 4.3 shows a situation in which the receiver has a
shorter bit duration. The sender sends 10110001, while the
receiver receives 110111000011.
A self-synchronizing digital signal includes timing
information in the data being transmitted
This can be achieved if there are transitions in the signal that
alert the receiver to the beginning, middle, or end of the pulse
If the receivers clock is out of synchronization, these points
can reset the clock
Example 4.3
In a digital transmission, the receiver clock is 0.1 percent
faster than the sender clock. How many extra bits per second
does the receiver receive if the data rate is 1 kbps? How many
if the data rate is 1 Mbps?
Solution
At 1 kbps, the receiver receives 1001 bps instead of 1000 bps.
Unipolar Scheme
In a unipolar scheme, all the signal levels are on one side of the time
axis, either above
or below.
NRZ (Non-Return-to-Zero)
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. Figure 4.5 shows a unipolar NRZ scheme.
Compared with its polar counterpart, this scheme is very costly.
Normalized power (the power needed to send 1 bit per unit line
resistance) is double that for polar NRZ. For this reason, this
scheme is normally not used in data communications today.
Polar Schemes
In polar schemes, the voltages are on both sides of the time axis.
For example, the voltage level for 0 can be positive and the voltage
level for 1 can be negative.
POLAR-NRZ
Two levels of voltage amplitude
Two versions of polar NRZ: NRZ-L and NRZ-I
In NRZ-L (NRZ-Level), the level of the
voltage determines the value of the bit
In 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
Problems in NRZ-polar
Baseline wandering is a problem for both variations, it is twice as severe
in NRZ-L.
If there is a long sequence of 0s or 1s in NRZ-L, the average signal power
becomes skewed
The receiver might have difficulty discerning the bit value. In NRZ-I this
problem occurs only for a long sequence of 0s
If we eliminate the long sequence of 0s, we can avoid baseline wandering
The synchronization problem (sender and receiver clocks are not
synchronized) also exists in both schemes. This problem is more serious in
NRZ-L than in NRZ-I
While a long sequence of 0s can cause a problem in both schemes, a long
sequence of 1s affects only NRZ-L.
Another problem with NRZ-L occurs when there is a sudden change of polarity
in the system. For example, if twisted-pair cable is the medium, a change in
the polarity of the wire results in all 0s interpreted as 1s and all 1s interpreted
as 0s. NRZ-I does not have this problem.
Both schemes have an average signal rate of N/2 Bd
BANDWIDTH
Figure 4.6 also shows the normalized bandwidth for both
variations
The vertical axis shows the power density (the power for each
1 Hz of bandwidth); the horizontal axis shows the frequency
The bandwidth reveals a very serious problem for this type of
encoding
The value of the power density is very high around frequencies
close to zero
This means that there are DC components that carry a high level
of energy
As a matter of fact, most of the energy is concentrated in
frequencies between 0 and N/2
This means that although the average of the signal rate is N/2, the
energy is not distributed evenly between the two halves
RETURN TO ZERO
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 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. In Figure 4.7
we see that the signal goes to 0 in the middle of each bit. It remains there until the
beginning of the next bit
The main disadvantage of RZ encoding is that it requires two signal changes to
encode a bit and therefore occupies greater bandwidth.
The same problem we mentioned, a sudden change of polarity resulting in all 0s
interpreted as 1s and all 1s interpreted as 0s, still exists here, but there is no DC
component problem
Another problem is the complexity: RZ uses three levels of voltage, which is
more complex to create and discern
As a result of all these deficiencies, the scheme is not used today. Instead, it has
been replaced by the better-performing Manchester and differential
Manchester schemes
Bipolar Schemes
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
ADVANTAGES OF BIPOLAR
The bipolar scheme was developed as an
alternative to NRZ. The bipolar scheme has the same
signal rate as NRZ, but there is no DC component
The NRZ scheme has most of its energy
concentrated near zero frequency, which makes
it unsuitable for transmission over channels with
poor performance around this frequency
The concentration of the energy in bipolar
encoding is around frequency N/2. Figure 4.9
shows the typical energy concentration for a bipolar
scheme.
ADVANTAGES OF BIPOLAR
Why we do not have a DC component in bipolar
encoding?
If we have a long sequence of 1s, the voltage level
alternates between positive and negative; it is not constant
Therefore, there is no DC component. For a long sequence
of 0s, the voltage remains constant, but its amplitude is
zero, which is the same as having no DC component. In
other words, a sequence that creates a constant zero
voltage does not have a DC component
AMI is commonly used for long-distance communication,
but it has a synchronization problem when a long sequence
of 0s is present in the data. Scrambling technique can
solve this problem
Multilevel Schemes
The desire to increase the data rate or decrease the required bandwidth has
resulted in the creation of many schemes
The goal is to increase the number of bits per baud by encoding a pattern of
m data elements into a pattern of n signal elements
We only have two types of data elements (0s and 1s), which means that a
group of m data elements can produce a combination of 2m data patterns.
We can have different types of signal elements by allowing different signal
levels
If we have L different levels, then we can produce Ln combinations of signal
patterns. If 2m = Ln, then each data pattern is encoded into one signal
pattern
If 2m < Ln, data patterns occupy only a subset of signal patterns
The subset can be carefully designed to prevent baseline wandering, to
provide synchronization, and to detect errors that occurred during data
transmission
Data encoding is not possible if 2m > Ln because some of the data patterns
cannot be encoded
2B1Q
First mBnL scheme, two binary, one quaternary (2B1Q), uses
data patterns of size 2 and encodes the 2-bit patterns as one
signal element belonging to a four-level signal
In this type of encoding m = 2, n = 1, and L = 4 (quaternary).
Figure 4.10 shows an example of a 2B1Q signal. The average
signal rate of 2B1Q is S = N/4
This means that using 2B1Q, we can send data 2 times faster than
by using NRZ-L.
However, 2B1Q uses four different signal levels, which means the
receiver has to discern four different thresholds
The reduced bandwidth comes with a price. There are no
redundant signal patterns in this scheme because 22 = 41.
The 2B1Q scheme is used in DSL (Digital Subscriber Line)
technology to provide a high-speed connection to the Internet by
using subscriber telephone lines