Lab5
Lab5
This is the first lab in a sequence that develops a reasonably complete matlab simulator for a
linearly modulated digital communication system.
Background
I I
DSP for Receive ADC
Estimated filter
receiver (implemented Dnconverter
symbols Q Q
functions at rate 4/T) ADC
(includes coarse analog
(synchronization, Digital Analog passband filtering)
equalization, streams baseband
demodulation) rate 4/T waveforms
Figure 1: Typical DSP-centric transceiver realization. Our model does not include the blocks
shown in dashed lines. Finite precision effects such as DAC and ADC are not considered. The
upconversion and downconversion operations are not modeled. The passband channel is modeled
as an LTI system in complex baseband.
1
Sampler,
rate m/T
Symbols Transmit Receive
Channel Receiver Estimated
{b[n]} Filter Filter Filter Signal
Rate 1/T g (t) g (t) g RX(t) Processing symbols
TX C
(Synchronization,
Noise Equalization,
Demodulation)
2
the receive filter.
Step 5: Processing at the receive filter output
If there is no intersymbol interference (ISI), the processing simply consists of sampling at rate
1
T to get decision statistics for the symbols of interest. For BPSK, you might simply take the sign
of the decision statistic to make your bit decision.
If the ISI is significant, then channel equalization (discussed in later labs) is required prior to
making symbol decisions.
Laboratory Assignment
0) Get the matlab code needed (lab5init) to get started from the course home page, and make
sure you understand what it is doing. For your information, the transmit filter specified in the code
is approximately a square root raised cosine pulse in the frequency domain.
1) Plot the impulse response of the transmit filter versus t/T .
2) Using the DFT, compute the magnitude of the transfer function of the transmit filter versus
the normalized frequency f T . (See Example 2.5.4 in Chapter 2 for a discussion of how to use
the DFT of the sampled response to estimate the Fourier transform of the original continuous
time signal that the samples correspond to). From eyeballing the plot, estimate the normalized
bandwidth (i.e., bandwidth as a multiple of T1 ).
3) Plot the response at the output of the receive filter to a single symbol. Is the transmit filter
(approximately) square root Nyquist at rate 1/T ?
4) Generate 100 random bits {a[n]} taking values in {0, 1}, and map them to symbols {b[n]}
taking values in {−1, +1}, with 0 mapped to +1 and 1 to −1.
5) Send the 100 symbols {b[n]} through the system. What is the length of the corresponding
output of the transmit filter? What is the length of the corresponding output of the receive filter?
Plot separately the input to the receive filter, and the output of the receive filter versus time, with
one unit of time on the x-axis equal to the symbol time T .
6) Do the best job you can in recovering the transmitted bits {a[n]} by directly sampling the
input to the receive filter, and add lines in the matlab code for implementing your idea. That
is, select a set of 100 samples, and estimate the 100 transmitted bits based on the sign of these
samples. (What sampling delay and spacing would you use?). Estimate the probability of error
(note: no noise has been added).
7) Do the best job you can in recovering the transmitted bits by directly sampling the output
of the receive filter, and add lines in the matlab code for implementing your idea. That is, select a
set of 100 samples, estimate the 100 transmitted bits based on the sign of these samples. (What
sampling delay and spacing would you use?). Estimate the probability of error. Also estimate the
probability of error if you chose an incorrect delay, offset from the correct delay by T /2.
8) Suppose that the receiver LO used for downconversion is ahead in frequency and phase relative
1
to the incoming wave by ∆f = 25T and a phase of π/2. Modify your complex baseband model to
include the effects of the carrier phase and frequency offset. When you now sample at the “correct”
delay as determined in 7), do a scatter plot of the complex-valued samples {y[n], n = 1, ..., 100}
that you obtain. Can you make correct decisions based on taking the sign of the real part of the
samples, as in 7)?
3
9) Now consider a differentially encoded system in which we send {a[n], n = 1, ..., 99}, where
a[n] ∈ {0, 1}, by sending the following ±1 bits: b[1] = +1, and for n = 2, ..., 100
b[n − 1], a[n] = 0,
b[n] =
−b[n − 1], a[n] = 1,
Devise estimates for the bits {a[n]} from the samples {y[n]} in 8), and estimate the probability of
error.
Hint: What does y[n]y ∗ [n − 1] look like?
Lab Report: Your lab report should answer the preceding questions in order, and should document
the reasoning you used and the difficulties you encountered. Comment on whether you get better
error probability in 6) or 7), and why?