No Slide Title

Download Report

Transcript No Slide Title

CSIS 625 Week 2
Encoding and Transmission of Data
Copyright 2001 - Dan Oelke
Portions Copyright 2000 - Dmitry Gringauz
CSIS 625
For use by students of CSIS 625 for purposes of this class only.
1
Overview
• Analog and Digital Signals
– Vocabulary
– Analog Signals
– Digital Signals
• Encoding and Modulation
–
–
–
–
CSIS 625
Digital to Digital Conversion
Analog to Digital Conversion
Digital To Analog Conversion
Analog to Analog Conversion
2
Analog and Digital Signals
• Signal - an electromagnetic wave that
transfers information
• Analog Signal - Continuous set of data
– Real Numbers
• Digital Signals - Discrete set of data
– Integer Numbers
– Often binary (1 or 0 only)
Analog Signal
CSIS 625
Digital Signal
3
Periodic vs Aperiodic Signals
• Periodic Signal
– A signal that completes a pattern in a
measureable time frame
• Aperiodic Signal
– A signal that does not exhibit a pattern
– All aperiodic signals can be shown to be a
combination of periodic signals
Periodic Signal
CSIS 625
APeriodic Signal
4
Signal definitions
• Amplitude - The “height” of a signal.
Measured in Volts, Amps, Watts, etc.
• Period - The amount of time to complete
one cycle
• Frequency - The number of periods per
second. Measured in Hertz (Hz)
Amplitude
Period
CSIS 625
5
Phase
• The position of a sine wave relative to time
zero. Measured in degrees.
CSIS 625
0 Degrees
90 Degrees
1/4 Cycle
180 Degrees
1/2 Cycle
270 Degrees
3/4 Cycle
6
Bandwidth
• Bandwidth - A range of frequencies
• Analog - measured in Hz.
– Bandwidth = High-Freq – Low-Freq
• Spectrum - synonym - used only in analog
measurements.
• Bandwidth in digital realm - often used to
refer to bits-per-second
CSIS 625
7
Bit Rate
• Most digital signals are aperiodic
• Period and frequency are not appropriate to
describe digital signals
• Bit Interval - time to send one bit
• Bit rate - number of bits send in a second.
Measured in bits per second
• bps - Bits Per Second
• Do NOT use Hz when you mean bps or
vice-versa
CSIS 625
8
Decomposing a digital signal
• A digital signal can be decomposed into an
infinite number of simple sine waves
• It is not practical or necessary to send all of
these components
• Significant Bandwidth - Those frequencies
necessary to recreate a digital bit pattern
• Significant Bandwidth is related to bit rate
– Greater bit rate = Greater significant bandwidth
CSIS 625
9
Medium Bandwidth and Significant
Bandwidth
• All transmission mediums have limited
bandwidth
• The significant bandwidth of a digital bit
rate must fit within the limited bandwidth of
the medium that carries it.
CSIS 625
10
Encoding
• Information must often be encoded before
being sent over a medium
• Four basic types of encoding
–
–
–
–
Digital to Digital
Analog to Digital
Digital to Analog
Analog to Analog
• Encoding schemes may be stacked
– Voice to digital data to radio waves
CSIS 625
11
Digital to Digital Encoding
• Using a digital signal to represent digital
data
• Binary data is translated to different
voltage, current, or light pulses that can be
transported over the medium.
• Types
– Unipolar - uses 1 signal level
– Polar - uses 2 signal levels
– Bipolar - uses 2 signal levels and 0
CSIS 625
12
Digital signal encoding formats
0
1
0
0
1
1
0
0
0
1
Unipolar
NRZL
NRZI
RZ
Manchester
Differential
Manchester
Bipolar-AMI
Pseudoternary
CSIS 625
13
Unipolar Encoding
• Simplest scheme
• Uses two signal levels
– 1’s are encoded with signal present
– 0’s are encoded by absence of a signal
– (Sometimes inverse of the above)
• Long run of 0s or 1s can’t be handled by
some mediums
CSIS 625
14
Unipolar encoding - synchronization
• When a signal isn’t varying, receiver can’t
determine beginning and ending of each bit
• Solutions:
– A separate line with a clock signal
– Asynchronzous Serial lines wrap each byte
with start and stop bit
– Scrambling of data to ensure enough transitions
– Use of additional coding schemes like 8b10b
CSIS 625
15
Polar Encoding
• Uses a positive and a negative signal
– but not a zero level
• Several types of Polar encoding
– NRZ - Non-Return to Zero
– RZ - Return to Zero
– Biphase
CSIS 625
16
Non-Return to Zero - Level
• NRZL - Non-Return to Zero - Level
• Simple - exactly like Polar, except
– 1’s are encoded with positive signal
– 0’s are encoded with negative signal
– (Sometimes inverse of the above)
• Same synchronization problems and
solutions
CSIS 625
17
Non-Return to Zero - Invert on Ones
• NRZI - Non-Return to Zero - Invert on
Ones
• A change in voltage level indicates a 1
• No change in voltage level indicates a 0
• Synchronization less of a problem
– Every 1 bit causes a signal change
– A string of 0’s still causes problems
• Same synchronization solutions
CSIS 625
18
Return to Zero
• RZ - Return to Zero
• Not strictly polar - uses 0 in addition to
positive and negative
• Works like NRZL, except it goes to zero
between each bit.
• Transition to/from zero provides for
synchronization
• Because there are more transisitions (2 per
bit time) it has a higher significant
bandwidth
than
NRZ
CSIS 625
19
Manchester Coding
• A biphase mechanism
• Inversion of signal in middle of each bit
– low to high transition is 1
– high to low transition is 0
• Mid-bit inversion provides for both data and
synchronization information
• May have transition between bits so that
right transition can be made in middle of a
bit
CSIS 625
20
Differential Manchester
• A biphase mechanism
• Always has a mid-bit inversion to provide
timing information
• Inversion at beginning of bit time provides
data
– Presence of inversion means 0
– No inversion means 1
CSIS 625
21
Bipolar AMI
• Bipolar Alternate Mark Inversion
• Mark comes from old telegraphy - means 1
• Encoding
– 0 = lack of signal (0)
– 1 = positive or negative values alternating for
successive ones
CSIS 625
22
Pseudoternary
• Same as Bipolar AMI, but inverts 1s and 0s
• Encoding
– 0 = positive or negative values alternating for
successive zeros
– 1 = lack of signal (0)
CSIS 625
23
B8ZS
• Bipolar 8-Zero Substitution
• A modification of Bipolar AMI to solve the
synchronization problem that occurs when a
long string of 0s occurs
• Substitutes 8 consecutive 0s with fixed
pattern that contains 2 AMI violations
1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0
Binary-AMI
V
V
B8ZS
CSIS 625
V = Bipolar AMI Violation
24
HDB3
• High Density Bipolar - 3 Zeros
• Similar to B8ZS
• Substitutes 4 zeros with a pattern that
contains 1 AMI violation
1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 1 0
Numberof Bipolar pulses (ones)
Polarity of
Since Last Substitution
Preceding Pulse
Odd
Even
000+00+
+
000+
-00-
Binary-AMI
V
V
V
HDB3
V = Bipolar AMI Violation
CSIS 625
25
Analog to Digital Encoding
• Digitizing - analog to digital conversion
• Approximate analog information with a
digital signal
• Reduces infinite number of analog values to
a finite number of digital values.
• Codec - Coder-Decoder
– Analog to digital converter
CSIS 625
26
Pulse Amplitude Modulation (PAM)
• First step to analog to digital encoding
• Sample analog amplitude information at
equal intervals
• PAM alone not useful as measurements are
still analog values
CSIS 625
27
Pulse Code Modulation (PCM)
• Modifies PAM output to create completely
digital signal
• PCM quantizes Take the samples from PAM
and assigns digital values to each
measurement.
• Nyquist theorem - To ensure accurate
reproduction of a signal, the sample rate
must be twice the highest frequency of the
original signal
CSIS 625
28
PCM & Telephony
• Telephony system uses 8 bits (256 levels)
when quantizing
• A non-linear set of quantizing levels is used
so that quiet sounds are accurately
reproduced
• 300-3300Hz is voice range.
• 8kHz sample rate is used to cover this range
• 8kHz * 8 bits/sample = 64,000 bps
CSIS 625
29
DM - Delta Modulation
• Analog data is approximated using a
staircase function that moves up or down by
one level each sampling time.
• Digital data is a stream of 1s and 0s that
specify the up and down steps.
• Can be implemented using simple
components.
• Not as good quality as PCM
– Quantizing noise when slope changes slowly
– Slope overload noise when slope changes fast
CSIS 625
30
Digital to Analog Conversion
• ASK - Amplitude Shift Keying
• FSK - Frequency Shift Keying
• PSK - Phase Shift Keying
• QAM - Quadrature Amplitude Modulation
– combination of ASK & PSK
CSIS 625
31
Bit rate vs. Baud Rate & Carrier Signal
• Bit rate is Bits per Second
• Baud Rate is number of signal units per
second
– Baud rate is less than or equal bit rate
• Don’t mix them up!
• Carrier Signal
– high frequency signal that is modified to carry
digital signal
CSIS 625
32
ASK - Amplitude Shift Keying
•
•
•
•
•
Amplitude of signal varied for 1 or 0
Frequency and phase remain constant
Very susceptible to noise
On-Off-Keying - signal and no-signal
Example:
CSIS 625
1 BIT
1 BIT
1 BIT
1 BIT
0
1
0
1
33
FSK- Frequency Shift Keying
• Frequency of the carrier signal is varied to
represent a 1or 0.
• Avoids many of the noise problems of
Amplitude Shift keying
• Example:
CSIS 625
1 BIT
1 BIT
1 BIT
1 BIT
0
1
0
1
34
PSK - Phase Shift Keying
• The phase of the carrier signal is varied to
represent a 1 or 0.
• Avoids noise problems of ASK
• Uses less bandwidth than FSK
• Example:
CSIS 625
1 BIT
1 BIT
1 BIT
1 BIT
0
1
0
1
35
QPSK - Quadrature PSK
• A type of PSK that uses 90° shifts instead of
180° shifts.
• Allows for 2 bits per baud to be encoded.
CSIS 625
36
DPSK - Differential PSK
• The bit pattern defines the phase change,
instead of the current phase
• V.22bis standard at 1200 bps uses:
–
–
–
–
CSIS 625
00  90 Degree phase change
01  0 Degree phase change
10  180 Degree phase change
11  270 Degree phase change
37
Quadrature Amplitude Modulation
• The phase and amplitude of the carrier
signal is varied to give several bits per baud
• Number of different phases is greater than
number of amplitudes
• Example: 2 amplitudes & 4 phases
CSIS 625
3 BITS
3 BITS
3 BITS
3 BITS
000
010
001
111
38
Trellis Coded Modulation
• Uses QAM, but includes extra data
• Trellis coding is a specific type of
convolutional encoding
• Viterbi Decoder - a specific algorithm for
decoding convolutionally encoded data.
• Convolutional codes add redundancy to the
data, which makes it more resistant to noise.
• Resistance to noise is more important as
data rates get higher.
CSIS 625
39
Constellation diagrams
• Constellation diagram shows relationship
between amplitude and phase of different
signal levels
• polar diagram,
– amplitude shown as distance from center
– phase shown as degrees around circle
011
0
1
ASK
CSIS 625
0
1
PSK
101
100
010
000
001
110
111
8-QAM
16-QAM
40
Bandwidth required
• Amplitude Shift Keying
– bandwidth = baud rate * (1 + noise factor)
• noise factor is 0 in ideal world
• Frequency Shift Keying
– bandwidth = (fc1 - fc0) + baud rate
• Phase Shift Keying & QAM
– bandwidth = baud rate * (1 + noise factor)
– but bit rate is higher because more than one bit
per baud
CSIS 625
41
Analog to Analog Encoding
• AM - Amplitude Modulation
– The amplitude of the carrier is modified
– Bandwidth = 2x Bandwidth of modulating
signal
• FM- Frequency Modulation
– The frequency of the carrier is modified
– Bandwidth = 10x Bandwidth of modulation
signal
CSIS 625
42
Analog to Analog Encoding
• Phase Modulation
– The phase of the carrier is modified
• Phase Modulation and FM are a special case
of Angle modulation
– Observing the signal, it is impossible to tell
apart FM and phase modulation
CSIS 625
43
Parallel/Serial Transmission of Data
• Transmission of Digital Data
– Serial & Parallel transmission
– Serial interfaces - DTE & DCE - Modems
CSIS 625
44
Parallel Transmission of Data
• Send several bits of data at the same time,
each one over a separate media link.
– Typically 8 bits of data sent over 8 wires
– Examples: Printer cables, SCSI, PCI bus
• Allows faster transmission of data, but at
the cost of multiple wires, multiple
transmitters, and multiple receivers
• Must keep all bits in sync
• Typically uses a separate clock line
CSIS 625
45
Serial Transmission of Data
• Sends all bits from node to node over a
single media link.
• Bits are sent one after another - or “serially”
• May or may not have additional media links
for clock, frame, or flow control.
• Need some method of keeping track of
when a byte starts and ends.
– Asynchronous or Synchronous
CSIS 625
46
Serial - Asynchronous transmission
• Bits are grouped together into characters
• Start and stop bits frame the data bits
– A start bit is sent first
– Followed by the data bits
– Followed by a stop bit or bits
• Variable number of idle bits between
characters
CSIS 625
47
Serial - Asynchronous transmission
• At best - 80% efficient
– 8 data bits
– 1 start bit
– 1 stop bit
• Allows for about a lot of timing error
• Example:
Start Data Data Data Data Data Data Data Data Stop
CSIS 625
Start Data Data Data Data Data Data Data Data Stop
48
Serial - Synchronous transmission
• Each byte of data is sent with no extra gaps
between bytes.
• Data is grouped into frames
– Frame contains
• Between frames, special idle patterns used
• Much less overhead that asynchronous
• Can achieve faster bit rates than
asynchronous
• Requires synchronization method
CSIS 625
49
Data transparency on serial links
• Data transparency - the ability of a link to
send any data pattern
• Bit stuffing - insertion of extra bits to
change a flag pattern so that data
transparency is achieved
• Byte stuffing - insertion of extra bytes to
change a flag pattern so that data
transparency is achieved
• Flag character - special bit pattern to show
start or end of a frame
CSIS 625
50
Serial - Synchronous transmission
• Bit-oriented synchronous transmission
– Uses a special bit pattern at the start and end of
the frame (flag character)
– Data may be any number of bits
– Uses bit stuffing to replace flag pattern in data
– Bit stuffing is slightly more efficient than byte
stuffing
– Easier to implement in hardware
CSIS 625
51
Serial - Synchronous transmission
• Character oriented synchronous
transmission
– Uses a special byte at the start and end of the
frame
– Data must be an even number of 8-bit bytes
– Uses byte stuffing to replace flag byte in data
– Byte stuffing makes this slightly less efficient
– Easier to implement in software
CSIS 625
52
DTE-DCE interface
• DTE - Data Terminal Equipment
– A device that is a source or destination for
binary digital data
• DCE - Data Circuit-terminating Equipment
– A device that interfaces between a DTE and a
network
– Modem is classic DCE example
• Lots of standards specify DTE to DCE
interface
• More standards for DCE to DCE interface
CSIS 625
53
RS-232 Interface
• Specifies the mechanical, electrical &
functional characteristics of DTE-DCE
interface
• EIA-232 is now the official name
• Tailored to Computer to modem interface
• Limited to about 20 Kbps
• Mechanical
– less than 50 feet long cable
– DB-25 connector original standard
– DB-9 connector now standardized
CSIS 625
54
RS-232 Interface
• Electrical - Uses NRZL
– 0 = +3 to +15 volts
– 1 = -3 to -15 volts
• 3 pins are all that are necessary
– Receive Data
– Transmit Data
– Ground
• Other pins are often ignored
• Null modem - a device that flips receive and
transmit lines
CSIS 625
55
Other serial interfaces
• RS-449 - uses 37 pin connector
• RS-423 - uses 2-6 volt levels
– 40 feet - 100 Kbps
– 4000 feet - 1 Kbps
• RS-422 - 2-6 Volt balanced transmission
– 40 feet - 10 Mbps
– 4000 feet - 1 Kbps
CSIS 625
56
Balanced transmission
• Uses two wires with a positive or negative
voltage put on the line
• Compared to unbalanced which using two
wires, one as ground and the other as signal.
• Better noise resistance than unbalanced
CSIS 625
57