data encoding - kasetsart universitynguan/presentations/datacom/encoding.pdf · data encoding-2/28...
TRANSCRIPT
Data Encoding - 1/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
1/28
Data EncodingSurasak Sanguanpong
http://www.cpe.ku.ac.th/~nguanLast updated: 11 July 2000
Data Encoding - 2/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
2/28
Encoding scheme
voiceTelephone
analog
digitalModem
analog
analogCODEC
digital
digital Digitaltransmitter
digital
Analog data, Analog signal
Digital data, Analog signal Digital data, Digital signal
Analog data, Digital signal
Analog transmission means a transmitting analog signals without regard totheir content; the signal may represent analog data (e.g. voice) or digital data(e.g. binary data). Digital transmission is concerned with a transmitting binarysignal
Data Encoding - 3/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
3/28
Encoding and Modulation
EncoderEncoder DecoderDecoder
ModulatorModulator DemodulatorDemodulator
digitalor
analog
digitalor
analog
digital
analog
g(t)
m(t)
fc
s(f)
x(t)
t
ffc
g(t)
m(t)
x(t)
s(t)
For digital signal, a data source g(t), which may be either digital or analog, isencoded into a digital signal x(t).
Analog transmission uses a continuous constant-frequency signal known asthe carrier signal. The frequency of the carrier signal is chosen to becompatible with the transmission medium. Data is transmitted using a carriersignal by modulation, which is the process of encoding source data onto acarrier signal with frequency fc
Data Encoding - 4/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
4/28
Why encoding?
Three factors determine successfulness of receiving signalS/Ndata ratebandwidth
More factor can be used to improve
encoding scheme
With other factors held constant, the following statements are true.
• An increase in data rate increases bit error rate.
• An increase S/N decreases bit error rate.
• An increase in bandwidth allows an increase in data rate [Stalling, p98].
Data Encoding - 5/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
5/28
Encoding evaluation factors
Signal spectrum
Clocking
Error detection
Signal interference& noise immunity
Cost and complexity
Five factors are used to evaluate the various encoding scheme:
Signal spectrum : a lack of high-frequency components means that lessbandwidth is required for transmission. No dc component is desirable.
Clocking : suitable encoding provide some synchronization mechanism todetermine the beginning and end of each bit position.
Error detection : some error detection can be built into the encoding scheme.
Signal interference & noise immunity : some encoding scheme has superiorperformance in the presence of noise.
Cost and complexity : higher signaling rate to achieve a greater data rateresults expensive devices.
Data Encoding - 6/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
6/28
Digital data, Digital signal
0 1 0 0 1 1 0 0 0 1 1NRZ
NRZI
Bipolar -AMI
Pseudoternary
Manchester
DifferentialManchester
Definition of Digital Signal Encoding Formats
Nonreturn-to-Zero-Level (NRZ-L)0 = high level1 = low level l
Nonreturn to Zero Inverted (NRZI)0 = no transition at beginning of interval (one bit time)1 = transition at beginning of interval
Bipolar-AMI0 = no line signal1 = positive or negative level, alternating for successive ones
Pseudoternary0 = positive or negative level, alternating for successive zeroes1 = no line signal
Manchester0 = transition from high to low in middle of interval1 = transition from high to low in middle of interval
Differential ManchesterAlways a transition in middle of interval0 = no transition at beginning of interval1 = transition at beginning of interval
[Stallings, p99,100]
Data Encoding - 7/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
7/28
Scrambling techniques
1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0
0 0 0
0 0 0
V B 0 V B
V B 0 0 V B 0 0 V
Bit value
B8ZS
Bipolar-AMI
HDB3
To maintain synchronization for the receiver’s clock using bipolar.
B8ZS
Same as bipolar AMI, except that any string of eight zeros is replaced by astring with two code violations.
• If an octet of all zeros occur and the last voltage pulse preceding this octetwas positive, the eight zeros of the octet are encode as 00+-0-+
• If an octet of all zeros occur and the last voltage pulse preceding this Octwas positive, the eight zeros of the octet are encode as 00-+0+-
HD3B
Same as bipolar AMI, except that any string of four zeros is replaced by astring with one code violation. The scheme replace strings of four zeros withthe sequence B00V. [Stallings, p106]
Data Encoding - 8/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
8/28
Spectral density
-0.5
0
0.5
1
1.5
0 0.5 1 1.5
NRZ-L,NRZI
B8ZS,HDB3
AMI, Pseudoternary
Manchester,Differential Manchester
Mea
nsq
uar
evo
ltag
ep
eru
nit
ban
dw
idth
Normalized frequency (f/r)
NRZ make efficient use of bandwidth. most of the frequency in NRZ andNRZI signals are between dc and half the bit rate.
Manchester& Different Manchester has the bulk of the energy betweenone-half and one times the bit rate. Thus the bandwidth is reasonably narrowand contain no dc component.
AMI make use of bandwidth less than the bandwidth of NRZ [Stallings,p102].
Data Encoding - 9/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
9/28
Digital data, Analog signal
Transmitting digital data through PSTN
Modem is used to convert digital data to analogsignal and vice versa
The most familiar use is for transmitting digital data through the publictelephone network. The telephone network was designed to support analogsignals in the voice-frequency range 300-3400 Hz. It is not suitable forhandling digital signal. Modem is used to convert digital to analog signal andvice versa.
Data Encoding - 10/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
10/28
Modulation techniques
0 0 1 1 0 1 00 0 1 0
ASK
FSK
PSK
There are three basic modulation techniques for transforming digital data intoanalog signals:
Amplitude-shift keying (ASK)
Frequency-shift keying (FSK)
Phase-shift keying (PSK)
Data Encoding - 11/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
11/28
ASK
Vd(t)
Vc(t)
VASK(t)
fcfc-f0fc-3f0 fc+f0 fc+3f0
Signalpower
Frequency
frequency spectrum
In ASK, the amplitude of a single-frequency known as the carrier frequency isswitched between two levels at a rate determined by the bit rate of thetransmitted binary data signal. Bandpass filter is used to limit the band offrequencies based on Nyquist’s theorem. [Halsall, p.59]
Data Encoding - 12/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
12/28
FSK
Carrier 2
Datasignal
Carrier 1
vd(t)
v1(t)
v2(t)
vFSK(t)
f1
Signalpower
Frequency
frequency spectrum
f2
In FSK, two fixed amplitude carrier signals are used, one for a binary 0 andthe other for a binary 1. The different between the two carriers is known asthe frequency shift. The modulation operation is equivalent to summingtogether the outputs of two separate ASK modulators.
FSK is the modulation method that was used in all early low bit rate modems.[Halsall p.62]
Data Encoding - 13/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
13/28
FSK in modem
400
980(1070)
1850(2225)
1180(1270)
1650(2025)
3400
Amplitude
Frequency(Hz)
PSTN bandwidth
The above figure illustrate the frequency assignments that are used for twotypes of FSK modem to provide a full-duplex 300 bps link between twoDTEs. One set of frequency assignments is defined by EIA and the other byITU-T (V.21)
DTE
DTE
ModulatorSpace=1180
Mark=980
DemodulatorSpace=1850Mark=1650
DemodulatorSpace=1180
Mark=980
ModulatorSpace=1850Mark=1650
DTEDTE
ModulatorSpace=1070Mark=1270
DemodulatorSpace=2025Mark=2225
DemodulatorSpace=1070Mark=1270
ModulatorSpace=2025Mark=2225
EIA frequency assignment
ITU-T frequency assignment (V.21)
Data Encoding - 14/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
14/28
PSK
DataSignal
Carrier
Phasecoherent
Differential
vc(t)
vc(t)
vPSK(t)
v’PSK(t)
180=0 0=1
phase diagram
bit rate = signaling rate
In PSK, the phase of the carrier signal is shift to represent data. Two type ofPSK are used.
Phase coherent PSK : Used two fixed carrier signals to represent a binary 0and 1 with a 180° phase different. The disadvantage of this scheme us that areference carrier signal is required at the receiver against with the phase of thereceived signal is compared, this required more complex demodulationcircuit.
Differential PSK : A phase shift of 90° relative to the current signalindicates a binary 0 is the next bit while a phase shift 270° indicates a binary1. The demodulation circuitry need determine only the magnitude of eachphase shift rather than its absolute value. [Halsall, p.64]
Data Encoding - 15/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
15/28
Multilevel modulation method
01
1000
0° +90° +180° +270°
11
bit rate = n x signaling rate
More sophisticated modulation methods are used which involve eithermultiple signal levels or a mix of the basic scheme, particularly amplitude andphase. More bit rate can be achieved if signaling element represent more thanone bit.
Data Encoding - 16/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
16/28
Multilevel modulation method
+90°°°°=01
0°°°°=00
+270°°°°=11
+180°°°°=11
4-PSK phase diagram16-QAM phase diagram
QPSK ( Quadrature PSK or 4-PSK) : Four different phase changes (0°, 90° , 180° , 270° ) to enables each phase change to convey 2 bits (bitrate=2*signaling rate).
QAM (Quadrature Amplitude Modulation or 16-QAM) : Phase andamplitude changes, 16 levels per signal element and hence 4 bit symbols (bitrate=4*signaling rate).
Data Encoding - 17/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
17/28
Bit rate and Baud rate
Bit rate : A number of bits that are transmitted in a second
Baud rate : A number of line signal changed variation persecond
If a modem transmits 1 bit for every signal change
bit rate = baud rate
If a signal change represents 2 or more or n bits
bit rate = baud rate*n
The relationship between bit transfer rate and baud rate depends on thenumber of bit values that are encoded in a signal. When each signal representone bit, the bit and baud rate are the same. When a signal encodes multiplebits, the bit rate is a multiple of the baud rate.
In modem, encoding techniques are employed to make a signal changerepresent 2 or more bits.
The term baud comes from Baudot, who developed an encoding scheme forthe French Telegraph system in 1877.
Data Encoding - 18/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
18/28
Analog data, Digital signal
Two principle techniques usedPCMDM
Analogvoicesignal
Samplingclock
PAMsignal
PCMsignal
SamplingCircuit
SamplingCircuit
Quantizer&
compander
Quantizer&
compander
Digitizedvoicesignal
Digitization is a process of converting analog data into digital data. Thedigital signal is converted back into analog signal at the receiver.
The device used for converting analog data into digital form, and recoveringthe original analog data is known as CODEC (Coder-Decoder).
Data Encoding - 19/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
19/28
Nyquist theorem
“ In a perfectly noiseless channel, if f is the maximumfrequency the medium can transmit, the receiver cancompletely reconstruct a signal by sampling it 2*f timesper second”
Nyquist, 1920
In 1920, Harry Nyquist developed his classic theory. Nyquist showed thatoriginal signal must be sampled at a maximum rate of greater than twice thehighest f requency component to send to receive r to completelyreconstruction. For example, to convert a voice signal which 4 kHz highestfrequency into digital form, it must be sampled at a rate of 8000 times persecond.
Data Encoding - 20/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
20/28
PCMSampling signal based on nyquist theorem
3.23.9
2.8 3.41.2
4.2
3 4 3 311
4
011 100 011 011 001 100
Original signal
PAM pulse
PCM pulsewith quantized error
011100011011001100PCM output
PCM is based on the sampling theorem. The original signal is assumed to beband limited with a bandwidth of B. Signal is sampled at a rate 2B. Samplessignal are represents as narrow pulse whose amplitude is proportional to thevalue of the original signal and is known as PAM (Pulse AmplitudeModulation).
The amplitude of each PAM pulse is approximated by an n-bit integer,. In thesample above, n=3. Thus 8=23 levels are used for approximating the PAMpulses.
Data Encoding - 21/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
21/28
PCM conversion process
BA C D
A
B
C
D
Analogvoicesignal
Samplingclock
PAMsignal
PCMsignal
SamplingCircuit
SamplingCircuit
Quantizer&
compander
Quantizer&
compander
Digitizedvoicesignal
The process starts with an analog signal, which is sampled by PAM sample.the resulting pulse are quantized to produced PCM pulses and then encoded toproduce bit stream. At the receiver end, the process is reversed to reproducethe analog signal. [Halsall, p.69]
Data Encoding - 22/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
22/28
Nonlinear encoding
01234567
12131415
Strong signal
Weak signal
0
12
345678
89
9
101011
111213
14
15Without nonlinear encoding With nonlinear encoding
Quantization levels are not necessary equally spaced. The problem with equalspacing is that the mean absolute error for each sample is the same, regardlessthe signal level. Lower amplitude values are relatively more distorted.[Stallings, p.118]
Data Encoding - 23/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
23/28
Companding process
Implement nonlinearencoding via compandingprocessCompanding =Compressing Expanding
Implement nonlinearencoding via compandingprocessCompanding =Compressing Expanding
linear quantization interval
11100100111001001110010011100100 11100100111001001110010011100100
11100100
11100100
NetworkCompressorcircuit
Compressorcircuit Linear
ADCLinearADC Linear
DACLinearDAC Expander
circuitExpander
circuitvivi v’o
vo
Prior to the input signal being sampled and converted by ADC into a digitalform, it is passed through a circuit known as a compressor. Similarly, at thedestination, the reverse operation is perform on the output of the DAC by acircuit known as expander. [Halsall, p. 71]
Data Encoding - 24/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
24/28
Analog Data, Analog signal
Use Modulation techniquesNeed a high frequency for effective transmissionModulation permits frequency division multiplex
Modulation has been defined as the process of combining an input signal anda carrier signal.
Data Encoding - 25/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
25/28
Analog Modulation
Carrier
Modulating sine-wave signal
Amplitude-modulated wave
Frequency-modulated wave
Phase-modulated wave
Amplitude modulation is the simplest form of modulation. The modulatedsignal has constant frequency but its amplitude is vary with the input signal.
The envelope of the resulting signal is 1+nax(t) and as long as na<1, theenvelope is an exact reproduction of the original signal. If na>1 , the envelopewill cross the time axis and information is lost. [Stallings, p.123]
Data Encoding - 26/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
26/28
AM Spectrum
carrier lower sideband upper sideband
• each sideband contains the complete spectrum of s(t) !
M(f)
f0 fc - B
Discrete carrier term
Lower sideband Upper sideband
fc + Bfc
2 2
[ ]casex t f t
s t na f t f t
s t f tn
f f tn
f f t
m
m c
ca
c ma
c m
( ) cos
( ) cos cos
( ) cos cos ( ) cos ( )
=
= +
= + − + +
2
1 2 2
2 2 2
π
π π
π π π
The resulting signal has a component at the original carrier frequency plus apair of components each spaced fm Hz from the carrier.
From the equation above, it can be seen that AM involves the multiplicationof the input signal by the carrier. [Stallings, p.123]
Data Encoding - 27/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
27/28
AM power saving
SSB (Single sideband)
DSBSC (Double sideband suppresses carrier)
VSB (Vestigial sideband)
It should be clear that s(t) contains unnecessary components, since each of thesideband contains the complete spectrum. SSB, DSBSC and VSB are methodsto save power and bandwidth.
The disadvantage of suppressing the carrier is that the carrier can be used forsynchronization purposed. A constant carrier provides a clockingmechanism.A compromise approach is VSB, which uses one sideband and areduced-power carrier. [Stallings, p.124]
Data Encoding - 28/28
Applied Network Research Group Department of Computer Engineering, Kasetsart University
28/28
FM and PM
Carrier
Modulating sine-wave signal
Amplitude-modulated (DSBTC) wave
Frequency-modulated wave
Phase-modulated wave