BPSK Simulink
BPSK Simulink
BPSK Simulink
Lab 1
Digital Bandpass Transmission
(revised on October 3, 2008, by Akram Bin Sediq)
SYSC-4600 Page 2 of 13
The influence of the transmitter and/or the receiver filtering operations on the
received signal is examined both in the time-domain, and in the frequency
domain. The lab provides some insight into the differences between two of the
popular Modulation methods: Binary Phase Shift Keying (BPSK) and Quadrature
Phase Shift Keying (QPSK).
Impact of receiver filtering on the received signal is also examined with emphasis
on qualitative effect on Intersymbol Interference (ISI). The construction of
matched filters and their impact on the received signal are also examined.
Please note that this lab is designed more as a tutorial to provide students with a
visual hand on insight into the many basic concepts of baseband transmission.
You are encouraged to invent ways of using it on your own.
2 Background
The bit stream (sequence of ‘0’ and ‘1’) could have been generated from a digital
information, from the character coding of textual information or from the
sampling, quantization and encoding of an analog source.
The bit stream is then pulse modulated to generate an antipodal binary baseband
pulse waveform, i.e., a ‘1’ is represented by a pulse p(t) and a ‘0’ is represented by
a pulse –p(t). The pulse shape p(t) will vary according to the line code used, and
depends on any filters in the transmitter, i.e. p(t) = hL(t) * hTX(t), where hL(t) is the
filter of the line code and hTX(t) is the transmit filter (TX) impulse response. The
baseband pulse waveform is multiplied by a sinusoidal carrier to generate a BPSK
modulated signal. A coherent demodulator extracts the data by first down converting
the BPSK signal to baseband. The baseband signal is applied to a receive filter. The
receive filter output is applied to a decision device. The receiver filter response could
be that of a simple lowpass filter with a given cut-off frequency. It could also be a
“matched filter”. The matched filter response is a time-reversed replica of the
transmitter pulse shape p(t). In this lab, a matched filter will be used, i.e., hR(t) =
p(Tb –t). In Fig. 1, an AWGN channel with an infinite bandwidth has been assumed
(i.e., excluding the additive noise, the channel impulse response is hc(t)=δ(t)).
It is convenient for analysis and simulation to consider the line code filter and the TX
filter as one filter, called the transmitter filter, with impulse response hT(t) given by
hT(t) = hL(t) * hTX(t) as illustrated in Fig. 2.
Part I of this laboratory will consider the effect of the choice of the TX filter on the
power spectral density of the transmitted signal.
Looking at Fig. 2, we see that the transmitted signal is passed through an AWGN
channel with an infinite bandwidth (i.e., hc(t)=δ(t), or equivalently no filter hc(t) is
present in the channel model). The received signal (after transmission over the
channel) is then passed through a receiver filter hR(t). The receiver filter impulse
response could be that of a simple lowpass filter with a given cut-off frequency. It
could also be a “matched filter”. The matched filter impulse response is a time-
reversed replica of the transmitter pulse shape hT(t) (i.e., hR(t) = hT(Tb-t)).
Let us assume that a polar NRZ line code with a rectangular pulse shape time-limited
from 0 to Tb is used in a baseband communication system with no TX filtering (i.e.,
hTX(t) =δ(t), hT(t)=rect( (t- Tb/2) /Tb) ), over an ideal noiseless channel that has an
SYSC-4600 Page 4 of 13
infinite bandwidth (i.e., no n(t) present and hc(t) =δ(t)), and assume no filtering at
the receiver (i.e., hR(t) =δ(t)), then the output of the receiver filter y(t) to one bit
(let us say A0 =1) equals B0 hT(t)= hT(t) and hence spans in time from 0 to Tb. When
a sequence of bits is transmitted, then the output to the second bit will span the
time from Tb to 2Tb, and thus will not interfere with the output to the first bit.
Therefore in that case there is no Intersymbol Interference (ISI), and a decision can
be made on B0 or equivalently on A0 by sampling the output of the receiver filter at
any time between 0 and Tb. Furthermore, because the channel was assumed to be
noiseless, no decision error will be made.
In practice, the channel introduces some additive noise, and therefore the receiver
includes a receiver filter before sampling to improve performance. The purpose of
the receiver filter is to filter part of the noise to reduce the number of decision
errors. As shown in the lecture notes, the filter that will maximize the signal-to-noise
ratio at the output of the receiver filter at a given sampling time (and hence will
reduce the number of decision errors over an AWGN channel) is the matched filter,
i.e., a filter with impulse response hR(t) = hT(Tb –t) assuming a sampling time equal
to Tb.
A second effect will occur involving the principle of duality between time and
frequency, namely absolutely time-limited waveforms cannot be absolutely band-
limited and absolutely band-limited waveforms cannot be absolutely time-limited. In
practice, the channel will have a finite bandwidth; therefore the transmitter will have
to include filters to ensure that the bandwidth of the transmitted signal after filtering
is smaller than the channel bandwidth. Due to the duality between time and
frequency, considering a transmitter filter of finite bandwidth means that the filter
impulse response has infinite time duration. Practically, HT(f) will be almost band-
limited and hT(t) will be almost time-limited, but of duration that may span more
than one bit duration (more than Tb). This means that the output to one bit will
span from 0 to more than Tb, and thus will interfere with the output to the second
bit of the transmitted sequence. In other words ISI will occur. In that case, the
output of the receiver filter at the sampling time used to detect B0 is composed of a
term proportional to B0, a noise term and a term that represents the contribution of
the past bits, called ISI. The value of the ISI term will depend on hc(t) if the channel
has a finite bandwidth, the choice of hT(t) and hR(t), the choice of sampling time as
well as the values of the past transmitted bits. Note that in a system model it is also
possible to include all the filtering effect of the channel in the transmitter filter hT(t)
and assume for simplicity that hc(t) = δ(t); this approach is considered in this lab. If
the composite pulse shape h(t) = hT(t) * hc(t) * hR(t) (here = hT(t) * hR(t)) satisfies
the Nyquist criterion, such as the raised cosine or sinc pulse shapes, then the ISI
term equals to zero. Note that this requires to know the channel impulse response
SYSC-4600 Page 5 of 13
exactly, so in practice even though hT(t) and hR(t) are designed so that Nyquist
criterion is satisfied, there is always some residual ISI due to the imperfect
estimation of the channel impulse response. In one example in this lab, hT(t) and
hR(t) will be squared root raised cosine pulse shapes yielding a raised cosine
composite pulse h(t) = hT(t) * hR(t).
The width represents the time interval over which the received signal can be
sampled without error from ISI.
The interior region of the eye diagram is called the eye opening (“eye interior
height”). The % eye opening is defined as the eye opening (“eye interior height”)
divided by the eye exterior height.
The height of the eye opening compared to the center of the eye diagram, at a
specified sampling time defines the noise margin of the system, that is how much
noise can be added before a pulse that would be classified as corresponding to ‘1’
(by the detector) is so much distorted (due to the additive noise) that it “changes
sign” (i.e., would be classified as corresponding to ‘-1’ by the detector).
The rate of closure of the eye as the sampling time is varied (i.e., slope of the eye)
determines the sensitivity of the eye to timing errors.
Usually the eye diagram is drawn by considering the output of the receiver filter so
that the best sampling time for detection can be deduced. Note that another eye
diagram can also be constructed by considering the output of the transmitter filter.
This would correspond to considering a detector that makes decision at the output
of the transmitter (looking at the effect of the transmitter filter alone). Part II of this
laboratory will investigate the effect of the transmitter filter (hT(t)) and the receiver
filter (hR(t)) on the communication system by looking at the eye diagrams at their
outputs as well as comparing the two eye diagrams.
3 Prelaboratory
1. Find and plot the theoretical power spectral density (PSD) of a BPSK signal with a
square root raised-cosine (SRRC) pulse shape in Watts/Hz and in dB/Hz (assume a
roll-off factor of 50%, a carrier frequency of 100 Hz, and data rate of 63 bit/sec).
1/2
Note that the magnitude response of a SRRC filter is |Hsrrc(f)| = |Hrc(f)| , where
|Hrc(f)| is the magnitude response of a raised-cosine filter.
2. Using the course notes, find the theoretical bit error rate of BPSK detected
coherently as a function of Eb/N0. Using Matlab, plot the obtained BER expression as
a function of Eb/N0 expressed in dB. Use semilogy to plot your BER so that log scale
is used for the y axis and a linear scale is used for the x axis. Your plot should
display Eb/N0 from 0 to 10 dB and should look similar to the coherent detection BPSK
curve given in the textbook.
3. Find and plot the theoretical power spectral density of a QPSK signal with a SRRC
pulse shape in Watts/Hz and in dB/Hz (assume a roll-off factor of 50%, a carrier
frequency of 100 Hz, and data rate of 126 bit/sec).
SYSC-4600 Page 7 of 13
4 Matlab models
Fig. 4 shows a version of Fig. 2 that is more simulation oriented.
Figures 6 and 7 show two BPSK models meant for spectral analysis/simulation and
for BER simulation, respectively. Figure 8 shows the QPSK simulation model.
5 Laboratory
1) Run the simulation. Print the Tx signal spectrum. Compare the result you
obtained with the theoretical spectrum obtained in your prelab. Base the comparison
on the relative dB values only.
2) Open the model titled “pulse_shapes” which contains the custom blocks. This
should appear as shown in Fig. 5. Replace the pulse shaping filter by the block
“NRZps” and run the simulation. Print the Tx signal spectrum. Compare the Tx signal
spectrum you obtained in this part with the one you obtained using SRRC filter in
step (1).
1) Double click the AWGN channel model. Set the desired Eb/N0 to 50 dB. Leave all
other parameters unchanged. Run the simulation for 100 sec.
Once the simulation is completed you would have two variables named “Txout” and
“Rxout” in your work space.
Plot and print the received eye-diagrams using the command:
>>eyed(Rxout)
2) Double click the AWGN channel model. Set the desired Eb/N0 to 0 dB. Leave all
other parameters unchanged. Run the simulation for 100 sec.
Now use the variables Txout and Rxout to compute the expected BER. For this step
use the command:
>> BER(Txout,Rxout)
4) Set the desired Eb/N0 to 0 dB. Double click the block labeled “DSB-SC AM
passband1”. Set the carrier phase to pi/8. Run the simulation for 100 sec. Use the
Matlab function “BER” to compute the BER based on the workspace variables
SYSC-4600 Page 13 of 13
1) Run the simulation. Print the Tx signal spectrum. Is the experimental plot
consistent with the analytical model of the PSD obtained from your prelab? Explain.
2) Double click the AWGN channel model. Set the desired Eb/N0 to 10 dB. Leave
all other parameters unchanged. Run the simulation for 100 sec. Examine and print
the eye diagram and signal constellation for the QPSK system.
Use the command:
>>eyed_qpsk(Rxiout,Rxqout)
3) Repeat step (2) for different values of Eb/N0: 20, 30, and 40 dB. Explain what
you observe.