Line Coding
EE 442 – Spring Semester
Lecture 11
A line code is an assignment of a symbol or pulse to each zero
or one to be transmitted. Digital data is represented by
baseband data formats known as line codes.
Agbo & Sadiku
Section 5.7
pp. 255-256
In other words, what shape will the waveform take?
1
Preliminary: Bit Rate vs. Symbol Rate (or Baud Rate)
The speed of data is commonly expressed in bits/second or bytes/second.
The data rate Rb is related to the bit period Tb (duration of a bit).
Rb = 1/Tb
The bit rate is commonly referred to as the channel capacity.
Communication systems use symbols to convey information.
A symbol may be one bit per symbol (called binary), or a group of bits, or
a collection of defined voltage levels (multiple level symbols), etc.
The symbol rate RSybl is related to the symbol’s period (or duration) TS by
RSybl = 1/TS
The symbol rate is also called Baud rate. Bit rate Rb can be written as
Rb = Rsybl log2( ) = Rsybl n
where = 2n = number of levels (for n bits per symbol).
2
Signal-to-Noise Ratio vs. Energy/Bit-to-Noise Ratio
In analog and digital communications, signal-to-noise ratio, usually written S/N
or SNR, is a measure of signal strength relative to background noise strength.
The ratio is usually expressed in decibels (dB) and equals 10log10[S/N].
Another metric that is often more useful in digital systems is the energy per
bit-to-noise power ratio, denoted by Eb/N0.
Define: Rb = bit rate (in bits per second)
S = total signal power (watts)
Eb = energy per bit (in joules/bit)
N = total noise power (over entire bandwidth B in Hz)
N0 = noise spectral density (N = N0B where B = bandwidth)
Then,
S Eb S Rb Eb
Eb and and SNR
Rb N Rb N N0B
Increasing the data rate Rb increases the SNR. However, in general it also
increases the noise in the denominator, which lowers the SNR.
3
Signal-to-Noise Ratio vs. Energy/Bit-to-Noise Ratio (continued)
In digital communications systems the Eb/N0 ratio can be thought of as
a “normalized signal-to-noise ratio. “
We can roughly equate signal power to energy per bit by
Eb = PsignalTS , where TS is the symbol period,
and the noise power per hertz, denoted by N0 , is the total noise power N
divided by bandwidth B.
Eb/N0 is commonly used to as the primary variable in establishing the
bit error rate for all modulation schemes.
4
Categories of Line Coding – Overview
Line Coding
Multi-
Uni-Polar Polar Bipolar Multi-level transition
We primarily focus upon these in EE442
A line code is a specific code (with precisely defined parameters) used
for transmitting a digital signal over a channel. Line coding is used in
digital data transport – the pattern of voltage, current or photons used
to represent digital data on a transmission link is called line encoding.
5
Unipolar – RZ and NRZ (aka “On-Off Keying”)
Unipolar RZ and NRZ both have a DC component.
RZ NRZ
A
0
1 0 1 1 0 1 0
Symbol
Period
TS State “1” Pulse of amplitude +A
(Tb = TS /2) State “0” No pulse
ADVANTAGES DISADVANTAGES
1. Simplicity 1. Presence of DC level
2. Doesn’t require a lot 2. Contains low-frequency
of bandwidth components (leads to drooping)
3. No clocking component to
synchronize to at receiver
4. Long string of zeros causes loss
of synchronization
6
Unipolar NRZ Signal Droop Problem
0
A/2
-A/2
Signal droop distortion is due to AC coupling
7
Polar – RZ and NRZ
Polar RZ takes twice as much bandwidth as polar NRZ.
RZ NRZ
A
0
1 0 1 1 0 1 0
-A
Symbol
Period State “1” Pulse of amplitude +A
TS
(Tb = TS /2)
State “0” Pulse of amplitude -A
ADVANTAGES DISADVANTAGES
1. Simplicity 1. Can contain low-frequency
2. No DC component components (leads to signal
drooping)
2. No clocking component to
synchronize to at receiver
3. No error correction capability
8
Power Spectral Density Example: Polar NRZ Signal
Polar NRZ
Tb t
Rb = 1/Tb
Sinc squared
function
There is no DC component.
http://www.ni.com/white-paper/14766/en/
9
Bipolar NRZ
Uses three levels of signal level (+A, 0, -A)
and has “Alternate Mark Inversion” (AMI)
NRZ
A
0
1 0 1 1 0 1 0
-A Symbol
Period
TS State “1” Alternating levels of +A and -A
State “0” No pulse
ADVANTAGES DISADVANTAGES
1. No DC component 1. No clocking component to
2. Less bandwidth than synchronize to at receiver
for unipolar & polar 2. Limited error correction
NRZ capability
3. No signal droop
problem
10
Bipolar RZ
Uses three levels of signal level (+A, 0, -A)
Has “Alternate Mark Inversion” – AMI
RZ
A
0
1 0 1 1 0 1 0
-A Symbol
Period
TS State “1” Alternating levels of +A and -A
(Tb = TS /2)
State “0” No pulse
ADVANTAGES DISADVANTAGES
1. No DC component 1. No clocking component to
2. No signal droop synchronize to at receiver
problem 2. Limited error correction
capability
11
Manchester (Bi-Phase or Split-Phase) Encoding
The duration of a symbol is
divided into two halves. There is a transition at the center of
RZ every symbol period.
A
0
-A TS
1 0 1 1 0 1 0
State “1” +A in 1st half of TS and –A in 2nd half
State “0” -A in 1st half of TS and +A in 2nd half
ADVANTAGES DISADVANTAGES
1. No DC component 1. Greater bandwidth required
2. No signal droop for this waveform
problem 2. No error correction capability
3. Easy to synchronize to
the waveform
12
Manchester (Bi-Phase or Split-Phase) Encoding
• Manchester encoding is a form of binary phase-shift keying (BPSK).
• It is designed to encode both the clock and the data in a bit stream.
• This is also referred to “self-synchronizing data steam.”
• Manchester encoding has the disadvantage of requiring higher frequencies.
• It is used in Ethernet (IEEE 802.3 standard) with lower data rates.
• Also used for consumer IR protocols and in some RFID systems.
13
Differential Manchester (Bi-Phase) Encoding
Manchester 0 1 0 0 1 1
(or Bi-Phase) 0 is
t
1 is
Differential 0 1 0 0 1 1 Transition always is
in middle of period of
Manchester symbol period
t 1 → Forces transition
at beginning
0 → Do nothing
14
Polar Quaternary NRZ (2B1Q)
3A/2 10 11 01 00 10 01 11
A/2
0
-A/2 Symbol
Period
TS
No DC component.
-3A/2
State “00” Voltage level at -3A/2
State “01” Voltage level at -A/2
State “10” Voltage level at +A/2
State “11” Voltage level at +3A/2
Also referred to as mBnL coding, where m is the length of the binary pattern,
and n is the number of levels (L = B for binary (n = 2), L = T for ternary (n = 3)
and L = Q for quaternary (n = 4). Hence, polar quaternary would be 2B1Q.
Used in ISDN networks and in HDSL digital subscriber lines.
Integrated Services Digital Network (ISDN) is a set of communication standards for simultaneous digital transmission of
voice, video, data, and other network services over the traditional circuits of the public switched telephone network.
15
Bandwidth Efficiency
16
What Are the Primary Considerations When Comparing Line Codes?
1. We want the transmission bandwidths to be as small as possible.
1. Power efficiency – Keep power as low as possible.
2. Error detection and correction capability – error correcting codes are
a special topic
4. Favorable Power Spectral Density – We want zero power at DC ( f = 0 )
to avoid baseline drift.
5. Adequate timing content – Often we must extract the timing or clock
information from the signal.
6. Transparency – This means for every possible sequence of data the
coded signal is received faithfully.
7. Signal is easily regenerated by repeaters.
17
Review: Signal Energy and Power
Review: The energy and power associated with signal g(t) are defined:
For a real signal g(t) the signal energy Eg is defined to be
Eg
g 2 (t )dt
For a complex signal g(t) the signal energy Eg is defined to be
2
Eg
g(t ) dt
The signal power is more useful. For a real or complex signal g(t) the
signal power Pg is defined to be
T
1 2 2
Pg lim g(t ) dt
T T
T 2
The signal power Pg is the time average (mean) of the signal amplitude
squared (sometimes called the “mean-square” value of g(t)).
18
Concept of Power Spectral Density
Suppose we have signal gT(t) with Fourier transform GT(f). The subscript
T indicates a signal of finite duration.
1
df
2
Power of g(t ) = Pg lim
T T
GT ( f )
Then the power spectral density (PSD) is defined as
2
GT ( f )
Sg ( f ) lim
T T
The power is the area under a PSD. PSD is a positive, real and even
function of frequency f. Example: If g(t) is a voltage signal, then the
units of the PSD are volts-squared per hertz (V2/Hz).
The power spectral density function (PSD) gives the strength of the
variations (energy) of gT(t) as a function of frequency f.
19
Example: Power Spectral Density of Human Speech
Spectrum of a voice signal over a 15 second duration:
PSD
Frequency from 0 Hz to 4,000 Hz
Voltage: waveform of speech
Time Domain Frequency Domain
20
Power Spectral Density of NRZ and Polar NRZ Waveforms
Binary data
DC term
NRZ
PSD (W/Hz)
(W/Hz)
BTb
PSD
Binary data
Polar NRZ
After L. W. Couch, 8th ed., Digital and Analog Communication Systems; p.170.
21
Power Spectral Density of Unipolar RZ, Bipolar RZ & Manchester Waveforms
DC + spectral content
Unipolar RZ
PSD (W/Hz)
BTb
Binary data
Bipolar RZ
DC
null
Manchester
After L. W. Couch, 8th ed., Digital and Analog Communication Systems; p.170.
22
Comparing Power Spectral Densities for Polar, Bipolar and Manchester
1
Bipolar RZ Rb
Tb
(also known as Manchester)
Polar NRZ
23
Qualitative Comparison of Line Coding Schemes
Line Code Simple BW DC Error Clock Sync
component Correct ?
Unipolar Yes Low Yes No No
NRZ
Unipolar Yes 2 BW Yes No Yes
RZ
Polar Yes Moderate No No No
NRZ
Polar Yes 2 BW No No No
RZ
Bipolar NRZ Moderate Smaller BW No Single error No
(AMI) capability
Bipolar Moderate Smaller BW No Single error No
RZ capability
Manchester No Greater BW No No Yes
24
Comparing Line Coding Schemes
1. Unipolar NRZ and unipolar RZ are unipolar only need a single-sided power
supply to implement them. But polar NRZ, polar RZ, AMI and
Manchester require dual power supplies.
2. AMI receivers must detect three levels. All others need only detect two
levels.
3. Polar NRZ. polar RZ and Manchester delivers a pulse in every symbol
period. This is not true of unipolar NRZ, unipolar RZ, and AMI.
A long sequence of 0s can be mistaken as a transmission failure.
4. AMI has a built-in error detecting capability because any 0 is interpreted as
a 1, or a 1 is interpreted as a 0; it violates the rules for AMI coding scheme.
25
Interpreting Eye Diagrams
86100D Infiniium DCA-X Wide-Bandwidth Oscilloscope Mainframe
26
Oscilloscope with Memory for Displaying Multiple Traces
Display window of oscilloscope – trigger
PRBS (pseudo-random
sets the beginning of each trace or window bit stream) is generated
For testing BER.
Data stream of pulses
(a)
Project all frames onto display
27
Bit Error Rate (BER) Measurement
Number of bit errors
BER
Total number of bits transmitted
PRBS Bit Stream
4-QAM
PRBS = pseudo-random bit sequence
How many bits in the PRBS bit pattern stream?
The lowest BERmin to be measured should have a PRBS length equals
3 (1/BERmin). Example: For BERmin = 10-9, then length > 3 109 bits.
28
Eye Diagrams for Digital Signals
In telecommunication, an eye pattern, also known as an eye diagram,
is an oscilloscope display in which a digital signal from a receiver is
repetitively sampled and applied to the vertical input, while the data
rate is used to trigger the horizontal sweep.
spec spec
29
Example Eye Diagram
30
What is this Eye Diagram telling us?
Waveform 2
31
Bit Error Rates and Bit Error Ratios
In digital transmission, the number of bit errors is the number of received
bits of a data stream over a communication channel that have been altered
due to noise, interference, distortion or bit synchronization errors.
The bit error rate (BER) is the number of bit errors per unit time. The bit
error ratio (also BER) is the number of bit errors divided by the total number
of transferred bits during a studied time interval.
HDMI Testing
High-Definition Multimedia Interface
32
Intersymbol Interference (ISI)
ISI is unwanted interference from adjacent (usually previous) symbols
As transmitted As received
1 0 1 1
ISI is caused dispersion and other non-ideal transmission in channels
33
Quadrature Amplitude Modulation
16-QAM
BPSK
QPSK
34
Example: Bit Error Rates For M-ary Coding
35
Examples: Bit Error Rates in a Communication System
Probability of bit error rate log(Pb) vs. Eb/N0
Eb/N0 (dB)
http://www.gaussianwaves.com/2010/04/performance-comparison-of-digital-modulation-techniques-2/
36
Advantages of Digital Over Analog For Communications
1. Digital is more robust than analog to noise and interference†
2. Digital is more viable to using regenerative repeaters
3. Digital hardware more flexible by using microprocessors and VLSI
4. Can be coded to yield extremely low error rates with error correction
5. Easier to multiplex several digital signals than analog signals
6. Digital is more efficient in trading off SNR for bandwidth
7. Digital signals are easily encrypted for security purposes
8. Digital signal storage is easier, cheaper and more efficient
9. Reproduction of digital data is more reliable without deterioration
10. Cost is coming down in digital systems faster than in analog systems
and DSP algorithms are growing in power and flexibility
† Analog signals vary continuously and their value is affected by all levels of noise.
37