Data Communications and Networking

ETE 442

Course Description:

Signal conversion methods, sampling, quantization, pulse modulation techniques, error analysis methods, digital modulation techniques, encoding schemes, data transmission methods, open system-interconnection model, local area networks, transmission control protocol, internet protocol (TCP/IP), ethernet, IEEE 802 networking technology.

# Sampling and Pulse Amplitude Modulation

## OBJECTIVES

• Examine the effect of sampling a signal
• Understand the role of sampling frequency
• Build and analyze a sampling circuit
• Reinforce use of laboratory equipment

Pulse Amplitude Modulation (PAM) is a method of converting an analog signal into a pulse train, where each pulse has a different amplitude. This is part of the process that an ADC must perform before quantizing the data. Sampling involves turning a switch or pass-transistor on briefly at regular intervals, allowing the signal to pass through for just a moment. Therefore, the signal value is only known a small fraction of the time. Most often after sampling the signal is then “held” by means of a capacitor. If a capacitor is used to hold the value, then the signal will not drop to zero every cycle of the sampling clock. By making the sampling frequency large enough, we can create a negligible error between the original waveform and our sampled waveform, regardless of the frequency of it.

## Laboratory

Figure 1: Sampling circuit

## Building and Testing the Circuit

1. Build the circuit of Figure 1.
2. Set the clock generator to 40 Hz with duty cycle of 20%. You should see several pulses but overall a sinusoidal shape.
3. Capture screenshot, then also capture more screenshots at 10 Hz, 4 Hz, 2 Hz, and 1 Hz.
4. Insert a 10 uF capacitor from the non-inverting input of U1B to ground.
5. Repeat steps 2 and 3.

## Part 2 With 10µF Capacitor @

40Hz - 10Hz - 4Hz - 2Hz - 1Hz

## Theoretical Analysis

In part one of the lab for our initial sampling frequency of 40Hz it was very easy to recognize the sin wave. Because the frequency was set to 40Hz and being amplified by the LM324AN (Op-amp) and the clock pulse set to 10Hz being switched on and off at consistent intervals by the 2N700G Mosfet transistor, the sampling time was showing short interval between the switching on/off process. This gave us a very clear picture of what was happening. As we lower the clock pulse we are getting less images/ samples of what is happening and as a result it becomes more and more difficult to recognize the sin wave. We are also not able to see the change in amplitude as often. At 2Hz and 1Hz it was not possible to see the sign wave and the pulses looked more like simple high and low digital signal.

In the second part of the lab we introduced a 10µF capacitor into the circuit. The capacitor allowed us to keep the samples without the drop to zero between the switching on/off of the transistor. This is due to the capacitor's ability to hold the voltage between the switching on/off of the transistor. As the frequency was lowered the sign wave became more and more of a high-low or 1-0 type of signal.

# Amplitude Shift Keying

## OBJECTIVES

• Create a pseudo-random data (PRNG) generator using a Linear Feedback Shift Register (LFSR)
• Understand the operation of an analog multiplexer (MUX)
• Create and examine a circuit which implements Amplitude Shift Keying (ASK)
• Reinforce use of laboratory equipment

ASK is a type of amplitude modulation, very similar to traditional AM you have studied before. The main difference between AM and ASK is that in ASK the “information” is digital in nature. On-off Keying (OOK) is one form of ASK, that uses the presence or absence of the carrier wave as the modulation scheme. However, other types of ASK can use multiple voltage levels to represent more than one bit an once. For example, you could encode ‘00’ as 0 V, ‘01’ as 1.66 V, ‘10’ as 3.33 V, and ’11’ as 5 V. This would mean that for every time an amplitude reading is taken, there are two bits of information.

