Document Sample
05_Signal_Encoding_Techniques Powered By Docstoc
					William Stallings
Data and Computer

Chapter 5
Signal Encoding Techniques

Encoding Techniques
• Encoding is the conversion of streams of bits
  into a signal (digital or analog)
• Digital data, digital signal: Digital transmission
   —the simplest form is to assign two voltage level
• Digital data, analog signal: Analog transmission
• Analog data, digital signal: Digital transmission
   —PCM, Delta Modulation
• Analog data, analog signal: Analog transmission
   —AM, FM, Angle Modulation

5.1 Digital Data, Digital Signal
• Digital signal
   —Discrete, discontinuous voltage pulses
   —Each pulse is a signal element
   —Binary data are transmitted by encoding each data
    bit into signal elements

Terms (1)
• 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

Terms (2)
• Modulation rate (baud)
  —Rate at which the signal level changes
  —Measured in baud = signal elements per second
• Mark and Space
  —Binary 1 and Binary 0 respectively

Signal Encoding Criteria
      Term                        Units                        Definition

Data Element         Bits                            A single binary one or zero

Data Rate            Bits per second (bps)           The rate at which data
                                                     elements are transmitted

Signal Element       Digital: a voltage pulse of     That part of a signal that
                        constant amplitude.          occupies the shortest interval
                     Analogue: a pulse of constant   of a signalling code.
                        frequency, phase and

Signalling Rate or   Signal elements per second      The rate at which signal
Modulation Rate         (bauds)                      elements are transmitted.

Interpreting Signals at the Receiver
• Need to know
   —Timing of bits - when they start and end
   —Signal levels
• Factors affecting successful interpreting of
  signals at the receiver
   —Signal to noise ratio
   —Data rate (increase of DR increases bit error rate)
   —Bandwidth (increase of BW allows an increase in DR)

Comparison of Encoding
Schemes (1)
• Signal Spectrum
  —Lack of high frequencies reduces required bandwidth
  —Lack of dc component allows ac coupling via
   transformer, providing isolation
  —Designing codes to concentrate power in the middle
   of the bandwidth -> smaller distortion in the received
• Clocking
  —For determining the beginning and the end for each
   bit position, Synchronizing transmitter and receiver
     • External clock
     • Sync mechanism based on signal

Comparison of Encoding
Schemes (2)
• Error detection
  —Can be built in to signal encoding
• Signal interference and noise immunity
  —Some codes are better than others
• Cost and complexity
  —Higher signal rate (& thus data rate) lead to higher
  —Some codes require signal rate greater than data rate

Encoding Schemes
• 3 Broad Categories: Unipolar, Polar, and Bipolar
  —Nonreturn to Zero-Level (NRZ-L)      Magnetic
  —Nonreturn to Zero Inverted (NRZI) Recording
  —Differential Manchester
  —Bipolar –AMI (Alternate Mark Inversion)
  —B8ZS                                     WAN

Nonreturn to Zero-Level (NRZ-L)
• Two different voltages for 0 and 1 bits: Polar
• Voltage constant during bit interval
  —no transition i.e. no return to zero voltage
  —Such as absence of voltage for zero, constant positive
   voltage for one
  —More often, negative voltage for one value and
   positive for the other
• This is NRZ-L
• 600/1200/2400,… bits/sec.


Nonreturn to Zero Inverted (NRZ-I)
•   Polar
•   Nonreturn to zero inverted on ones
•   Constant voltage pulse for duration of bit
•   Data encoded as presence or absence of signal
    transition at beginning of bit time
    — Transition (low to high or high to low) denotes a binary 1
    — No transition denotes binary 0
• example of differential encoding since have
    — data represented by changes rather than levels (Better encoding
    — more reliable detection of transition rather than level in noisy
    — In complex transmission layouts it is easy to lose sense of

NRZ pros and cons
• Pros
  —Easy to engineer
  —Make good use of bandwidth
• Cons
  —dc component
  —Lack of synchronization capability
• Used for magnetic recording
• Not often used for signal transmission

Multilevel Binary: Bipolar-AMI
• Use more than two levels
• Bipolar-AMI (Alternate Mark Inversion)
  —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
  —No net dc component
  —Lower bandwidth
  —Easy error detection

Multilevel Binary: Pseudoternary
• One represented by absence of line signal
• Zero represented by alternating positive and
• No advantage or disadvantage over bipolar-AMI
  — each is the basis of some applications

Bipolar-AMI and Pseudoternary
       0   1   0   0   1   1   0   0   0   1        1

Trade Off for Multilevel Binary
• Synchronization with long runs of 0’s or 1’s
  —can insert additional bits, cf ISDN
  —scramble data (later)
• Not as efficient as NRZ
  —long string of ones or zeros still a problem
  —Receiver must distinguish between three levels
   (+A, -A, 0)
     • But in a 3 level system, each signal element could represent
       log23 = 1.58 bits of information
  —Requires approximately 3dB more signal power for
   same probability of bit error

Biphase Encoding
1. Manchester Encoding
   — 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 (Ethernet LAN)
2. Differential Manchester Encoding
   — 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 (Token Ring LAN)

Differential Manchester &
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)
  —Has no dc component
  —Has error detection
     • Absence of expected transition can be used to detect errors

