Docsity

Digital Communication and Computer Networks: Line Coding, PCM, and PAM, Study notes of Computer Networks

Toggle sidebar
bg1
Digital Communication and Computer N etworks Spring 2017
42
Demonstr ation of Line Coding
Objective
To Demonstrate Line Coding: RZ, NRZ and Manchester.
Theory
The terminology line coding originated in telephony with the need to transmit digital information
across a copper telephone line; more specifically, binary data over a digital repeatered line. The concept of
line coding, however, readily applies to any transmission line or channel. In a digital communication system,
there exists a known set of symbols to be transmitted. These can be designated as: {mi}, i = 1, 2, . . ., N,
with a probability of occurrence {pi}, i = 1, 2, . . ., N, where the sequentially transmitted symbols are
generally assumed to be statistically independent. The conversion or coding
of these abstract symbols into real, temporal wave forms to be transmitted in baseband is the process
of line coding. Since the most common type of line coding is for binary data, such a wave form can be
succinctly termed a direct format for serial bits. The concentration in this lab will be line coding
for binary data.
Common Line Coding Formats
A line coding format consists of a formal definition of the line code that specifies how a string of
binary digits are converted to a line code waveform. There are two major classes of binary line codes:
level codes and transition codes. Level codes carry information in their voltage level, which maybe
high or low for a full bit period or part of the bit period. Level codes are usually instantaneous since
they typically encode a binary digit into a distinct waveform, independent of any past binary data.
However, some level codes do exhibit memory. Transition codes carry information in the change in
level appearing in the line code waveform. Transition codes may be instantaneous, but they generally
have memory, using past binary data to dictate the present waveform. There are two common forms
of level line codes: one is called Return to zero(RZ) and the other is called Non Return to Zero(NRZ).
In RZ coding, the level of the pulse returns to zero for a portion of the bit interval. In NRZ coding,
the level of the pulse is maintained during the entire bit interval. Line coding formats are further classified
according to the polarity of the voltage levels used to represent the data. If only one polarity of voltage
level is used, i.e., positive or negative (in addition to the zero level) then it is called unipolar signaling. If
both positive and negative voltage levels are being used, with or without a zero-voltage level, then it is
called polar signaling. The term Bipolar signaling is used by some authors to designate a specific line co ding
scheme with positive, negative, and zero voltage levels. This will be described in detail later in this section.
The formal definition of five common line co des is given in the following along with a representative wave
form, the power spectral density (PSD), the probability of error, and a discussion of advantages and
disadvantages. In some cases, specific applications are noted.
Unipolar NRZ
One" is represented by a DC bias on the transmission line (conventionally positive), while "zero" is
represented by the absence of bias - the line at 0 volts or grounded. For this reason, it is also known as "on-
off keying." In clock language, a "one" transitions to or remains at a biased level on the trailing clock edge
of the previous bit, while "zero" transitions to or remains at no bias on the trailing clock edge of the previous
bit. Among the disadvantages of unipolar NRZ is that it allows for long series without change, which makes
synchronization difficult - although this is not unique to the unipolar case. One solution is to not send bytes
without transitions. More critically, and unique to unipolar NRZ, are issues related to the presence of a
transmitted DC level - the power spectrum of the transmitted signal does not approach zero at zero
frequency. This leads to two significant problems - first, the transmitted DC power leads to higher power
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Digital Communication and Computer Networks: Line Coding, PCM, and PAM and more Study notes Computer Networks in PDF only on Docsity!

Demonstration of Line Coding

Objective To Demonstrate Line Coding: RZ, NRZ and Manchester. Theory The terminology line coding originated in telephony with the need to transmit digital information across a copper telephone line; more specifically, binary data over a digital repeatered line. The concept of line coding, however, readily applies to any transmission line or channel. In a digital communication system, there exists a known set of symbols to be transmitted. These can be designated as: {mi}, i = 1, 2,.. ., N, with a probability of occurrence {pi}, i = 1, 2 ,.. ., N, where the sequentially transmitted symbols are generally assumed to be statistically independent. The conversion or coding of these abstract symbols into real, temporal wave forms to be transmitted in baseband is the process of line coding. Since the most common type of line coding is for binary data, such a wave form can be succinctly termed a direct format for serial bits. The concentration in this lab will be line coding for binary data.

Common Line Coding Formats

A line coding format consists of a formal definition of the line code that specifies how a string of binary digits are converted to a line code waveform. There are two major classes of binary line codes: level codes and transition codes. Level codes carry information in their voltage level, which maybe high or low for a full bit period or part of the bit period. Level codes are usually instantaneous since they typically encode a binary digit into a distinct waveform, independent of any past binary data. However, some level codes do exhibit memory. Transition codes carry information in the change in level appearing in the line code waveform. Transition codes may be instantaneous, but they generally have memory, using past binary data to dictate the present waveform. There are two common forms of level line codes: one is called Return to zero(RZ) and the other is called Non Return to Zero(NRZ). In RZ coding, the level of the pulse returns to zero for a portion of the bit interval. In NRZ coding, the level of the pulse is maintained during the entire bit interval. Line coding formats are further classified according to the polarity of the voltage levels used to represent the data. If only one polarity of voltage level is used, i.e., positive or negative (in addition to the zero level) then it is called unipolar signaling. If both positive and negative voltage levels are being used, with or without a zero-voltage level, then it is called polar signaling. The term Bipolar signaling is used by some authors to designate a specific line co ding scheme with positive, negative, and zero voltage levels. This will be described in detail later in this section. The formal definition of five common line co des is given in the following along with a representative wave form, the power spectral density (PSD), the probability of error, and a discussion of advantages and disadvantages. In some cases, specific applications are noted.