In ASK, the bandwidth required for the system is a function of the data rate. Like AM, modulation of the sine wave causes a shift in frequency of the original information signal. After the frequency content of the square wave is shifted to higher frequency, we introduce essentially create a “mirror” of the frequency content around the carrier frequency. So, if the information signal has frequency content up to , then the modulated signal will have frequency content up to  and down to . This creates the familiar sum and difference frequency terms. In our case however, the frequency content of the message actually extends into infinity, so technically speaking it requires infinite bandwidth. In practice, we can live without most of the frequency content, so the signal can just be band-limited to prevent this problem. The signal won’t be a “sharp” square wave, but can be received and demodulated all the same. If we only concern ourselves with the frequency content up to the baud rate of the information, then after the signal is mirrored about the carrier, the BW requirement has effectively doubled. So, for ASK the BW is double what it is at base band frequency. Therefore, for data that is clocked at 1 kHz, the BW requirement for ASK would be a minimum of 2 kHz.

See the effect of bandlimiting a square wave in the middle trace of the following image:

For this lab, a PRNG implemented by a LFSR is used to generate random data. Please see the FSK lab handout for more information about the random data circuit. The random data is then used to modulate the sine wave carrier’s amplitude.

## Laboratory

Figure 1: Linear Feedback Shift Register

## Building and Testing the Circuit

1. Build the circuit of Figure 1. This is the PRNG circuit.
2. You must initially connect pin A of the shift register with 5V to clock in some ‘1’ bits. Then, move the connection back to the feedback from the XOR gates.
3. Set the clock generator to 20 KHz with a 0 to 5 V square wave. minimum value.
4. Capture a screenshot of your oscilloscope image for the data generating circuit.
5. Include the ASK modulation circuit, with a 0 to 3 V sine wave input at 200 kHz.
6. Capture a screenshot of the ASK modulated signal, showing the a few data transitions.

# You can see the modulated signal on the top and the raw data on the bottom.

## Theoretical Analysis

The sine wave is modified by the data stream where the sine wave becomes the carrier signal for the data stream. The data stream is now modulated, which changing the properties of the data stream frequency within the envelope of the data stream allows us to send the data stream farther with less error.

BW = (1+k) fs                (2)14.7Hz  = 29.4 Hz

fs = 1/t                   1/ -1.63ms - (-69.63ms) = 14.7Hz

t = tf  - t i                    -1.63ms - (-69.63ms) = 68 ms

# Line Codes

## OBJECTIVES

• Create a pseudo-random data (PRNG) generator using a Linear Feedback Shift Register (LFSR)
• Create a circuit to generate a Manchester encoded data stream
• Create a circuit to generate NRZ, Unipolar RZ, and Bipolar RZ
• Practice using Multisim circuit simulation software

## Introduction

Encoding also known as Line Codes is a used to encode data. There are many ways to accomplish encoding data. Each encoding method has its own pros and cons. Some examples of encoding methods are unipolar, polar (NRZ, RZ, NRZ-L, NRZ-I), bipolar, phase (Manchester), and multilevel. For this lab, we will focus on: Non-Return to Zero (NRZ) and Return to Zero (RZ) both in the “UNIPOLAR_RZ” and “BIPOLAR_RZ” as well as Manchester Encoding. The different types of encoding can be seen on the last page of the Lab

To create the Line code needed we must first create a Pseudo Random number generator (PRNG) circuit. Because the PRNG was used in the previous lab Linear Feedback Shift Register LFSR, this process will be easy. We will use a function generator as a clock signal for the circuit. By using a oscilloscope to view the random modulated data in terms of 1’s and 0’s or Highs and lows. We will then add the Manchester circuit to our PRNG circuit and observe the output on an oscilloscope. Once we can see the the Manchester encoding data we will remove the Manchester circuit and add the RZ circuit to the PRNG circuit and measure the outputs on an oscilloscope.

## Laboratory

Circuit used from previous lab.

74LS164N shift register/ three XOR gates/ SPDT switch/ function generator is set to be a clock signal from 0 to 5V at 25 Hz while the power supply is set to 5V DC

Figure 4: Linear Feedback Shift Register

Figure 5: Manchester Encoding Circuit

Figure 6: RZ Encoding Circuit (Unipolar and Bipolar)

## Building and Testing the Circuits

### (Manchester)

