You are on page 1of 17

Eeng 360 1

Line Codes and Their Spectra


Types of Line Codes
Comparison of Line Codes
PSD of Line Codes
Eeng 360 2
Line Codes in PCM
The output of an ADC can be transmitted over a baseband channel.
The digital information must first be converted into a physical signal.
The physical signal is called a line code. Line coders use the terminology mark
to mean binary one and space to mean binary zero.

ADC
PCM signal
Sample
Quantize
Analog
Input
Signal
Encode
Line
Code
X
X
Q
X
k
x(t)

EEE 360 3
(a) Punched Tape
A
-A
0
(c) Polar NRZ
A
0
(d) Unipolar RZ
A
-A
0 (e) Bipolar RZ
BINARY DATA
1 1 0 1 0 0 1
Mark
(hole)
Mark
(hole)
Mark
(hole)
Mark
(hole)
space space space
A
-A
0 (f) Manchester NRZ
Binary Signaling Formats
Volts
A
Time

0
(b) Unipolar NRZ
T
b
Line codes
Eeng 360 4
Goals of Line Coding
A line code is designed to meet several goals:

Self-synchronization.
The ability to recover timing from the signal itself.
Long series of ones and zeros could cause a problem.

Low probability of bit error.
The receiver needs to be able to distinguish the waveform associated
with a mark from the waveform associated with a space, even if there
is a considerable amount of noise and distortion in the channel.

Spectrum that is suitable for the channel.
In some cases DC components should be avoided if the channel has a
DC blocking capacitance.
The transmission bandwidth should be minimized.

Eeng 360 5
Line Coder
The input to the line encoder is a sequence of values a
k
that is
a function of a data bit or an ADC output bit.
The output of the line encoder is a waveform:


Where p(t) is the Pulse Shape and T
b

is the Bit Period
R
b
=1/T
b

The operational details of this function are set by the particular
type of line code that is being used.
( ) ( )
k b
k
x t a p t kT

=
=

Line Coder
k
a
Digital
Data
Physical
Waveform
( ) ( )
k b
k
x t a p t kT

=
=

Eeng 360 6
Types of Line Codes
Each line code is described by a symbol mapping function a
k

and a pulse shape p(t):



Categories of line codes:
Symbol mapping functions (a
k
).
Unipolar
Polar
Bipolar (a.k.a. alternate mark inversion, pseudoternary)

Pulse shapes p(t).
NRZ (Nonreturn-to-zero)
RZ (Return to Zero)
Manchester (split phase)
( ) ( )
k b
k
x t a p t kT

=
=

Eeng 360 7
Unipolar NRZ Line Code
The unipolar nonreturn-to-zero line code is defined by the
unipolar mapping:


where X
k
is the k
th
data bit.
In addition, the pulse shape for unipolar NRZ is:


Where T
b
is the bit period.

=
= +
=
0 when
1 when
0

k
k
k
X
X A
a
( ) NRZ pulse shape
b
t
p t
T
| |
= H
|
\ .
1 1 1 1
0
0
b
T
b
T 2
b
T 3
b
T 4
0
b
T 5
A
Note the DC component
This means wasted power!
Hard to recover symbol timing
when long string of 0s or 1s.
Eeng 360 8
Unipolar RZ Line Code
The unipolar return-to-zero line code has the same symbol
mapping but a different pulse shape than unipolar NRZ:

=
= +
=
0 when
1 when
0

k
k
k
X
X A
a
( ) RZ pulse shape
/ 2
b
t
p t
T
| |
= H
|
\ .
1 1 1 1
0
0
b
T
b
T 2
b
T 3
b
T 4
0
b
T 5
A
Long strings of 1s no longer a problem.
However strings of 0s still problem.
Pulse of half the duration of NRZ
requires twice the bandwidth!
Eeng 360 9
Polar Line Codes
Polar line codes use the antipodal mapping:


Polar NRZ uses NRZ pulse shape.
Polar RZ uses RZ pulse shape.

=
=

