Laboratory 2

advertisement
Laboratory 3
Data Transmission through a
bandwidth-limited communication channel
1. Review and Preparation
This lab builds on Lab 2. The important concepts studied in this experiment are signal
bandwidth, channel bandwidth, signal distortion due to limited bandwidth, and data errors
caused by distortion.
The bandwidth, or frequency spectrum, of a baseband signal is the range in Hertz of the
frequency components contained in the signal. In another interpretation, the bandwidth of
a signal is the energy or power spectrum density of the signal, that is, the range of
frequencies where the signal energy or power is distributed. All real signals have a finite
bandwidth, B Hz. For example, an analog speech signal has a bandwidth of about
B=4000 Hz. The digital data signal of the serial port with bit rate R bps has a bandwidth
B=R Hz. So, if data is transmitted at R=2400 bps by a serial port, the signal has
bandwidth B=2400 Hz. An approximate sketch of the frequency spectrum (bandwidth) of
a 2400 bps polar signal is sketched in Fig. 1. It is important to accept that a “shadow” of
the bandwidth exists on the negative frequencies.
S(f)
Mirror
spectrum
Real spectrum
f
0
B=2400 Hz
Fig. 1: Bandwidth sketch of RS232 signal
A metallic transmission medium (copper wires, coax) can be modelled as a cascade of
low-pass RLC filter circuits. The bandwidth of the filter circuit forms the bandwidth, W
(in Hz), of the communication channel of the medium. The frequency response of the
filter the bandwidth of the communication channel of the medium.
A relatively simple circuit model of a communication channel is the active second-order
RC low-pass filter, given in Fig. 2-a. A simpler circuit model for a channel is the firstorder lowpass filter given in Fig. 2-b. The bandwidth (in Hz) of both filters, representing
the bandwidth of the channel, is given by:
W 
1 1
2 RC
R variable
R variable
+
To TD pin
of PC1
C
To RD pin
of PC2
C
To SG pin
of PC1
To SG pin
of PC2
Fig. 2: a) 2nd orderLow-pass filter model of channel
R variable
To RD pin
of PC2
To TD pin
of PC1
C
To SG pin
of PC2
To SG pin
of PC1
Fig. 2: b) 1st order low-pass filter model f channel
Let Si denote an AC signal transmitted at the input of the channel and So the signal
received at the output of the channel (Si can actually be any signal). In the frequency
domain, the ratio So/Si represents the frequency response of the channel, which defines
the channel bandwidth W (Hz) at the knee of the curve, as depicted in Fig. 3.
If the bandwidth of the input signal is B<W, the channel introduces no distortion, so S o 
Si, that is, the transmitted signal is recovered reliably at the receiver.
If the bandwidth of the input signal is B>W, the channel introduces distortion, so So  Si,
that is, the transmitted signal may not be recovered reliably at the receiver.
1
So/Si
Bandwidth, W
f, freq. in Hz
Fig. 3: Bandwidth of communication channel
The fundamental principle of transmitting band-limited digital signals through bandlimited channels can thus be stated as follows:
If the bandwidth of the signal, B, is smaller than the bandwidth of the channel, then the
digital signal passes without noticeable distortion, resulting in no bit errors.
This case is depicted in Fig. 4.
Signal spectrum
1
Channel response
0
B W
f, Hz
Fig. 4: Distortionless transmission, B<<W.
If the bandwidth of the signal, B, is larger than the bandwidth of the channel, then the
digital signal will suffer distortion, resulting in bit errors.
This case is depicted in Fig. 5.
Channel response
1
Signal spectrum
0
W
B
f, Hz
Fig. 5: Transmission with distortion, B>>W
The channel circuit of Fig. 2-b has been built on an experiment board in the Engineering
Lab.
The input of this channel circuit is labelled as point V3, and its output as point V4 on the
board. A resistor box is used as variable resistance, so that the channel bandwidth,
W=1/2RC, can be varied. A picture of this board is given in Picture 1. The lab set-up,
showing the board and a signal display on the oscilloscope, is given in Picture 2. The
input and output connections are labelled on the board.
The main purpose of this experiment is to connect 2 PC’s via the channel circuit, as
shown in Fig. 6. The channel circuit is built on the lab board. We’ll transmit a file of text
data from PC1 to PC2 at a given bit rate across the channel, and by varying the
bandwidth of the channel, we will measure the effect of distortion on the errors in the
received file.
Picture 1: Circuit Board for Comm Labs
Picture 2: Circuit board and setup for labs
RS232 cable
PC1
RS232 cable
Lab
Board
PC2
Fig. 6: Connecting 2 PC’s via a low-pass communication channel
Preparation:
Include your work in the lab answer sheet
1. Using circuit analysis, show that the magnitude of the frequency response of the
channel circuit of Fig. 2-a is given by:
Ha ( f ) 
1
, W 
1
2RC
(1)
 f 
1  
W 
Where f is the frequency in Hz. To do this, you need to have taken the Electrical
Circuits course.
2
2. Plot the frequency response, Ha(f), versus frequency, f, in Hertz. Take R=10K,
C=470nF. Use a dB scale for Ha(f) and a log10(f) for frequency. Your plot should
look like the sketch of Fig. 3, showing the bandwidth W, and the decay slope
beyond W. Note that a f=W, the channel attenuates the input by half.
3. Using circuit analysis, show that the magnitude of the frequency response of the
channel circuit of Fig. 2-b is given by:
Hb ( f ) 
1
2
, W
1
2RC
(2)
 f 