Modulation Rate (baud)
Is the rate in which the signal elements are generated.
in baud = signal elements per second
 Ex. In NRZI:
 Data rate
 R= 1/bit duration=1 MHz
 Modulation rate, D=R/b
 =1 Mhz
In Manchester:
Data rate
R= 1/bit duration=1 MHz
Modulation rate, D=R/b
=1 Mhz/0.5=2MHz
                 b is the number of bits            b=0.5
                 per signal element                       ٢٢
• To be used in long-distance transmission (WAN)
• Use scrambling to replace sequences that would
  produce constant voltage
• These filling sequence
   — Must produce enough transitions to sync
   — Must be recognized by receiver and replace with original
   — Same length as original (so there is no data-rate increase)
• Design goals:
   — Have no dc component
   — Avoid long sequences of zero level line signal
   — Have no reduction in data rate
   — Give error detection capability
• B8ZS and HDB3

B8ZS Encoding
• Bipolar With 8 Zeros Substitution
• Based on bipolar-AMI (with scrambling)
  —If octet of all zeros and last voltage pulse preceding
   was positive, encode as 000+-0-+
  —If octet of all zeros and last voltage pulse preceding
   was negative, encode as 000-+0+-
• Causes two violations (signal patterns not
  allowed in AMI) of AMI code, an event unlikely
  to occur as a result of noise
• Receiver detects and interprets as octet of all
• In Bipolar-AMI: 1 pulses alternate in polarity
• Two violations in B8ZS

HDB3 Encoding
•    High Density Bipolar 3 Zeros
•    Based on bipolar-AMI (with Scrambling)
•    String of four zeros replaced with one or two pulses
•    A rule is needed to ensure that the successive violation
     are of alternate polarity

                      No. of Bipolar pulses (ones) since last substitution

    Polarity of           Odd                      Even
    preceding Pulse
     -                    000-                     +00+
     +                    000+                     -00-

B8ZS and HDB3

       if odd   if even

                          Violation within the substituted code

Recap of Digital Signal Encoding
                              0                                    1

NRZL                          High level                           Low level

NRZI                          No transition at start of interval   transition

Bipolar-AMI                   No line signal                       +ve line signal

Manchester                    Transition from high to low in       Transition from low to high in
                              the middle of interval               the middle of interval

Diff Manchester               Tran at start of interval            No transition at start of interval
(always a Transition in the
middle of interval)

HDB3                          Same as bipolar-AMI, except that any string of four zeros is
                              replaced by a string with one code violation

B8ZS                          Same as bipolar-AMI, except that any string of eight zeros are
                              replaced by a string of two code violations

5.2 Digital Data, Analog Signal
• Transmitting digital data using analog signal
• Public telephone system
  —300Hz to 3400Hz
  —Use modem (modulator-demodulator)
• Encoding Techniques:
  —Amplitude shift keying (ASK)
  —Frequency shift keying (FSK)
  —Phase shift keying (PSK)

 The resulting signal occupies a BW centered on the carrier
Modulation Techniques

                   Modulation of analog
                   signals for digital data

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
• Used for:
   — Up to 1200bps on voice-grade lines
   — Very high speeds over optical fiber (light on, off)

         ⎧ A cos(2π f c t ) binary 1
s (t ) = ⎨
         ⎩0                 binary 0

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
• Used for:
   —Up to 1200bps on voice-grade lines
   —High frequency radio transmission (3-30 MHz)
   —Even higher frequency on LANs using coaxial cables
         ⎧ A cos(2π f1t ) binary 1
s (t ) = ⎨
         ⎩ A cos(2π f 2t ) binary 0
            f1 = f c + Δf
          f 2 = f c − Δf                                 ٣٢
Multiple FSK
• More than 2 frequencies are used to represent
  multiple levels of the signal
• Each signalling element represents more than
  one bit (for ex. 2: 00, 01, 10, 11)
• Signal more bandwidth efficient, but more
  susceptible to error
 MFSK for 1 element:   MFSK            s (t ) = A ⋅ cos(2 ⋅ π ⋅ f i ⋅ t )   1≤ i ≤ M
                       f i = f c + (2 ⋅ i − 1 − M ) f d
                       f c = carrier frequency
                       f d = difference frequency
                       M = number of different signal elements = 2 L
                       L = number of bits per signal element
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
                            ⎧ A cos(2π f c t + π ) binary 1
                   s (t ) = ⎨
                            ⎩ A cos(2π f c t ) binary 0
