Digital Modulation, Sampling Receiver, Nyquist Criterion, Intersymbol Interference, Pulse Shapes
Objective
The objective of this lab is to deepen students understanding of principles of digital modulation
Building the basic digital modulator and sampling receiver
 Open a new simulink model.
 Here are a list of the blocks that you will need. You won't need them all at first.
 Comm Blockset > Comm Sources > Data Sources > Bernoulli Binary Generator
 Comm Blockset > Comm Sources > Noise Generators > Gaussian Noise Generator
 Comm Blockset > Comm Sinks > DiscreteTime Eye Diagram Scope
 Comm Blockset > Comm Sinks > DiscreteTime Scatter Plot Scope
 DSP Blockset > Signal Operations > Upsample
 DSP Blockset > Signal Operations > Downsample
 DSP Blockset > DSP Sources > DSP Constant
 DSP Blockset > DSP Sinks > Signal To Workspace
 Discrete > Discrete Filter
 Math Operations > RealImag to Complex

Math Operations > Sum
 LookUp Tables  LookUp Table
 First we need a digital source. The Bernoulli Binary Generator will serve this purpose. It outputs either a zero or a one. Set the probability of a zero to onehalf as shown below. Setting the sample time to 1 means that this source will output one bit each second. What is the bit rate?
 Create the look up table that will convert bits {0,1} to symbols {1, +1}. Use the LookUp Table block to perform this transformation by setting the parameters as shown below. How many bits are represented by each symbol? What is the symbol rate?
 The symbols can be used to modulate an impulse train. Create the impulse train with an Upsample block. In this case we will upsample by a factor of 100. Therefore, the sample rate of the continuoustime part of this simulation is 100 Hz (or 100 samples per second).
 Connect a Signal To Workspace block to the output of the upsampler so that you can examine the impulse train in Matlab.
 Create the modulated pulse train by filtering the modulated impulse train. Use a Discrete Filter block to perform the filtering. Use the NRZ pulse shape by setting the Discrete Filter block parameters as shown below.
 The completed model should look like this.
 In the Simulation Parameters dialog box, set the Start Time to 0.0 and the stop time to 100. Because the bit time is 1 bit per second, in this 100 second simulation, 100 bits will be modulated.
 Set the Solver options Type to Fixedstep.
 Run the simulation.
 Plot the impulsetrain and pulsetrain signals in Matlab. Here's the commands that I used and the plots are shown below.

Only the first nine impulses/pulses are shown. As you can
see, the first nine symbols are {+1, 1, +1, +1, 1, +1, +1, +1, 1}. The
NRZ pulse shape is apparent and you can also see that the symbol period
is 1 second.
 Lengthen out the NRZ pulse by changing the impulse response of the Discrete Filter. Let's create 20% overlapping pulses. Set the Discrete Filter parameters as shown below.
 Leave everything else the same and run the simulation.
 Plot the impulse and pulse trains as before. You need to adjust the arguements of the axis settings to see the entire waveform which looks like this.
 Compare this figure to the previous one and the effect of having overlapping pulses is appearant. The interference between successive pulses creates problems for the sampling receiver.
 Accurate detection of the symbols using a sampling receiver is possible, even when pulses overlap, if the pulse (impulse response of the Digital Filter) satisfies Nyquist's criterion. Before we look at Nyquist pulses, let's look at one more pulse that leads to intersymbol interference (ISI).

