EE 421: Communications I Dr. Mohammed Hawa Introduction to Digital Baseband Communication Systems For more information: read Chapters 1 and 7 in your textbook or visit http://wikipedia.org/. Remember that communication systems in general can be classified into four categories: Analog Baseband Systems, Analog Carrier Systems (where we use analog modulation), Digital Baseband Systems and Digital Carrier Systems (where we use digital modulation). Digital baseband and digital carrier transmission systems have many advantages over their analog counterparts. Some of these advantages are: 1. Digital transmission systems are more immune to noise (due to the availability of regenerative repeaters, which can be used instead of analog amplifiers at intermediate points throughout the transmission channel). 2. Digital transmission systems allow us to use multiplexing at both the baseband and carrier levels (e.g., TDMA and CDMA), which means we can easily carry multiple conversations on a single physical medium (channel). 3. The possibility of using channel coding techniques (i.e., error correcting codes) in digital communications improves the signal-to-noise ratio (SNR) at the receiver. 4. The ability to use spread spectrum techniques in digital systems help overcome jamming and interference and allows us to hide the transmitted signal within noise if necessary. 5. Using computers to perform signal processing (DSP) on digital signals eliminates the need to build expensive and bulky discrete-component devices. Actually, due to these important advantages many communication systems are transitioning these days from analog to digital communications. Within the next decade most of communication will become digital, with analog communication playing a minor role. This article provides a very quick overview of some of the main concepts that are relevant to digital baseband transmission. You will study more about this topic in the EE422 “Communications II” course. The main concepts to be emphasized here will be the analog-to-digital conversion process and the line coding technique. Analog-to-Digital (A/D) Conversion: Signals that result from physical phenomena (such as voice or video) are almost always analog baseband signals. Such analog baseband signals can be converted into digital baseband signals using the following steps: 1. Sampling (in which the signal becomes a sampled analog signal, also called a discrete analog signal). 2. Quantization (the signal becomes a quantized discrete signal, but not a digital signal yet). 3. Mapping (the signal becomes a stream of 1’s and 0’s). 4. Encoding and Pulse Shaping (after which the signal becomes a digital baseband signal). 1 These four steps are shown in the Figure below and are explained in the following subsections. Digital Baseband Analog Digital Signal Digital Baseband A/D Carrier Modulation Signal Signal Sampling Quantization Mapping Source Encoding Encoding & Pulse Shaping Channel Encoding Line Encoding I. Sampling: Sampling is the process in which only a relatively-small set of values, called discrete samples {mn}, are taken to represent the signal m(t) instead of the (time-continuous) infinite set of values included in the analog signal (see the following figure). In uniform sampling, the time interval between successive samples is set to a constant value equal to T, called the sampling time. In this case, the sampling frequency is fs = 1/T. Nyquist–Shannon sampling theorem states that for the samples {mn} to truly represent the original signal m(t), we need the sampling frequency fs to be at least twice as high as the bandwidth B of the band-limited analog signal m(t) (i.e., fs ≥ 2B). Such a condition will prevent aliasing. Aliasing should be avoided at all costs since it means that the signal m(t) cannot be recovered from the discrete samples {mn} by simple low-pass filtering at the receiver. As specific examples, telephone conversations are sampled at 8 kHz (twice the 4 kHz bandwidth of the human voice signal), while compact disc (CD) audio is sampled at 44.1 kHz (twice the 22.05 kHz bandwidth of music signals1). Some music instruments generate signals with bandwidths exceeding 22.05 kHz but a human ear cannot hear sounds above the 20 kHz mark. 1 2 II. Quaantization:: Quantiization is the t processs in which each samp ple value is i approxim mated or “ro ounded off” to a relativeely-small set of discrrete quantizzation levells. For exaample, in uniform u quantizzation if th he amplitu ude of thee signal m((t) lies in the t range (-mp, mp), we can partitio on this con ntinuous raange into L discrete intervals, i e each of len ngth Δv = 2 mp /L, and thee value of each samp ple is then approxim mated to on nly one of tthese L lev vels (see Figure below). ny, for exaample, thee number of o quantizaation levells is choseen to be In voicce telephon 8 L = 2 = 256, while for compact disc (CD) ( audio o, the numb ber of quaantization levels l is L = 2166 = 65,536 possible p values per sample. s Of course, a bigger vaalue of L means m a smallerr interval Δv, Δ and heence a smaaller round d off error caused by y the quanttization processs (called qu uantization error). The nu umber of quantizatio q on levels L is an im mportant paarameter in digital systems s becausse it decidees (see nex xt step) how w many biits will be used to reepresent th he value of each h sample. For F examp ple, if L = 256, 2 which h means thaat the valu ue of each sample can be one of 256 possibiliities, then each samp ple must be b mapped d (encoded d) into 8 bits. This is beccause 8 bin nary bits can be in n 28 = 2566 possible states (00 0000000, 000000001, 000000010, 00000011, . . ., 11111111).. For L = 65,536, wee need 16 bits to encodee each sam mple value. III. Maapping: Digitall systems use u mostly y binary coding, in which eacch of the q quantized sample values (e.g., 6V, 10V, 1 etc) iss mapped (encoded) to a correesponding binary cod de (e.g., 0110, 1010, etc). The T result is i a stream of 1’s and 0’s. Notice that each sample is representted by log2 (L) bits, and a hence the bit tim me T0 is given by b T0 = T / log2 (L), where w T is the samplle period. The tottal numberr of bits geenerated in n one secon nd is called d the data b bit rate f0 = 1 / T0 measurred in bits/ /s (or bps) is given by: b f0 [bps] = fs [samples/s] × log g2 (L) [bits/ /sample] d Pulse Sh haping: IV. Enccoding and Encodiing is the final step p in whatt we call analog-to-digital (A A/D) conv version. Sometiimes, enco oding is co onsidered as a a separa ate stage that t follow ws the A/D D stage, which takes a bitt stream off 1’s and 0’s 0 and con nverts it in nto voltagees approprriate for 3 transmission on a physical channel. Encoding schemes are usually divide into: Source coding, Channel coding and Line coding (see Figure in page 2). A. Source coding: Source coding (sometimes called entropy encoding) refers to the process of remapping binary codes (named codewords) to new ones so as to match code lengths with the probabilities of their occurrence in the bit stream. For example, a 4-bit sequence “0110” occurring frequently can be mapped to the shorter 2-bit “01” sequence, while another 4-bit sequence “1011” occurring less frequently can be mapped to the longer 7-bit sequence “0011011”. This makes sure that shorter sequences occur more often in the bit stream. Typically, source encoders are used to compress data by replacing long symbols that occur frequently by shorter codes, and those that occur less frequently by longer codes. In information theory, Shannon's noiseless coding theorem places an upper and a lower bound on the expected compression ratio. Examples of source codes currently in use are: Shannon codes, Huffman codes, run-length coding, arithmetic coding, Lempel-Ziv coding, MPEG video coding, etc. B. Channel coding: a channel code is a broadly used term mostly referring to error correcting codes. Such codes are used to protect data sent over the channel from corruption even in the presence of noise. In other words, channel codes can improve the signal-to-noise ratio (SNR) of the received signal. The theory behind designing and analyzing channel codes is called Shannon’s noisy channel coding theorem. It puts an upper limit on the amount of information you can send in a noisy channel as shown in the following equation: log 1 where C is the upper bound on the capacity of the channel (bit/s), B is the bandwidth of the channel (Hz) and SNR is the Signal-to-Noise ratio (unitless). Examples of channel codes currently in-use include: Hamming codes, Reed-Solomon codes, convolutional codes (usually decoded by an iterative Viterbi decoder), Turbo codes, etc. C. Line coding: In telecommunications, Line coding refers to the process of representing the bit stream (1’s and 0’s) generated by a source in the form of variations of voltage or current optimally tuned for the specific properties of the physical channel being used. The selection of a proper line code can help in so many ways: One possibility is to help in reliable clock recovery at the receiver. A clock signal is recovered by observing transitions in the received bit sequence, and if enough transitions exist, a good recovery of the clock is guaranteed, and the signal is said to be self-clocking. Another advantage is to get rid of DC shifts. The DC component in a line code is called the bias or the DC coefficient. Unfortunately, most long-distance 4 communication channels cannot transport a DC component2. This is why most line codes try to eliminate the DC component – such codes are called DC balanced, zeroDC, zero-bias, or DC equalized. Some common types of line encoding in common-use nowadays are unipolar, polar, bipolar, Manchester, etc encoding. These codes are explained here: 1. Unipolar (Unipolar NRZ and Unipolar RZ): Unipolar is the simplest line coding scheme possible. It is almost obsolete today, but it has the advantage of being compatible with TTL logic. It uses a positive rectangular pulse p(t) to represent binary 1, and the absence of a pulse (i.e., zero voltage) to represent a binary 0. Two possibilities for the pulse p(t) exist3: Non-Return-to-Zero (NRZ) rectangular pulse and Return-to-Zero (RZ) rectangular pulse. The difference between Unipolar NRZ and Unipolar RZ codes is that the rectangular pulse in NRZ stays at a positive value (e.g., +5V) for the full duration of the logic 1 bit, while the pule in RZ drops from +5V to 0V in the middle of the bit time. The figure below4 shows the difference between Unipolar NRZ and Unipolar RZ for the example bit stream 1110110001001. Clock 1 Data 1 1 0 1 1 0 0 0 1 0 0 1 Code 0 T0 Bit time T Sampling time (assuming 8 bits per sample) Unipolar NRZ Code Unipolar RZ Code DC-values create excessive heat generation in the channel, they cause baseline drift and also do not fit systems that carry an additional small direct current to power intermediate line amplifiers (an example is telephone networks). 3 Actually there are so many possibilities for the pulse shape p(t), not just a rectangular NRZ or rectangular RZ pulses. Changing p(t) waveform is called Pulse Shaping and is considered a major part of line coding. The pulse shape selected affects the characteristics of the line code. Here we will limit ourselves to rectangular pulses. 4 To investigate the same line code for other bit streams you can use the Code Analyzer software available at http://www.grega.phpnet.us/analizator/. 2 5 A drawback of unipolar (RZ and NRZ) is that its average value is not zero, which means it creates a significant DC-component at the receiver (see the impulse at zero frequency in the corresponding power spectral density (PSD) of this line code shown in the diagram below). As we explained earlier, a DC-value is not desired in longdistance communication systems. Another disadvantage of such unipolar (RZ and NRZ) signaling is that it does not include clock information especially when the bit stream consists of a long sequence of 0’s. The disadvantage of unipolar RZ compared to unipolar NRZ is that each rectangular pulse in RZ is only half the length of NRZ pulse. This means that unipolar RZ requires twice the bandwidth of the NRZ code. This can be seen from the PSD of both signals shown below. 2. Polar (Polar NRZ and Polar RZ): In Polar NRZ line coding binary 1’s are represented by a pulse p(t) (e.g., +5V) and binary 0’s are represented by the negative of this pulse -p(t) (e.g., -5V). Polar signals (NRZ and RZ) are shown in the diagram below. Polar NRZ Code Polar RZ Code 6 Using the assumption that in a regular bit stream a logic 0 is just as likely as a logic 1, polar signals (whether RZ or NRZ) have the advantage that the resulting DCcomponent is very close to zero. In addition, the rms value of polar signals is bigger than unipolar signals, which means that polar signals have more energy than unipolar signals, and hence have better SNR at the receiver. Actually, polar NRZ signals have even more energy than polar RZ signals. The drawback of polar NRZ, however, is that it lacks clock information especially when a long sequence of 0’s or 1’s is to be transmitted. This problem does not exist in polar RZ signals, since the signal drops to zero in the middle of each pulse period. The power spectral densities (PSD) of both polar NRZ and polar RZ are shown below. Signals transmitted on a computer motherboard often use Polar NRZ code. Another useful application of this encoding is in Fiber-based Gigabit Ethernet (1000BASE-SX and 1000BASE-LX). Note: Polar NRZ is often just called NRZ. Polar RZ is often just called RZ. A variant of Polar NRZ is Non-Return-to-Zero-Level (NRZ-L) in which the 1’s and 0’s are represented by -p(t) and p(t), respectively. This is Polar NRZ using negative logic. As an example, NRZ-L is used in the RS-232 serial port communication. NRZ-L Code 7 3. Non-Return-to-Zero, Inverted (NRZI): NRZI is a variant of Polar NRZ. In NRZI there are two possible pulses, p(t) and –p(t). A transition from one pulse to the other happens if the bit being transmitted is a logic 1, and no transition happens if the bit being transmitted is a logic 0. NRZI Code5 This is the code used on compact discs (CD), USB, and on fiber-based Fast Ethernet at 100-Mbit/s (100Base-FX). NRZI can achieve synchronization between the transmitter and receiver, if we make sure that there are enough umber of 1’s in the transmitted bit stream. 4. Bipolar encoding (also called Alternate Mark Inversion (AMI)): Bipolar (or AMI) is a three-level system that uses p(t), -p(t), and grounded pulses (e.g. +5V, -5V, 0V) to represent logical values. A logic 0 is represented with a grounded or absent pulse, and a logic 1 by either a positive or negative pulse. The direction of the pulse is opposite of the pulse sent for the previous logic 1 (mark). Bipolar (AMI) Code The alternating code in bipolar encoding prevents the build-up of a DC voltage in the cable. You can observe the absence of low frequencies (including the DC component) from the PSD shown below. 5 NRZI is always polar not unipolar. 8 Line Code Unipolar NRZ Unipolar RZ Polar NRZ Polar RZ Bipolar NRZ Duobinary Bandwidth f0 2 f0 f0 2 f0 f0 f0 / 2 AMI coding was used extensively in first-generation digital telephony PCM networks. AMI suffers the drawback that a long run of 0's produces no transitions in the data stream, and a loss of synchronization is possible. This was solved in telephony by adopting other encoding schemes (which are improved versions of AMI) to ensure regular transitions in the baseband signal even for long runs of 0’s. The Binary-with-8-Zero-Substitution (B8ZS) is a newer line coding scheme that was adopted for North America T1 system, while High-Density Bipolar 3-Levels (HDB3) was the line coding scheme used in the European E1 system. Note: A very similar encoding scheme to AMI, with the logical positions reversed, is also used and is often referred to as pseudoternary encoding. This encoding is essentially identical to AMI, with marks (1’s) being zero voltage and spaces (0’s) alternating between positive and negative pulses. Note: Coded Mark Inversion (CMI) is another variation of AMI, where 0 bits are represented by a transition in the middle of the bit time instead of zero voltage. 5. Multi-Level Transmission 3-Levels (MLT-3): MLT-3, covered by US Patent 5,280,500, is used mainly in 100BASE-TX Fast Ethernet, which is the most common type of Ethernet. MLT-3 cycles through the states -p(t), 0, p(t), 0, -p(t), 0, p(t), 0, ... etc. It moves to the next state to transmit a 1 bit, and stays in the same state to transmit a 0 bit. MLT-3 Code 9 MLT-3 has many advantages including emitting less Electromagnetic interference, requiring less bandwidth than unipolar, bipolar and AMI signals operating at the same data bit rate. 6. Duobinary: A duobinary signal is a signal in which a 0 bit is represented by a zero-level electric voltage; a 1 bit is represented by a p(t) if the quantity of 0 bits since the last 1 bit is even, and by -p(t) if the quantity of 0 bits since the last 1 bit is odd. An illustration of the duobinary signaling is shown below. Duobinary Code For a bit rate of f0, duobinary signaling requires f0/2 bandwidth, which is the minimum possible (theoretical) bandwidth for any digital baseband signal (called Nyquist bandwidth). In addition, duobinary signaling permits the detection of some transmission errors without the addition of error-checking bits. However, duobinary signals have significant low frequency components as seen by the PSD shown earlier. The differential version of the duobinary signaling is common in the 20 Gbit/s and 40 Gbit/s uncompensated optical fiber transmission systems. 7. Manchester: Currently there are two opposing conventions for the representation of Manchester codes: The first convention of these was first published by G. E. Thomas in 1949 and is followed by numerous authors (e.g., Andrew S. Tanenbaum). It specifies that for a 0 bit the signal levels will be Low-High with a low level in the first half of the bit period, and a high level in the second half (see figure below). For a 1 bit the signal levels will be High-Low. The second convention is also followed by numerous authors (e.g., Stallings) as well as by IEEE 802.4 and IEEE 802.3 (Ethernet 10 Mbps 10Base-T) standards. It states that a logic 0 is represented by a High-Low signal sequence and a logic 1 is represented by a Low-High signal sequence. If a Manchester encoded signal gets inverted somewhere along the communication path, it transforms from one variant to another. In this article, we will adopt the first convention (see figure below). 10 Manchester Code6 In Manchester code each bit of data is signified by at least one transition. Manchester encoding is therefore considered to be self-clocking, which means that accurate clock recovery from a data stream is possible. In addition, the DC component of the encoded signal is zero. Although transitions allow the signal to be self-clocking, it carries significant overhead as there is a need for essentially twice the bandwidth of a simple NRZ or NRZI encoding (see the PSD below). This is the main disadvantage of this encoding scheme. Line Code Polar NRZ Polar RZ Manchester Bandwidth f0 2 f0 2 f0 8. Differential Manchester encoding In Differential Manchester encoding a 1 bit is indicated by making the first half of the signal equal to the last half of the previous bit’s signal i.e. no transition at the start of the bit-time. A 0 bit is indicated by making the first half of the signal opposite to the last half of the previous bit's signal i.e. a zero bit is indicated by a transition at the beginning of the bit-time. 6 Manchester is always polar not unipolar. 11 Differential Manchester Code Because only the presence of a transition is important, differential schemes will work exactly the same if the signal is inverted (wires swapped). In the middle of the bit-time there is always a transition, whether from high to low, or low to high, which provides a clock signal to the receiver. Differential Manchester is specified in the IEEE 802.5 standard for IBM Token Ring LANs, and is used for many other applications, including magnetic and optical storage. 9. M-ary Coding In binary line coding, the number of bits per second is the same as the number of symbols per second. We say that for binary signaling: data bit rate [in units of bit/s] = symbol rate [in units of baud] Notice that a symbol is defined as a waveform pattern that the line code has for a certain period of time before switching to another waveform pattern (i.e., another symbol). In M-ary signaling, a cluster of bits is grouped to represent one symbol. For example, in the 4-ary (also called Quaternary) case, two bits are grouped into one symbol. The two bits can be in one of 4 possible states, which means that the symbol can take M = 4 different values. The following table shows a possible mapping of bit values to symbol values, and an example of how such line code works for a particular bit stream is shown next. Bits 00 01 10 11 Symbol value -5 V -10 V 5V 10 V 12 4-ary Code Notice that a symbol time Ts is now twice the bit time T0. This means that there are half as much symbol transitions as there are bit transitions. We can say that: symbol rate [in units of baud] = (½) × data bit rate [in units of bit/s] For a general M-ary coding scheme, we have: symbol rate [in units of baud] = (1/log2 (M)) × data bit rate [in units of bit/s] where M is the number of levels (possibilities) for a symbol. Such a drop in transition rate in the resulting signal will reduce the bandwidth of the signal by a factor of log2 (M). Note: You can see various line codes and their corresponding power spectral densities if you run the Code Analyzer at: http://www.grega.phpnet.us/analizator/ 13