1. Add the circuit of Figure 5 to your PRNG circuit. Connect the “DATA_OUT” from before to the “DATA” port of the new circuit.
2. Connect the “CLK” to the same clock signal as your PRNG circuit.
3. Measure the “MANCHESTER” output on the oscilloscope.
4. Capture screenshot and verify output signal agrees with theory.
5. In your report, comment on the advantages and disadvantages (BW, DC bias, etc.) of the Manchester encoding scheme.
6. In your report, draw (by hand if you want) the resulting Manchester encoded signal for data “11110000” and “10101100”.

1. Remove the Manchester encoding circuit from your board. Add the circuit of Figure 6 to your board. Connect the “DATA_OUT” from before to the “DATA” port of the new circuit.
2. Connect the “CLK” to the same clock signal as your PRNG circuit.
3. Measure the “UNIPOLAR_RZ” and “BIPOLAR_RZ” outputs on the oscilloscope. If you are not getting the correct output, check and make sure your PRNG is working first, then check that you are getting “UNIPOLAR_RZ” correctly. Next check that you are getting inverted “DATA” at the input of AND gate U5. If this is all correct, then check wiring of the LM324.
4. Capture screenshot with PRNG data and RZ output signal(s) simultaneously, and verify output signal agrees with theory. In other words, connect Ch. 1 to PRNG data, and Ch. 2 to the RZ encoded data for side by side comparison.
5. In your report, comment on the advantages and disadvantages (BW, DC bias, etc.) of the Unipolar and Bipolar RZ encoding scheme.
6. In your report, draw the resulting Unipolar and Bipolar RZ encoded signals for “11110000” and “10101100

## Conclusion

This lab was very helpful in seeing how RZ, NRZ, and Manchester line coding effect the data. It also helps get a visual of what is happening through the oscilloscope. The overall process for this lab was successful. The graph results of the oscilloscope reflect exactly what the RZ circuit and Manchester circuit were expected to display.  The results can be seen in the screen captures above. We have a better understanding of the pros and cons of each circuit as well.

The figure below shows the different types of encoding methods:

# Pulse Width Modulation

## OBJECTIVES

• Explore a Pulse Width Modulation (PWM) circuit
• Understand the operation of a 555 timer IC
• Learn to use Multisim circuit simulation software

Pulse Width Modulation (PWM) is a way to send analog information using only digital voltage levels. PWM is used in a variety of ways in industry. It can be used to send information, or used in much the same way as a Digital to Analog (DAC) is used. By varying the pulse width or duty cycle, the average value of the square wave is changed. If PWM is filtered by a LPF, then it is possible to get performance similar to a DAC.

This lab utilizes the classic 555 timer IC. The 555 timer is usually operated as either a monostable vibrator or an astable vibrator. The monostable vibrator produces a “one-shot” pulse, each time the device is triggered. The pulse width or length is a function  of the resistor or capacitor values. The astable vibrator allows the device to continually trigger itself where it will free run.  For our PWM circuit, the first stage (left) of the circuit uses a 555 timer in astable mode to create the clock signal. The stage on the right is in monostable mode and uses the first stage to produce the triggering. We use a sine wave as the modulating signal which will in turn vary the pulse width of the second stage. The goal is to able to see the pulse width of the output change as a function of the voltage of the modulating wave.

Design Information for 555 timer in Astable mode from an Application Note:

## Pulse Width Modulation

1. Build the circuit of Figure 1 using Multisim. The modulating wave should be a sine wave with 2.5V offset and 4.8 Vpp, with a frequency of 20 Hz.

1. Adjust the potentiometer to 10%, 30%, 50%, 70% and 90%, then record the CLK frequency at each setting. Compare this with the calculated values in your report. The Tektronix oscilloscope can make measurements.

10%                                        30%

50%                                70%                                  90%

1. Set the potentiometer back to 50%, record the PWM output and modulating wave signals on the same oscilloscope. Examine how the pulse-width changes with the modulating sine wave.

1. Try increasing the frequency of the modulating wave to 1 kHz. Examine the PWM output. Does this provide a good representation of the modulating wave? Why?