Download the file
isipulse.mat
. In
Matlab type
load
isipulse
at the prompt.
 Change the impulse response of the Discrete Filter as shown below.
 The pulse shape extends over four symbol periods as shown below.
 Run the simulation.
 The impulse and pulse trains now look like this. As before, the delay has been removed. Note the severity of the ISI now.
 Now lets consider some Nyquist pulses. Generate the halfsine (HS) pulse by typing the following at the Matlab prompt.
 A plot of the hspulse is shown below. Note that it is a Nyquist pulse because it passes through zero at the sample times (denoted with a red circle) except the sample at time 0.
 Change the "Numerator" of the Discrete Filter block from isipulse to hspulse and run the simulation. You should see something like the figure shown below. The lower axis shows the samples of the modulated pulse train taken at multiples of the symbol time in red circles. Note that the modulated pulse train passes through the symbols exactly. This will always be the case when a Nyquist pulse is used and the sample/symbol timing is perfect.
 Next let's try a raised cosine (RC) pulse with 30% excess bandwidth.
 Copy the RC Pulse program called "rcpuls" on page 23 of the Anderson text into a file called "rcpuls.m". Or cut and paste from here...
 Now create an RC pulse by entering the following at the Matlab prompt.
 A plot of the rcpulse is shown below. Note that it is a Nyquist pulse because it passes through zero at the sample times (denoted with a red circle) except the sample at time 0.
 Change the "Numerator" of the Discrete Filter block from hspulse to rcpulse and run the simulation. You should see something like the figure shown below. The lower axis shows the samples of the modulated pulse train taken at multiples of the symbol time in red circles. Note that the modulated pulse train passes through the symbols exactly. This will always be the case when a Nyquist pulse is used and the sample/symbol timing is perfect.
 So you see that effective detection with the sampling receiver is possible, even with overlapping pulses, provided the pulses satisfy Nyquist's criterion.
 If you are not tired of fiddling around with pulses, feel free to keep on going. But, for the purposes of this lab, we shall now move on to consider additive noise channels and the sampling receiver.
 Let's simulate a channel that adds zeromean white Gaussian noise to the pulse train signal to form the received signal. Add a Gaussian Noise Generator block to you Simulink Model. Now it should look something like this.
 Set the parameters of the Gaussian Noise Generator as shown below.
 Capture the received signal output with a Signal To Workspace block.
 Run the simulation and plot the received signal. Over the first ten seconds, it looks like this.
 First set the variance on the Gaussian Noise Generator block to 10^(6). Setting the variance to this small value essentially ellminates the noise from the simulation. After experimenting with the sampling receiver without noise, we will add the noise in to complete the picture.
 Complete the Simulink model by adding components of the sampling receiver. Then your model will look something like this.
 Set the parameters to the DiscreteTime Eye Diagram Scope and DiscreteTime Scatter Diagram Scope as follows.
 Run the simulation. Two windows will pop up: The "Eye Diagram" and the "Scatter Plot". We will discuss these diagrams in class.
 Run simulations in which the transmit filter impulse response is:
 A Nyquist triangle pulse generated using tripulse=triang(200).' .
 The Nyquist half sine pulse used above.
 The nonNyquist isipulse used above.
 Next we want to experiment with timing offset. Change the impulse response of the transmit filter back to the RC pulse.
 Insert a Discrete Filter block into your Simulink model at the output of the channel (after adding in the Gaussian noise). Use the newly added Discrete Filter block to introduce at 20 sample delay. Twenty samples corresponds to 20% or one fifth of the symbol period since the sample rate is 100 samples per symbol. Configure the parameters of the Discrete Filter as shown here.

The full system model should now look something like this. The
new delay filter is indicated.
 Run the simulation and plot the eye diagram and scatter plot. The eye diagram is still sampled at the center to produce the scatter plot. Notice that now, due to the time delay, the eye diagram is sampled at a place where the eye is partially closed. The scatter plot shows that there are many different possible sample values. The different sample values are due to the different combinations of symbols. Since we truncated the RC pulse to plus and minus 6 symbol periods (12 symbol period span), there are 2^12 = 4096 different possibilities for the sample values.
 Next add noise back into the simulation by changing the noise variance to 0.01. Run the simulation and plot the eye diagram and scatter plot. They should look something like the figures shown below. Note that we really should simulate bandlimited noise in which the bandwidth is the same as the 30% RC pulse which in this case would be (1+\alpha)/(2T) = 1.3/2 = 0.65 Hz. But we will omit this detail for now. Note that the noise tends to close the eye. If the noise variance is 0.1, then the eye is completely closed. Try it. With a closed eye, the receiver will make lots of errors.

To complete this lab exercise, write a description about what you learned
about the following topics. Use one or two paragraphs to describe each
topic. Include figures that you produced to help explain each topic.
However, please be paper conscious. Save the forests. See
GreenPeace
.
 ISI
 Nyquist's criterion
 Nyquist pulses
 Eye and scatter diagrams
 Channel noise and its effect on the eye and scatter diagrams
 ISI due to overlapping pulses and its effect on the eye and scatter diagrams
 Timing offset and its effect on eye and scatter diagrams

Sampling receiver
t
= [0:length(impulsetrain)1].'/100;
subplot(211); plot(t,impulsetrain); axis([0 10 1.2 1.2]);
title('Modulated Impulse Train');
xlabel('Time (seconds)');
subplot(212); plot(t,pulsetrain); axis([0 10 1.2 1.2]);
title('Modulated Pulse Train');
xlabel('Time (seconds)');
Experiments with interfering pulses
hspulse = sin(pi*[0:0.01:2]/2);
function y = rcpuls(a,t)
tau = 1; % Set the symbol time
t = t + 10^(7); % This avoids dividing by zero
tpi = pi/tau; atpi = tpi*a;
at = 4*a^2/tau^2;
y = sin(tpi*t).*cos(atpi*t)./(tpi*t.*(1at*t.^2));
rcpulse = rcpuls(.3,[6:0.01:6]);
Additive Noise Channel
Note the effect of noise is to turn the clean pulse train waveform (see
previous plot) into a fuzzy pulse train waveform. The amount of "fuzz"
on the waveform depends on the variance parameter that you set in the Gaussian
Noise Generator Parameter dialog box. We used a variance of 0.001
before. If instead we used 0.05, then the received waveform would
look like this.
As you can see, noise is bad and effects the samples taken by the sampling
receiver.
Plot the eye diagrams and scatter plots in each case. They should look something like this. Note that the eye diagrams for Nyquist pulses pass through the symbols at the center of the eye diagram. The scatter plots are the samples of the eye diagrams at the center. For Nyquist pulses, the eye is open and the scatter plots contain only symbols. For nonNyquist pulses, the eye diagrams closes and the samples shown in the scatter plot are not symbols.