1  
W 
Note that the 2 channel circuits have the same bandwidth, W. The difference,
however, is that the frequency response of the circuit of Fig. 2-a decays at
40dB/decade slope beyond W, where as that of Fig. 2-b decays at 20dB/decade.
4. Plot the frequency response, Hb(f), versus frequency, f, in Hertz. Take R=10K,
C=470nF. Use a dB scale for Hb(f) and a log10(f) for frequency. Your plot
should look like the sketch of Fig. 3, showing the bandwidth W, and the decay
slope beyond f=W. Note that a f=W, the channel attenuates the input by 1 / 2 .
5. Compare the 2 curves above, and observe the difference in the decay slope
beyond the bandwidth f=W.
2. Lab Experiment
2.1 Objective: The goal is to transmit serial data from one PC to another across a
low-pass channel (realized as a low-pass filter), and by varying the channel
bandwidth with respect to the signal bandwidth, observe distortion and errors caused
by distortion.
2.2 Apparatus: Lab board, 2 PC’s, 2 RS232 cables, oscilloscope, signal source
2.3 Procedure
1. Connect a signal source to input point V1 on the board. Unplug the RS232 cable
from PC1. Using a jumper, connect point V1 to point V3 on the board (V3 is the
input to the low-pass filter). The value of C is 470nF. Vary the resistance to set
the channel bandwidth at W300 Hz (recall that W=1/2RC). Apply a sinewave
at the filter input, with amplitude 1V and a low frequency of 50 Hz. Connect the
input (point V1) to Channel1 of the scope, and the output of the filter (point V4)
to Channel2. Unplug the RS232 cable from PC2.
Observe the sine-waves at both channels of the scope. Do the following (in lab
answer sheet):



Given the value of C=470nF, find the value of R that’s required to have
W=300Hz.
Vary the frequency of the input sinewave, from 50 to 500 Hz by increments of
50, and measure the amplitude of the output sinewave. Put the results in the
table given in the lab answer sheet.
Using the data in the table above, plot the amplitude of the output versus
frequency. Compare the plot to the theoretical one obtained earlier in the
preparation section.
2. Remove the signal source from point V1. Plug back the RS232 cable into PC1;
Point V1 of the board is connected to the TD pin of PC1. Keep the jumper
between points V1 and V3. Point V4 is connected to the RD pin of the PC2
RS232 cable, so keep this cable unplugged into PC2. Connect channel1 of the
scope to the input point V1. Connect the output of the circuit (point V4) to
channel2 of the scope. Set the resistance of the circuit so that W600Hz. Using
Hyperterminal, write a paragraph of text (say of N=200 characters) and save into
a file (test_file1.txt) in PC1. Set the bit rate to 300 bps (hence signal bandwidth
B=300Hz), data_bits=8, and parity=none. Then, from the Hyperterminal menu,
use button “transfer”, select “send text file” to transmit file test_file1.txt from
PC1. The RS232 signal should be captured by Channel2 of the scope. At
W600Hz, you should observe a clean signal (no distortion) on channel2 of the
scope.
Increase R to decrease the bandwidth, W, for example to W100Hz, and
retransmit the file from PC1. You should now observe a distorted output signal
(on channel2 of scope).


Sketch the input and output signals when W600 Hz (no distortion)
Sketch the input and output signals when W100 Hz (signal with distortion)
3. Connect the Spectrum Analyzer (if available) to capture the data signal, and
manipulate the Analyzer to display the frequency spectrum of:
a. the input signal, when R=300 bps, W600 Hz
b. the output signal when R=300 bps, W600 Hz
Estimate the bandwidth, B, of the signal. How does this estimate compare to the
approximate rule B=R (R=bit rate)?
4. Plug back the RS232 cable into PC2. Now, we have PC1 connected to PC2
through the low-pass channel. On PC2, set the same Hyperterminal parameters as
in PC1 (bit rate R=300 bps, etc.). Set the resistance of the circuit so that
W>>300Hz (e.g. W600Hz). Record R in lab sheet. From PC1, send the text file
test_file1.txt to PC2. The file text should appear on the screen of PC2 with no
errors. Check visually that there are no errors.
In this case, W>>R, there is no distortion, hence no errors.
Capture the screens of both PC’s, and insert into lab sheet.
5. Increase R to such value as the bandwidth of the channel becomes W<< 300Hz
(e.g., W=100Hz). Then transmit the file from PC1 to PC2, and observe the
characters on PC2’s screen. There should be characters in error. Visually, verify
that character errors occurred in the text on PC2. Repeat this step until errors are
observed. Capture the screen of PC2 and insert in lab sheet.
3. Lab Answer Sheet
Experiment:
Step 1:

Given the value of C=470nF, find the value of R that’s required to have
W=300Hz.
Answer:

Vary the frequency of the input sinewave, from 50 to 500 Hz by increments of
50, and measure the amplitude of the output sinewave. Put the results in the
table below.
Freq. 50
Ampl.

100
150
200
250
300
350
400
450
500
Using the data in the table above, plot the amplitude of the output versus
frequency. Compare the plot to the theoretical one obtained earlier in the
preparation section. Discuss below.
Step 2:

Sketch the input and output signals when W>>300 Hz (no distortion).

Sketch the input and output signals when W<<300 Hz (severe distortion). You
may also try to capture the screen of the oscilloscope using the software
starwav
Step 3: if this step was performed:
a) Sketch the spectrum of the input signal (at 300 bps)
Estimated bandwidth, B= …….. Hz
b) Sketch the spectrum of the output signal
Discuss the measured bandwidth to the theoretical value B=R
Step 4: Transmission with no distortion (no errors)

To get W>>300Hz, we have:
R = …………….Ohms
W=……………. Hz (this is the actual value)

Screens of PC1 and PC2 are:
Step 5: Transmission with distortion (errors)

To get W<<300Hz, we have:
R = …………….Ohms
W=……………. Hz (this is the actual value)

Screens of PC1 and PC2 are:
Download