Lab5-digitaltransmission

advertisement
University of Kentucky
EE 422G - Signals and Systems Laboratory
Lab 5 - Digital transmission
Objectives:
 Examine how signal information is encoded for transmission over base-band
analog channels.
 Analyze encoded signal bandwidth requirements and observe impact of noise and
bandwidth limitation on the received waveform.
1. Background:
In this lab you will investigate how a digital data stream can be encoded into a
sequence of pulses for transmission through a base-band analog channel. After briefly
examining various line coding methods used for digital base-band modulation in data
communication applications, you will study the spectral properties of the line codes. The
two important causes of signal corruption, which result errors in communication systems,
are additive noise and limited channel bandwidth.
Figure 1. System Model.
Figure 1 illustrates the main components of a communication transmitter. The
information to be transmitted is converted into a binary sequence. The binary data source
emits a series of 1’s and 0’s (bits) and represents the source in the communication
system. The Baseband modulation codes each bit into a continuous voltage waveform
for sending the source sequence over a physical channel. A channel is a medium such as
a wire, coaxial cable, a waveguide, an optical fiber, or a radio link – through which the
transmitter output is sent. No medium is totally free of noise (random fluctuations on
transmitted signal), therefore white Gaussian noise is added to the transmitted signal to
simulate this form of corruption. In addition, channels have limited bandwidth. So if the
waveforms for the coded bits require a bandwidth greater than channel, then the
waveform will be distorted on transmission through the channel. For baseband channel, a
low-pass filter can be used to simulate this distortion. This lab considers only base-band
signals and channels. Base-band is another name for low-pass. If the signals were
modulated with a high frequency oscillator (shifted up on the frequency axis), then they
would no longer be considered base-band.
Before the data is sent over to the channel, the binary digits produced by a data source are
usually serially encoded using a variety of signaling formats called line codes for
transmission over an analog baseband channel. Their structure and spectral properties
will be examined in this lab. To help with this study a Matlab function was written,
modulb, to create various line codes for analysis. The function syntax is:
[y,t] = modulb(<binary_sequence>,<Fd>,<Fs>,<line_code_name>);
where binary_sequence is a vector of 1’s and 0’s denoting the binary sequence, Fd
corresponds to the binary data rate in bits per second (b/s), line_code_name is a string
indicating the particular line code to be used, and Fs is the simulation sampling
frequency of the line code waveform. The modulb function outputs the waveform as
vector y and corresponding time axis t. The command supports the following codes:
‘unipolar_nrz’,
‘bipolar_nrz’,
‘bipolar_rz’,
‘ami’,
‘manchester’,
‘miller’,
‘unipolar_nyquist’, and ‘bipolar_nyquist’.
The type of line coding is selected to meet various system criteria such as power
requirement, bit timings (transitions in signal help timing recovery), bandwidth efficiency
(excessive transitions waste bandwidth), low frequency content (some channels block
low frequency), error detection, and complexity. Figure 2 shows various line coding
examples.
Figure 2. Line coding examples.
2. Pre-lab
1. Use the modulb function to plot waveforms representing the binary sequence
seq  0,1,0,1,0,0,0,0,1,0,0,1,1 using the following line codes at bit rate of Rd  1 kb/s
(choose a reasonable sampling rate for potting the waveforms):
a) unipolar NRZ (on-off signaling, NRZ= non-return to zero)
b) bipolar NRZ (binary antipodal signaling)
c) bipolar RZ (binary antipodal signaling RZ = return to zero)
d) AMI (Alternate Mark Inversion)
e) Manchester (split-phase);
f) Bipolar Nyquist (bipolar transmission where the pulse shape is a sinc function
with main lobe extending to fill bit interval and side lobes extending beyond).
Briefly describe in your own words how each line code translates 0’s and 1’s into an
analog waveform. Focus on the differences between the methods in your description.
3. Laboratory Exercise
1. Generate a random binary sequence or 1000 bits by rounding off a set of uniformly
distributed random numbers between 0 and 1 with the command:
>> seq = round(rand(1,1000));
Encode the sequence for each of the line codes listed below using the modulb
function.
a) unipolar NRZ
b) bipolar NRZ
c) bipolar RZ
d) AMI
e) Manchester;
f) Bipolar Nyquist
Set the data rate to Rd = 1 kb/s, the waveform sampling rate to Fs = 25 kHz, and
compute the PSD for each encoded sequence and plot the PSD in 2 ways. In both
cases use a linear frequency scale, and in one case plot the PSD magnitudes in dB
(logarithmic y-axis scale) and in other case plot the PSD magnitudes on a linear scale.
In the procedure section, discuss how the pwelch function was applied to compute
the PSD (i.e. window length, overlap, number of FFT points). Make sure you select a
small enough window so that the spectrum is reasonably smooth. If jagged and
noise-like fluctuations exist over the spectrum they can be smoothed out by using a
smaller window. On the other hand, if the window is too small, then the
characteristic peaks will merge together because of loss of resolution. So this must be
adjusted properly for best results. You will need to identify major peaks and nulls
from these plots. In the results section show the plots of each, clearly labeled.
The PSD plots indicate how efficiently each line code utilizes the channel bandwidth.
The more concentrated the spectral energy near zero, the less bandwidth the signal
requires for distortionless transmission. To rate the bandwidth requirements for each
line code a simple locate the major peaks and nulls. In most cases that will be easier
on the log plots.
From the PSD plots identify the locations of the first and second spectral peaks
(denoted by f p1 and f p 2 ) and the first and second spectral nulls ( f n1 and f n 2 ). While
the first spectral peak can be situated at f  0 , the first null for this bandwidth
measurement cannot be at f=0. The first spectral null must be at a frequency for f >
0 (i.e. a null at f = 0 doesn’t count). The location of the peaks and nulls should be
entered in the table below. If a secondary peak and null cannot be located (no
significant ripple behavior) simply repeat the first peak and null for f p 2 and f n 2 .
Present these results in the results section in a Table similar to that Table 1.
If the minimum required channel bandwidth for a given line code is determined by
the location of the first spectral null, determine W for each line code. In the discuss
section comment on how well you think this characterizes the spectral distribution of
the waveform and indicate which line code would be most robust to distortion due to
limited bandwidth channels.
2. This next exercise examines the relationship between the line code PSD and the data
rate Fd. For this part just consider the Manchester encoding and produce a PSD for
different values of Fd, successively taken to be 250, 500, 1000, and 2000 b/s.
Compute and plot the PSD (just record the dB plots in the result section). Make note
of the minimum required bandwidth in the result section. In the discuss section
propose a formula or approximate rule that results minimum required bandwidth to
the binary data rate.
You will now simulate the characteristics of an ideal baseband communication
channel including additive white Gaussian noise. The channel is modeled as an ideal
low-pass filter whose output is summed with the output of a white Gaussian noise
generator (see conceptual diagram of Figure 1).
3. Now consider the effects of the channel on the waveforms created in the previous
section. In particular channel distortion will be modeled as low-pass filtering to
simulate bandlimits, and Gaussian noise will be added to the signal to simulate
channel fluctuations. Create a 10 bit binary sequence b shown below and encode it
into an analog waveform using bipolar NRZ at a data rate of 1kb/s and sampling
frequency of 25kHz.
>> seq = [0 1 0 0 1 0 0 1 1 0];
From your observations in Part 1, determine the transmission bandwidth W and
apply a low-pass Butterworth with a cut-off at this frequency:
>> [b,a] = butter(4, W/(fs/2));
>> yf = filtfilt(b,a,y);
In the above example filtfilt was used instead of filter. This filters the
signal forward and backwards and results in a doubling of the filter order with no
delay of phase distortion. So when comparing plots, the delay does not been to be
compensated for. Plot the original and the filtered version on the same graph (put in
results section) and comment on differences. In the discussion section, explain why
these differences exist.
Repeat the above procedure for a channel limited to W/4. Is it possible to still
determine the correct in each bit interval just by looking at the plot?
4. Generate the original waveform from the last section with for a channel with
bandwidth W. Add white Gaussian noise (AWGN) with noise power is 0.01 W. Plot
channel input and output and describe the changes. Also plot the PSD of the signal.
Could you accurately estimate the original sequence based on visual inspection of the
plots? Repeat the previous procedure with increasing the noise power. Indicate the
noise power at which it is no longer possible to correctly estimate all of the bits
correctly by visual inspection. Include the plots of this waveform with noise and the
PSD for this final condition. In the discussion section comment on the features of the
PSD that suggest it is a signal with white noise corruption.
Download