Outline
- Nyquist Theorem
- Shannon Theorem
- Serial Lines:
- Asynchronous Communication
- Encoding
- Baud Rates, Maximum Data Rates
Nyquist Theorem
- Nyquist Sampling Theorem:
- if all significant frequencies of a signal are less
than bandwidth B
- and if we sample the signal with a frequency 2B or higher,
- we can exactly reconstruct the signal.
- any sampling rate less than 2B will lose information
- formulated by Nyquist, proven by Shannon in 1949
- with a signal for which the maximum frequency is higher than B,
the reconstructed signal may not resemble the original signal
Data Transmission Rate
- assume samples are encoded digitally using K symbols
- for example, there are 16 possible symbols, 0..9A..EF, encoding
16 possible sample values
- for example, a symbol can be a voltage level on a wire
- then, the maximum data rate is D = 2B log2K bits/s
- for example, with 32 symbols and a bandwidth B=1MHz, the maximum
data rate is 2*1MHz*log232 bits/s or 10Mb/s
- a symbol can be encoded as a unique signal level (AM), or a unique
phase (PM), or a unique frequency (FM), or a combination of these (modern
modems)
- the rate of symbol transmission is also known as the
Baud rate but this term is frequently mis-used (as bits/second)
- in theory, we could have a very large number of symbols, allowing
very high transmission rate without high bandwidth
- in practice, we cannot use a high number of symbols because we
cannot tell them apart: all real circuits suffer from noise
Shannon's Theorem
- it is impossible to reach very high data rates on bandlimited
circuits in the presence of noise
- given a signal power S, noise power N, signal-to-noise ratio S/N
- a decibel level dB is dB = 10 log10 S/N
- for example S/N = 20dB means the signal is 100 times more
powerful than the noise
- Shannon's theorem: the capacity C of a channel with bandwidth
B Hz is C = B log2(1+S/N) b/s
- for example if S/N = 20dB, and the channel has bandwidth B = 1MHz,
- C = B log2(1+S/N) b/s
- C = 1MHz log2(1+100) b/s
- 6Mb/s < C < 7Mb/s
- if S/N = 0dB (signal power and noise power are the same),
C = 1Mb/s
- this can be very hard to achieve in practice!
Example using Shannon and Nyquist Theorems
- a given telephone circuit has a bandwidth of 3000 Hz and a S/N ratio
of 30dB (factor of 1000)
- Shannon limit gives us
C = 3000 log2(1+1000) b/s =~ 30,000 b/s
- to encode information on this channel, we can send 3000
samples / second, and use about 1,000 different symbols:
- each symbol can encode 10 bits
- the 30dB S/N ratio means we have 1,000 times more power
in the signal than in the noise, and so (intuitively) we may be
able to distinguish about that many symbols
- the Nyquist theorem says
- if we try to send any more than 3,000 symbols per second,
- and we are bandlimited to 3,000 Hz
- the higher frequencies will be lost
- symbols will be lost
- so we should not use more than 3,000 symbols per second
- to decode, we should look for samples at least 6,000 times
per second
- in-class exercise:
- what channel capacity can we get if
the S/N ratio is 10dB and the bandwidth is 1,000 Hz?
- with S/N ratio 50dB?
- how many different symbols are we going to use?
Serial Lines
- RS-232 standard, later augmented with RS-422 standard
- asynchronous communication: receiver must be able to
decode sender's signal without knowledge of the sender's clock
(with synchronous communication, the sender sends the clock as
well as the data)
- serial communication: one bit is sent on the wire before
the next bit is sent (opposite of parallel communication)
Bit Encodings
- possible encoding: no voltage is no bit (idle), positive voltage is 1,
negative voltage is 0 bit
- RS-232 encoding: positive voltage is 0, negative (or zero) voltage is 1,
idle sends 1
- two sides of RS-232 must agree on the number of data
bits sent (e.g. 5, 8 -- 4 shown below) and on the bit time (e.g. 9600 baud)
- sender sends the start bit (always 0, so high), the n
data bits (LSB first), and 1 or more stop bits (always 1, so low)
- receiver starts an accurate clock at the center of the start bit,
uses it to read the data bits
- two signal wires plus ground give bidirectional communication
(full duplex -- both sides can send at the same time)
- start bit is logic zero, but logic zero is positive voltage...
Bit Errors
- BREAK is a long sequence of zero bits --
multiple hundreds of milliseconds
- if a bit signal is corrupted (e.g. by lightning), the signal on the
wire may not be what was intended to be sent
- if the start bit is distorted (by noise or bad wiring), the receiver
may interpret the successive bits at the wrong time
- if the two endpoints fail to agree on bit time or number of
bits, the communication will fail and random-looking characters will
be received
Baud
- A Baud is the number of changes per second in the
signal (named after Baudot)
- for RS-232 and many other systems, the number of Baud is the
same as the number of bits per second
- but 10Mb/s Manchester-encoding Ethernet runs at 20MBaud
- 56Kb/s modems run at much lower baud rates (9600 baud?), but
use many symbols