+
=
0 when
1 when
k
k
k
X
X
A
A
a
1 1 1 1
0
0
A
A
A
Polar NRZ
Polar RZ
No DC component,
so more energy efficient.
Now we can handle
long strings of 0s, too.
Eeng 360 10
Manchester Line Codes
Manchester line codes use the antipodal mapping and
the following split-phase pulse shape:
/ 4 / 4
( )
/ 2 / 2
b b
b b
t T t T
p t
T T
| | | |
+
= H H
| |
\ . \ .
) (t p
1
1 1 1
0
A
0
Easy synchronization and better spectral characteristics than polar RZ.
Eeng 360 11
Bipolar Line Codes
With bipolar line codes a space is mapped to zero and a mark
is alternately mapped to -A and +A:



Also called pseudoternary signalling and alternate mark
inversion (AMI ).
Either RZ or NRZ pulse shape can be used.
A
Bipolar (RZ)
1
1 1 1
0
0
A
0 when 0
when 1 and last mark A
when 1 and last mark A
k
k k
k
X
a A X
A X
=

= = +

+ =

Eeng 360 12
Comparison of Line Codes
Self-synchronization:
Manchester codes have built in timing information because
they always have a zero crossing in the center of the pulse.
Polar RZ codes tend to be good because the signal level
always goes to zero for the second half of the pulse.
NRZ signals are not good for self-synchronization.

Error probability:
Polar codes perform better (are more energy efficient) than
Unipolar or Bipolar codes.

Channel characteristics:
We need to find the PSD of the line codes to answer this ...
Eeng 360 13
Power Spectra for Binary Line Codes

2
2
1
( )
( ) ( ) Where { ( )} ( )
( ) ( ) The autocorrelation function of
and are levels of the data pulses at the ' th and ( )'th symbol positions
Pro
data
ba
s
j kfT
s
k
s
I
n n k
k
i i
i
n n
i
F f
P f R k e f t F f
T
R k a a P
a a n n k
P
t

=
+
=
+
= =
=
+

bility of having the th product


n n k
a a i
+
PSD can be calculated using the autocorrelation function:
A digital signal is represented by

f(t) - Symbol Pulse shape; T
s
- Duration of one symbol;
Binary signaling : T
s
= T
b
, Multilevel signaling: T
s
= lT
b
PSD depends on:
(1) The pulse shape used
(2) Statistical properties of data expressed by the autocorrelation function
The PSD of a digital signal is given by:
( ) ( ) ; ( ) for unipolar NRZ
n s
n
s
t
s t a f t nT f t
T

=
| |
= = = H
|
\ .

Eeng 360 14
PSD for Polar NRZ Signaling
Possible levels for the as : +A and -A
( )
( )
( )
2
2 2 2
1
4
2 2
1
2
2
s
2
1 1
(0) ( ) ( )
2 2
For 0, ( ) ( ) 1/ 4 ( )( )1/ 4 ( )( )1/ 4 ( ) 1/ 4 0
, 0
( )
0, 0
sin
( ) ( / ) ( ) P

n n i i
i
n n k i
i
polar
b
b b
k
b s
kfT
s
R a a P A A A
k R k a a P A A A A A A
A k
R k
k
F f
fT
f t t T F f T f R k e
fT T
t t
t
=
+
=

=
= = + =
= = = + + + =
=
=

=

= H = =

2
2
Polar NRZ
sin
( )
b
b
b
fT
P f A T
fT
t
t
| |
=
|
\ .
1
and are the level of the pulses at the th and ( )th ( ) ( sy ) mbols
I
n n k i i n n k
i
n n R k a a P a k a
+ +
=
+ =

Eeng 360 15
PSD for line codes
Unipolar NRZ
Polar NRZ
2
2
Uni. NRZ
sin 1
( ) 1 ( )
4
b b
b b
A T fT
P f f
fT T
t
o
t
| | (
= +
| (
\ .
2
2
Polar NRZ
sin
( )
b
b
b
fT
P f A T
fT
t
t
| |
=
|
\ .
Bit rate: R=1/T
b
Eeng 360 16
PSD for line codes
Unipolar RZ
Bipolar RZ
Manchester
NRZ
Uni. R
2
Z
2
sin / 2 1
( ) 1 ( )
16 / 2
b b
n
b b b
A T fT n
P f f
fT T T
t
o
t

=
| | (
= +
| (
\ .

( )
Bipolar
2
RZ
2
2
sin
( ) sin
4
b b
b
b
A T fT
P f fT
fT
t
t
t
| |
=
|
\ .
( )
Manch. NR
2
Z
2 2
sin / 2
( ) sin / 2
/ 2
b
b b
b
fT
P f A T fT
fT
t
t
t
| |
=
|
\ .
Bit rate: R=1/T
b
Eeng 360 17
NRZ Encoding

There are other variations of NRZ encoding; which include:
NRZ-L: [Non-Return-to-Zero-Level]: In NRZ-L encoding, the polarity of
the signal changes only when the incoming signal changes from a one to a
zero or from a zero to a one. NRZ-L method looks just like the NRZ
method, except for the first input one data bit. This is because NRZ does
not consider the first data bit to be a polarity change, where NRZ-L does.
NRZ-M [Non-Return-to-Zero-Mark (NRZ-M) Encoding]: The polarity of
the signal changes when the incoming signal is a one. An incoming zero
would not change the polarity of the signal.
NRZ-S [Non-Return-to-Zero-Space (NRZ-S) Encoding]: Works just like
NRZ-M, except the signal changes when the incoming data signal is a zero,
not when the signal is a one.
NRZ-C [Non-Return-to-Zero-Change Encoding]: Same as NRZ-L.
NRZI [Non-Return-to-Zero-Inverted Encoding]: A '0' is encoded as no
change in the level. However a '1' is encoded depending on the current state
of the line. If the current state is '0' [low] the '1' will be encoded as a high, if
the current state is '1' [high] the '1' will be encoded as a low. Used with
FDDI and USB for example.

You might also like