Unipolar NRZ

One" is represented by a DC bias on the transmission line (conventionally positive), while "zero" is represented by the absence of bias - the line at 0 volts or grounded. For this reason, it is also known as "on- off keying." In clock language, a "one" transitions to or remains at a biased level on the trailing clock edge of the previous bit, while "zero" transitions to or remains at no bias on the trailing clock edge of the previous bit. Among the disadvantages of unipolar NRZ is that it allows for long series without change, which makes synchronization difficult - although this is not unique to the unipolar case. One solution is to not send bytes without transitions. More critically, and unique to unipolar NRZ, are issues related to the presence of a transmitted DC level - the power spectrum of the transmitted signal does not approach zero at zero frequency. This leads to two significant problems - first, the transmitted DC power leads to higher power

losses than other encodings and second, the presence of a DC signal component requires that the transmission line be DC coupled. Figure 6-

Unipolar RZ

Unipolar encoding is a line code. A positive voltage represents a binary 1, and zero volts indicates a binary

  1. It is the simplest line code, directly encoding the bit-stream, and is analogous to on-off keying in modulation. Its drawbacks are that it is not self-clocking and it has a significant DC component, which can be halved by using return-to-zero, where the signal returns to zero in the middle of the bit period. With a 50% duty cycle each rectangular pulse is only at a positive voltage for half of the bit period. This is ideal if one symbol is sent much more often than the other and power considerations are necessary, and also makes the signal self-clocking. Figure 6-
  1. Reference code Unipolar RZ: [t,s] = urz(bits,bitrate); plot(t,s,'LineWidth', 3 ); axis([ 0 t(end) - 0. 1 1. 1 ]) grid on; title(['Unipolar RZ: [' num 2 str(bits) ']']);
  2. Reference code Manchester: figure; [t,s] = manchester(bits,bitrate); plot(t,s,'LineWidth', 3 ); axis([ 0 t(end) - 1. 1 1. 1 ]) grid on; title(['Manchester: [' num 2 str(bits) ']']); Figure 6-

MATLAB Code

MATLAB Code

of the voice signal. The electronics involved in producing an accurate analog signal from the discrete data are similar to those used for generating the digital signal. These devices are Digital-to-analog converters (DACs). They produce a voltage or current (depending on type) that represents the value presented on their digital inputs. This output would then generally be filtered and amplified for use. Pulse-amplitude modulation (PAM), is a form of signal modulation where the message information is encoded in the amplitude of a series of signal pulse. It is an analog pulse modulation scheme in which the amplitudes of a train of carrier pulses are varied according to the sample value of the message signal. Demodulation is performed by detecting the amplitude level of the carrier at every single period. Principle of PAM: (1) original signal, (2) PAM signal, (a) amplitude of signal, (b) time. Figure 7- Lab Task 1

Simulating PCM

In this simulation, we will quantize a sinewave signal (message) and encode it to binary bits. We will reconstruct the sinewave from binary bits. We will also calculate the SQNR for the 8-level and 16-level quantization. For the simulation, generate a sinusoidal signal with amplitude 1, and co=l. Using a uniform PCM scheme, quantize it once to 8 levels and once to 16 levels. Plot the original signal and the quantized signals on the same axis. Compare the resulting SQNRs in the two cases. We arbitrarily choose the duration of the signal to be 10s. The resulting SQNRs are 18.90 dB for the 8-level PCM and 25.13 dB for 16-level PCM, compare these values with the results that you get from your simulation. The plots are shown in figure 7-3. A sinusoidal signal before and after quantization. You can compare this figure 7-2 with your simulation results. A zoomed potion of this figure is given in the following figure 7-4. Figure 7-

MATLAB functions required

Length, abs, max, round, log10, dec2bin, plot, grid, title, X label, Y label, Subplot, Figure

Simulation procedure

The following procedure only gives you an idea of how the PCM modulation and de-modulation are performed. Actual implementation may vary.

  1. Construct a time array from 0 to 10 S
  2. uency.
  3. Assign the number of quantization level n equal to 8.
  4. Calculate, amax = max (abs (a)). See figure 7-3.
  5. Calculate the following as shown in figure 7-3. b = a + amax c = (n-1) x (b/(2amax)) d = round(c) a_quan = 2 x amax.d/(n-l) amax a_error = a-a_quan Figure 7-
  6. Calculate
  7. Calculate Signal to noise ratio, SQNR=10 log 10(S/N)
  8. Calculate binary coding to corresponding quantized value using dec2 bin function.
  9. Repeat 4-9 with quantization level n=16.
  10. Plot the input signal and quantized signal as in Figure 7-3. Use black solid line for signal, red solid line function for multiple figures (you have to plot another figure in step 12).