8/2/2019 Line Coding and Its Spectral Densities New
1/17
Eeng 360 1
Line Codes and Their Spectra
Types of Line Codes
Comparison of Line Codes
PSD of Line Codes
8/2/2019 Line Coding and Its Spectral Densities New
2/17
Eeng 360 2
Line Codes in PCMLine Codes in PCM
The output of an ADC can be transmitted over aThe output of an ADC can be transmitted over abaseband channelbaseband channel..
The digital information must first be converted into a physical signal.The digital information must first be converted into a physical signal.
TheThephysical signal is called aphysical signal is called a line codeline code. Line coders use the terminology. Line coders use the terminology markmark
to mean binary one andto mean binary one andspacespace to mean binary zero.to mean binary zero.
ADC
PCM signal
Sample
Quantize
Analog
Input
Signal
Encode
Line
Code
X
XQ
Xk
x(t)
8/2/2019 Line Coding and Its Spectral Densities New
3/17
EEE 360 3
(a) Punched Tape
A
-A0(c) Polar NRZ
A
0(d) Unipolar RZ
A
-A0(e) Bipolar RZ
BINARY DATA1 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
VoltsA
Time
0(b) Unipolar NRZTb
Line codes
8/2/2019 Line Coding and Its Spectral Densities New
4/17
Eeng 360 4
Goals of Line CodingGoals of Line Coding
A line code is designed to meet several goals:A line code is designed to meet several goals:
SelfSelf--synchronization.synchronization. The ability toThe ability to recover timingrecover timing from the signal itself.from the signal itself.
Long series of ones and zeros could cause a problem.Long series of ones and zeros could cause a problem.
Low probability of bit error.Low probability of bit error. The receiver needs to be able to distinguish the waveform associatedThe receiver needs to be able to distinguish the waveform associated
with a markfrom the waveform associated with a space, even if therewith a markfrom the waveform associated with a space, even if thereis ais a considerable amount of noise and distortion in the channelconsiderable amount of noise and distortion in the channel..
Spectrum that is suitable for the channel.Spectrum that is suitable for the channel. In some casesIn some cases DC componentsDC components should be avoided if the channel has ashould be avoided if the channel has a
DC blocking capacitance.DC blocking capacitance.
The transmissionThe transmissionbandwidthbandwidth should be minimized.should be minimized.
8/2/2019 Line Coding and Its Spectral Densities New
5/17
Eeng 360 5
Line CoderLine Coder
The input to the line encoder is a sequence of values aThe input to the line encoder is a sequence of values akk that isthat is
a function of a data bit or an ADC output bit.a function of a data bit or an ADC output bit.
The output of the line encoder is a waveform:The output of the line encoder is a waveform:
WhereWhere pp((tt) is the) is the Pulse ShapePulse Shape andand TTbb is theis the BitPeriodBitPeriod
RRbb =1/=1/TTbb
The operational details of this function are set by the particularThe operational details of this function are set by the particular
type oftype ofline codeline code that is being used.that is being used.
( ) ( )k bk
x t a p t kTg
!g
!
Line Coder
ka
Digital
Data
Physical
Waveform
( ) ( )k bk
x t a p t kTg
!g
!
8/2/2019 Line Coding and Its Spectral Densities New
6/17
Eeng 360 6
Types of Line CodesTypes of Line Codes
Each line code is described by aEach line code is described by asymbol mapping functionsymbol mapping function aakk
and aand apulse shapepulse shape pp((tt):):
Categories of line codes:Categories of line codes: Symbol mapping functions (Symbol mapping functions (aakk).).
UnipolarUnipolar
PolarPolar
Bipolar(a.k.a. alternate markinversion, pseudoternary)Bipolar(a.k.a. alternate markinversion, pseudoternary)
Pulse shapesPulse shapes pp((tt).).
NRZ (NonreturnNRZ (Nonreturn--toto--zero)zero)
RZ (Return to Zero)RZ (Return to Zero)
Manchester(split phase)Manchester(split phase)
( ) ( )k bk
x t a p t kTg
!g
!
8/2/2019 Line Coding and Its Spectral Densities New
7/17
Eeng 360 7
Unipolar NRZ Line CodeUnipolar NRZ Line Code
TheThe unipolar nonreturnunipolar nonreturn--toto--zerozero line code is defined by theline code is defined by the
unipolar mapping:unipolar mapping:
where Xwhere Xkk is the kis the kthth data bit.data bit.
In addition, the pulse shape for unipolar NRZ is:In addition, the pulse shape for unipolar NRZ is:
Where TWhere Tbb is theis the bit periodbit period..
!
!
!
0when
1when
0
k
k
kX
XAa
( ) NRZ pulse shapeb
tp t
T
! 4
1 1110 0
bT bT2 bT3 bT40 bT5
A
Note the DC component
This means wasted power!
Hard to recover symbol timing
when long string of 0s or 1s.
8/2/2019 Line Coding and Its Spectral Densities New
8/17
Eeng 360 8
Unipolar RZ Line CodeUnipolar RZ Line Code
TheThe unipolar returnunipolar return--toto--zerozero line code has the same symbolline code has the same symbol
mapping but a different pulse shape than unipolar NRZ:mapping but a different pulse shape than unipolar NRZ:
!
!!
0when
1when
0
k
k
kX
XAa
( ) RZ pulse shape/ 2
b
tp t
T
! 4
1 1110 0
bT bT2 bT3 bT40 bT5
A
Long strings of 1s no longer a problem.
However strings of 0s still problem.Pulse of half the duration ofNRZ
requires twice the bandwidth!
8/2/2019 Line Coding and Its Spectral Densities New
9/17
Eeng 360 9
Polar Line CodesPolar Line Codes
Polar line codes use the antipodal mapping:Polar line codes use the antipodal mapping:
Polar NRZ uses NRZ pulse shape.Polar NRZ uses NRZ pulse shape.
Polar RZ uses RZ pulse shape.Polar RZ uses RZ pulse shape.
!
!
!
0when
1when
k
k
kX
X
A
Aa
1 1110 0A
A
A
Polar NRZ
Polar RZ
No DC component,
so more energy efficient.
Now we can handle
long strings of 0s, too.
8/2/2019 Line Coding and Its Spectral Densities New
10/17
Eeng 360 10
Manchester Line CodesManchester Line Codes
Manchester line codesManchester line codes use the antipodal mapping anduse the antipodal mapping and
the followingthe followingsplitsplit--phasephasepulse shape:pulse shape:
/ 4 / 4( )
/ 2 / 2
b b
b b
t T t Tp t
T T
! 4 4
)(tp
1 111 0
A
0
Easy synchronization and better spectral characteristics than polarRZ.
8/2/2019 Line Coding and Its Spectral Densities New
11/17
Eeng 360 11
Bipolar Line CodesBipolar Line Codes
WithWith bipolar line codesbipolar line codes a space is mapped to zero and a marka space is mapped to zero and a mark
is alternately mapped tois alternately mapped to --A and +A:A and +A:
Also calledAlso calledpseudoternarypseudoternary signalling andsignalling and alternate markalternate markinversion (AMI)inversion (AMI)..
Either RZ or NRZ pulse shape can be used.Either RZ or NRZ pulse shape can be used.
A
Bipolar (RZ)
1 111 00
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
!
! ! p ! p
8/2/2019 Line Coding and Its Spectral Densities New
12/17
Eeng 360 12
Comparison of Line CodesComparison of Line Codes
SelfSelf--synchronization:synchronization:
Manchester codes have built in timing information becauseManchester codes have built in timing information becausethey always have a zero crossing in the center of the pulse.they always have a zero crossing in the center of the pulse.
Polar RZ codes tend to be good because the signal levelPolar RZ codes tend to be good because the signal levelalways goes to zero for the second half of the pulse.always goes to zero for the second half of the pulse.
NRZ signals are not good for selfNRZ signals are not good for self--synchronization.synchronization.
Error probability:Error probability:
Polar codes perform better(are more energy efficient) thanPolar codes perform better(are more energy efficient) thanUnipolar or Bipolar codes.Unipolar or Bipolar codes.
Channel characteristics:Channel characteristics:
We need to find the PSD of the line codes to answer this ...We need to find the PSD of the line codes to answer this ...
8/2/2019 Line Coding and Its Spectral Densities New
13/17
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
sj kfT
s
ks
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
g
!g
!
! !
!
bility of having the th productn n ka ai
PSD can be calculated using the autocorrelation function:
A digital signal is represented by
f(t) - Symbol Pulse shape; Ts - Duration of one symbol;
Binary signaling : Ts= Tb , Multilevel signaling: Ts= lTb
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 NRZn s
n s
ts t a f t nT f t
T
g
!g
! ! ! 4
8/2/2019 Line Coding and Its Spectral Densities New
14/17
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 nk ii
polar
bb b
kb s
kfTs
R a a P A A A
k R k a a P A A A A A A
A kR k
k
F ffTf t t T F f T f R k e
fT T
TT
T
!
!
g
!g
! ! !
{ ! ! !
! !
{
! 4 m ! !
2
2
Polar NRZ
sin( ) bb
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 nR k a a P a ka !
!
8/2/2019 Line Coding and Its Spectral Densities New
15/17
Eeng 360 15
PSD for line codes
Unipolar NRZ
Polar NRZ
22
Uni. NRZ
sin 1( ) 1 ( )
4
b b
b b
A T fT P f f
fT T
TH
T
!
-
2
2
Polar NRZsin( ) bb
b
fT P f A T fTT
T !
Bit rate: R=1/Tb
8/2/2019 Line Coding and Its Spectral Densities New
16/17
Eeng 360 16
PSD for line codesUnipolarRZ
BipolarRZ
ManchesterNRZ
Uni. R
2
Z
2
sin / 2 1( ) 1 ( )
16 / 2
b b
nb b b
A T fT n P f f
fT T T
TH
T
g
!g
!
-
Bipolar2
RZ
2
2sin( ) sin4
b bb
b
A T fT P f fT fTT T
T
!
Manch. NR
2
Z2 2sin / 2( ) sin / 2
/ 2
bb b
b
fT P f A T fT
fT
TT
T
!
Bit rate: R=1/Tb
8/2/2019 Line Coding and Its Spectral Densities New
17/17
Eeng 360 17
NRZ EncodingNRZ Encoding
There are other variations of NRZ encoding; which include:There are other variations of NRZ encoding; which include:NRZNRZ--LL: [Non: [Non--ReturnReturn--toto--ZeroZero--Level]: In NRZLevel]: In NRZ--L encoding, the polarity ofL encoding, the polarity ofthe signal changes only when the incoming signal changes from a one to athe signal changes only when the incoming signal changes from a one to azero or from a zero to a one. NRZzero or from a zero to a one. NRZ--L method looks just like the NRZL method looks just like the NRZmethod, except for the first input one data bit. This is because NRZ doesmethod, except for the first input one data bit. This is because NRZ doesnot consider the first data bit to be a polarity change, where NRZnot consider the first data bit to be a polarity change, where NRZ--L does.L does.NRZNRZ--MM [Non[Non--ReturnReturn--toto--ZeroZero--Mark(NRZMark(NRZ--M) Encoding]: The polarity ofM) Encoding]: The polarity ofthe signal changes when the incoming signal is a one. An incoming zerothe signal changes when the incoming signal is a one. An incoming zerowould not change the polarity of the signal.would not change the polarity of the signal.NRZNRZ--SS [Non[Non--ReturnReturn--toto--ZeroZero--Space (NRZSpace (NRZ--S) Encoding]: Works just likeS) Encoding]: Works just likeNRZNRZ--M, except the signal changes when the incoming data signal is a zero,M, except the signal changes when the incoming data signal is a zero,not when the signal is a one.not when the signal is a one.
NRZ
NRZ--
CC [Non[Non--ReturnReturn--toto--ZeroZero--Change Encoding]: Same as NRZChange Encoding]: Same as NRZ--L.L.NRZINRZI [Non[Non--ReturnReturn--toto--ZeroZero--Inverted Encoding]: A '0' is encoded as noInverted Encoding]: A '0' is encoded as nochange in the level. However a '1' is encoded depending on the current statechange in the level. However a '1' is encoded depending on the current stateof the line. If the current state is '0' [low] the '1' will be encoded as a high, ifof the line. If the current state is '0' [low] the '1' will be encoded as a high, ifthe current state is '1' [high] the '1' will be encoded as a low. Used withthe current state is '1' [high] the '1' will be encoded as a low. Used withFDDIFDDI andand USBUSB for example.for example.
Top Related