• Differential PSK
   — Phase shifted relative to previous transmission rather than some
     reference signal
   — A binary 0 is represented by sending a signal burst of the same
     phase as the previous signal burst send.
   — A binary 1 is represented by sending a signal burst of opposite
     phase to the preceding one.
   — DPSK avoids the requirement for an accurate local oscillator
     phase at the receiver that is matched with the transmitter

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 (00, 01, 10, 11)
   — split input data stream in two & modulate onto carrier & phase
     shifted carrier
                     ⎧ A ⋅ cos(2 ⋅ π ⋅ f c ⋅ t + π 4)    11
                     ⎪ A ⋅ cos(2 ⋅ π ⋅ f ⋅ t + 3π 4)
                     ⎪                                   01
             s(t ) = ⎨                   c

                     ⎪ A ⋅ cos(2 ⋅ π ⋅ f c ⋅ t − 3π 4)   00
                     ⎪ A ⋅ cos(2 ⋅ π ⋅ f c ⋅ t − π 4)
                     ⎩                                   10
• Can use 8 phase angles & have more than one
   — A standard 9600bps modem uses 12 angles, four of which have
     two amplitudes
Performance of Digital to
Analog Modulation Schemes
• Bandwidth
  —ASK and PSK bandwidth directly related to bit rate
  —multilevel PSK gives significant improvements in BW
• In the presence of noise,
  —bit error rate of PSK and QPSK are about 3dB
   superior to ASK and FSK
  —for MFSK & MPSK have tradeoff between bandwidth
   efficiency and error performance
     • an increase in bandwidth efficiency results in an increase in
       error probability

Quadrature Amplitude
• 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

5.3 Analog Data, Digital Signal
• Digitization is conversion of analog data into
  digital data which then:
   —be transmitted using NRZ-L
   —be transmitted using code other than NRZ-L
   —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)
• Sampling Theorem:
  —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
  —Eg. 4000Hz voice data, requires 8000 sample per
• These are analog samples (called: Pulse
  Amplitude Modulation, PAM)
• Convert to digital: Each sample assigned digital
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

PCM Example

PAM samples are taken at a rate of 2B, or once every Ts = 1/2B ٤٥
PCM Block Diagram

Nonlinear Encoding Technique
• To refine The PCM schema: In Nonlinear Encoding the
  quantization levels not equally spaced
   — The problem with equal spacing is that the mean absolute error
     for each sample is the same
• Lower amplitude values are relatively more distorted
• Nonlinear Encoding reduces overall signal distortion
   — Nonlinear encoding can significantly improve the PCM SNR ratio
• The same effect can be achieved by using uniform
  quantizing but companding (compressing-expanding)
  the input analog signal

Effect of Non-Linear Coding

Typical Companding Functions

Companding is a
process that compresses
the intensity range of a
signal by imparting more
gain to weak signals
than to strong signals on
At output, the reverse
operation is performed.

Delta Modulation
• To improve the performance of PCM or to
  reduce its complexity
• Analog input is approximated by a staircase
  —Can move up or down one level (δ) at each sample
• Has binary behavior
  —Since function only moves up or down at each
   sample interval
  —hence can encode each sample as single bit
  —1 for up or 0 for down

Delta Modulation - example
δ must be chosen to produce a balance between two
types of errors or noise.                    When the analog
                                             waveform is changing
                                             very slowly, there will
                                             be quantizing noise.
                                             This noise increases
                                             as δ is increased.
                                             When the analog
                                             waveform is changing
                                             more rapidly than the
                                             staircase can follow,
                                             there is slope
                                             overload noise. This
                                             noise increases as δ is
                                             decreased         ٥١
Delta Modulation - Operation
For transmission: At each sampling
time, the analog input is compared
to the most recent value of the
approximating staircase function. If
the value of the sampled waveform
exceeds that of the staircase
function, a 1 is generated; otherwise,
a 0 is generated.

Delta Modulation - Performance
• DM has simplicity compared to PCM
• But has worse SNR
• Issue of bandwidth used
  —Eg. Good voice reproduction via PCM
     • want 128 levels (7 bit) & Voice bandwidth 4khz
     • need 8000 x 7 = 56kbps (Data rate)
• Data compression can improve on this
  —e.g. Interframe coding techniques for video

5.4 Analog Data, Analog Signals
• Modulate carrier frequency with analog data
• Why modulate analog signals?
  —Higher frequency can give more efficient transmission
     • since for unguided transmission, it is virtually impossible to
       transmit baseband signals
  —Permits frequency division multiplexing (chapter 8)
• Types of modulation


• Amplitude
• Frequency
• Phase Modulation


Shared By: