Lecture 4b - Data Encoding
Lecture 4b - Data Encoding
Digital Transmission
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
4.1
4-1 DIGITAL-TO-DIGITAL CONVERSION
In this section, we see how we can represent digital data by using digital signals. The
conversion involves three techniques: line coding, block coding, and scrambling. Line coding
is always needed; block coding and scrambling may or may not be needed.
4.3
Figure 4.1 Line coding and decoding
4.4
Mapping Data symbols
onto Signal levels
A data symbol (or element) can consist
of a number of data bits:
1 , 0 or
11, 10, 01, ……
A data symbol can be coded into a
single signal element or multiple signal
elements
1 -> +V, 0 -> -V
1 -> +V and -V, 0 -> -V and +V
The ratio ‘r’ is the number of data
4.5
elements carried by a signal element.
Relationship between data
rate and signal rate
The data rate defines the number of bits
sent per sec - bps. It is often referred to
the bit rate.
The signal rate is the number of signal
elements sent in a second and is
measured in bauds. It is also referred to
as the modulation rate.
Goal is to increase the data rate whilst
reducing the baud rate.
4.6
Figure 4.2 Signal element versus data element
4.7
Data rate and Baud rate
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?
Solution
We assume that the average value of c is 1/2 . The baud rate is then
4.10
Noiseless Channel: Nyquist Bit Rate
For
Twoa noiseless channel,
theoretical the Nyquist
formulas bit rate formula
were developed defines thethe
to calculate theoretical maximum
data rate: one
bit rate
by Nyquist for a noiseless channel, another by Shannon for a noisy
Nyquist proved that if an arbitrary signal has been run through a low-pass filter of
channel.
bandwidth, the filtered signal can be completely reconstructed by making only
2*Bandwidth (exact) samples per second. Sampling the line faster than 2*Bandwidth
BitRate = 2 * Bandwidth * log2(L) bits/sec
times per second is pointless because the higher-frequency components that such
4.11
Noiseless Channel: Nyquist Bit Rate
Example
signal levels.
Input2 : We need to send 265 kbps over a noiseless channel with a bandwidth of 20 kHz. How
What can be the maximum bit rate?
many signal levels do we need?
Output1
log : BitRate
2(L) = 6.625 = 2 * 3000 * log2(2) = 6000bps
6.625
L=2 = 98.7 levels
The amount of thermal noise present is measured by the ratio of the signal power to the noise power, called the SNR
(Signal-to-Noise Ratio).
4.12
Noisy Channel : Shannon Capacity
•
In reality, we cannot have a noiseless channel; the channel is always noisy. Shannon capacity
is used, to determine the theoretical highest data rate for a noisy channel:
• In the above equation, bandwidth is the bandwidth of the channel, SNR is the signal-to-noise
ratio, and capacity is the capacity of the channel in bits per second.
• Bandwidth is a fixed quantity, so it cannot be changed. Hence, the channel capacity is
4.13
SIGNAL-TO-NOISE RATIO (S/N)
10 * log10(S/N)
as:
10 * log10(1000) = 30 dB.
4.14
Noisy Channel : Shannon Capacity
• This tells us the best capacities that real channels can have.
around 1 MHz.
• The SNR depends strongly on the distance of the home from the
• With these characteristics, the channel can never transmit much more
than 13Mbps, no matter how many or how few signals level are used
4.15
Capacity = bandwidth * log2(1 + SNR) bits/sec
Examples:
Input1 : A telephone line normally has a bandwidth of 3000 Hz (300 to 3300 Hz)
assigned for data communication. The SNR is usually 3162. What will be the
----------------------------------------------------------------------------
Input2 : The SNR is often given in decibels. Assume that SNR(dB) is 36 and the
The maximum data rate of a channel is Nmax = 2 × B × log2 L (defined by the Nyquist formula).
Does this agree with the previous formula for Nmax? ( L number of level)
Solution
A signal with L levels actually can carry log 2L bits per level. If each level corresponds to one signal
4.17
Considerations for choosing a
good signal element referred to
as line encoding
Baseline wandering - a receiver will
evaluate the average power of the
received signal (called the baseline) and
use that to determine the value of the
incoming data elements. If the incoming
signal does not vary over a long period
of time, the baseline will drift and thus
cause errors in detection of incoming
data elements.
A good line encoding scheme will
4.18
prevent long runs of fixed amplitude.
Line encoding C/Cs
DC components - when the voltage
level remains constant for long
periods of time, there is an
increase in the low frequencies of
the signal. Most channels are
bandpass and may not support the
low frequencies.
This will require the removal of the
dc component of a transmitted
4.19
Line encoding C/Cs
Self synchronization - the clocks at
the sender and the receiver must
have the same bit interval.
If the receiver clock is faster or
slower it will misinterpret the
incoming bit stream.
4.20
Figure 4.3 Effect of lack of synchronization
4.21
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
Solution
4.22
Line encoding C/Cs
Error detection - errors occur
during transmission due to line
impairments.
Some codes are constructed such
that when an error occurs it can be
detected. For example: a particular
signal transition is not part of the
code. When it occurs, the receiver
will know that a symbol error has
4.23
Line encoding C/Cs
Noise and interference - there are
line encoding techniques that
make the transmitted signal
“immune” to noise and
interference.
This means that the signal cannot
be corrupted, it is stronger than
error detection.
4.24
Line encoding C/Cs
Complexity - the more robust and
resilient the code, the more
complex it is to implement and the
price is often paid in baud rate or
required bandwidth.
4.25
Figure 4.4 Line coding schemes
4.26
TERMS
Modulation rate
Rate at which the signal level changes
Measured in baud = signal elements per second
Mark and Space
Binary 1 and Binary 0 respectively
Unipolar
All signal elements have same sign
Polar
One logic state represented by positive voltage the other by negative voltage
Data rate
Rate of data transmission in bits per second
Duration or length of a bit
Time taken for transmitter to emit the bit
4.27
Comparison of Encoding
Schemes (1)
Comparison of Encoding
Schemes (2)
Unipolar
All signal levels are on one side of the
time axis - either above or below
NRZ - Non Return to Zero scheme is an
example of this code. The signal level
does not return to zero during a symbol
transmission.
Scheme is prone to baseline wandering
and DC components. It has no
synchronization or any error detection.
It is simple but costly in power
consumption.
4.30
Figure 4.5 Unipolar NRZ scheme
4.31
Polar - NRZ
The voltages are on both sides of the
time axis.
Polar NRZ scheme can be implemented
with two voltages. E.g. +V for 1 and -V
for 0.
There are two versions:
NZR - Level (NRZ-L) - positive voltage for
one symbol and negative for the other
NRZ - Inversion (NRZ-I) - the change or lack
of change in polarity determines the value of
a symbol. E.g. a “1” symbol inverts the
polarity a “0” does not.
4.32
Figure 4.6 Polar NRZ-L and NRZ-I schemes
4.33
Note
In NRZ-L the level of the voltage determines the value of the bit.
4.34
Note
NRZ-L and NRZ-I both have an average signal rate of N/2 Bd.
4.35
Note
4.36
Example 4.4
A system is using NRZ-I to transfer 1-Mbps data. What are the average signal rate and minimum
bandwidth?
Solution
The average signal rate is S= c x N x R = 1/2 x N x 1 = 500 kbaud. The minimum bandwidth for
Note c = 1/2 for the avg. case as worst case is 1 and best case is 0
4.37
Polar - RZ
The Return to Zero (RZ) scheme uses
three voltage values. +, 0, -.
Each symbol has a transition in the
middle. Either from high to zero or from
low to zero.
This scheme has more signal transitions
(two per symbol) and therefore requires
a wider bandwidth.
No DC components or baseline
wandering.
Self synchronization - transition
indicates symbol value.
4.38
More complex as it uses three voltage
Figure 4.7 Polar RZ scheme
4.39
Biphase
Manchester
Transition in middle of each bit period
Transition serves as clock and data
Low to high represents one
High to low represents zero
Used by IEEE 802.3
Differential Manchester
Midbit transition is clocking only
Transition at start of a bit period represents zero
No transition at start of a bit period represents one
Note: this is a differential encoding scheme
Used by IEEE 802.5
Polar - Biphase: Manchester
and Differential Manchester
Manchester coding consists of
combining the NRZ-L and RZ schemes.
Every symbol has a level transition in the
middle: from high to low or low to high.
Uses only two voltage levels.
Differential Manchester coding consists
of combining the NRZ-I and RZ
schemes.
Every symbol has a level transition in the
middle. But the level at the beginning of the
symbol is determined by the symbol value.
One symbol causes a level change the other
4.41
does not.
Figure 4.8 Polar biphase: Manchester and differential Manchester schemes
4.42
Manchester Encoding
Differential Manchester
Encoding
Biphase Pros and Cons
Con
At least one transition per bit time and
possibly two
Maximum modulation rate is twice NRZ
Requires more bandwidth
Pros
Synchronization on mid bit transition (self
clocking)
No dc component
Error detection
Absence of expected transition
Modulation Rate
Scrambling
Note
4.48
Note
4.49
Multilevel Binary
Use more than two levels
Bipolar-AMI
zero represented by no line signal
one represented by positive or negative
pulse
one pulses alternate in polarity
No loss of sync if a long string of ones (zeros
still a problem)
No net dc component
Lower bandwidth
Easy error detection
Pseudoternary
Bipolar - AMI and
Pseudoternary
Code uses 3 voltage levels: - +, 0, -, to
represent the symbols (note not
transitions to zero as in RZ).
Voltage level for one symbol is at “0”
and the other alternates between + & -.
Bipolar Alternate Mark Inversion (AMI) -
the “0” symbol is represented by zero
voltage and the “1” symbol alternates
between +V and -V.
Pseudoternary is the reverse of AMI.
4.52
Figure 4.9 Bipolar schemes: AMI and pseudoternary
4.53
Bipolar-AMI and
Pseudoternary
Trade Off for Multilevel
Binary
Multilevel Schemes
In these schemes we increase the
number of data bits per symbol thereby
increasing the bit rate.
Since we are dealing with binary data
we only have 2 types of data element a
1 or a 0.
We can combine the 2 data elements
into a pattern of “m” elements to create
“2m” symbols.
If we have L signal levels, we can use
“n” signal elements to create Ln signal
4.56 elements.
Note
4.57
Representing Multilevel
Codes
We use the notation mBnL, where
m is the length of the binary
pattern, B represents binary data,
n represents the length of the
signal pattern and L the number of
levels.
L = B binary, L = T for 3 ternary, L
= Q for 4 quaternary.
4.58
Figure 4.10 Multilevel: 2B1Q scheme
4.59
Redundancy
In the 2B1Q scheme we have no
redundancy and we see that a DC
component is present.
If we use a code with redundancy we
can decide to use only “0” or “+”
weighted codes (more +’s than -’s in
the signal element) and invert any code
that would create a DC component. E.g.
‘+00++-’ -> ‘-00--+’
Receiver will know when it receives a
“-” weighted code that it should invert it
4.60
as it doesn’t represent any valid
Figure 4.11 Multilevel: 8B6T scheme
4.61
Multilevel using multiple
channels
In some cases, we split the signal
transmission up and distribute it over
several links.
The separate segments are transmitted
simultaneously. This reduces the
signalling rate per link -> lower
bandwidth.
This requires all bits for a code to be
stored.
xD: means that we use ‘x’ links
YYYz: We use ‘z’ levels of modulation
where YYY represents the type of
4.62 modulation (e.g. pulse ampl. mod. PAM).
Figure 4.12 Multilevel: 4D-PAM5 scheme
4.63
Multitransition Coding
Because of synchronization requirements we
force transitions. This can result in very high
bandwidth requirements -> more transitions
than are bits (e.g. mid bit transition with
inversion).
Codes can be created that are differential at
the bit level forcing transitions at bit
boundaries. This results in a bandwidth
requirement that is equivalent to the bit rate.
In some instances, the bandwidth requirement
may even be lower, due to repetitive patterns
resulting in a periodic signal.
4.64
Figure 4.13 Multitransition: MLT-3 scheme
4.65
MLT-3
Signal rate is same as NRZ-I
But because of the resulting bit
pattern, we have a periodic signal
for worst case bit pattern: 1111
This can be approximated as an
analog signal a frequency 1/4 the
bit rate!
4.66
Table 4.1 Summary of line coding schemes
4.67
Digital Data, Analog Signal
• Public telephone system
—300Hz to 3400Hz
—Use modem (modulator-demodulator)
• Amplitude shift keying (ASK)
• Frequency shift keying (FSK)
• Phase shift keying (PK)
Modulation Techniques
Amplitude Shift Keying
• Values represented by different
amplitudes of carrier
• Usually, one amplitude is zero
—i.e. presence and absence of carrier is used
• Susceptible to sudden gain changes
• Inefficient
• Up to 1200bps on voice grade lines
• Used over optical fiber
Binary Frequency Shift Keying
• Most common form is binary FSK (BFSK)
• Two binary values represented by two
different frequencies (near carrier)
• Less susceptible to error than ASK
• Up to 1200bps on voice grade lines
• High frequency radio
• Even higher frequency on LANs using co-
ax
Multiple FSK
• More than two frequencies used
• More bandwidth efficient
• More prone to error
• Each signalling element represents more
than one bit
FSK on Voice Grade Line
Phase Shift Keying
• Phase of carrier signal is shifted to
represent data
• Binary PSK
—Two phases represent two binary digits
• Differential PSK
—Phase shifted relative to previous transmission
rather than some reference signal
Differential PSK
Quadrature PSK
• More efficient use by each signal element
representing more than one bit
—e.g. shifts of /2 (90o)
—Each element represents two bits
—Can use 8 phase angles and have more than
one amplitude
—9600bps modem use 12 angles , four of which
have two amplitudes
• Offset QPSK (orthogonal QPSK)
—Delay in Q stream
QPSK and OQPSK Modulators
Examples of QPSF and OQPSK
Waveforms
Performance of Digital to Analog
Modulation Schemes
• Bandwidth
—ASK and PSK bandwidth directly related to bit
rate
—FSK bandwidth related to data rate for lower
frequencies, but to offset of modulated
frequency from carrier at high frequencies
—(See Stallings for math)
• In the presence of noise, bit error rate of
PSK and QPSK are about 3dB superior to
ASK and FSK
Quadrature Amplitude Modulation
• QAM used on asymmetric digital
subscriber line (ADSL) and some wireless
• Combination of ASK and PSK
• Logical extension of QPSK
• Send two different signals simultaneously
on same carrier frequency
—Use two copies of carrier, one shifted 90°
—Each carrier is ASK modulated
—Two independent signals over same medium
—Demodulate and combine for original binary
output
QAM Modulator
QAM Levels
• Two level ASK
—Each of two streams in one of two states
—Four state system
—Essentially QPSK
• Four level ASK
—Combined stream in one of 16 states
• 64 and 256 state systems have been
implemented
• Improved data rate for given bandwidth
—Increased potential error rate
Analog Data, Digital Signal
• Digitization
—Conversion of analog data into digital data
—Digital data can then be transmitted using
NRZ-L
—Digital data can then be transmitted using
code other than NRZ-L
—Digital data can then be converted to analog
signal
—Analog to digital conversion done using a
codec
—Pulse code modulation
—Delta modulation
Digitizing Analog Data
Pulse Code Modulation(PCM) (1)
• If a signal is sampled at regular intervals
at a rate higher than twice the highest
signal frequency, the samples contain all
the information of the original signal
—(Proof - Stallings appendix 4A)
• Voice data limited to below 4000Hz
• Require 8000 sample per second
• Analog samples (Pulse Amplitude
Modulation, PAM)
• Each sample assigned digital value
Pulse Code Modulation(PCM) (2)
• 4 bit system gives 16 levels
• Quantized
—Quantizing error or noise
—Approximations mean it is impossible to
recover original exactly
• 8 bit sample gives 256 levels
• Quality comparable with analog
transmission
• 8000 samples per second of 8 bits each
gives 64kbps
PCM Example
PCM Block Diagram
Nonlinear Encoding
• Quantization levels not evenly spaced
• Reduces overall signal distortion
• Can also be done by companding
Effect of Non-Linear Coding
Typical Companding Functions
Delta Modulation
• Analog input is approximated by a
staircase function
• Move up or down one level () at each
sample interval
• Binary behavior
—Function moves up or down at each sample
interval
Delta Modulation - example
Delta Modulation - Operation
Delta Modulation - Performance
• Good voice reproduction
—PCM - 128 levels (7 bit)
—Voice bandwidth 4khz
—Should be 8000 x 7 = 56kbps for PCM
• Data compression can improve on this
—e.g. Interframe coding techniques for video
Analog Data, Analog Signals
• Why modulate analog signals?
—Higher frequency can give more efficient
transmission
—Permits frequency division multiplexing
(chapter 8)
• Types of modulation
—Amplitude
—Frequency
—Phase
Analog
Modulation
4.98