##### Personal tools
•
You are here: Home Digital Modulation, Sampling Receiver, Nyquist Criterion, Intersymbol Interference, Pulse Shapes

# 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

1. Open a new simulink model.
2. 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 -> Discrete-Time Eye Diagram Scope
• Comm Blockset -> Comm Sinks -> Discrete-Time 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 -> Real-Imag to Complex
• Math Operations -> Sum
• Look-Up Tables - Look-Up Table

3. 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 one-half as shown below.  Setting the sample time to 1 means that this source will output one bit each second.  What is the bit rate?

4. Create the look up table that will convert bits {0,1} to symbols {-1, +1}.  Use the Look-Up 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?

5. 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 continuous-time part of this simulation is 100 Hz (or 100 samples per second).
6. Connect a Signal To Workspace block to the output of the upsampler so that you can examine the impulse train in Matlab.
7. 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.

8. The completed model should look like this.

9. 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.
10. Set the Solver options Type to Fixed-step.
11. Run the simulation.
12. Plot the impulsetrain and pulsetrain signals in Matlab.  Here's the commands that I used and the plots are shown below.
13. 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)');

14. 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.
15. Experiments with interfering pulses

16. 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.

17. Leave everything else the same and run the simulation.
18. 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.

19. 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.
20. 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).
22. Change the impulse response of the Discrete Filter as shown below.

23. The pulse shape extends over four symbol periods as shown below.

24. Run the simulation.
25. The impulse and pulse trains now look like this.  As before, the delay has been removed.  Note the severity of the ISI now.

26. Now lets consider some Nyquist pulses.  Generate the half-sine (HS) pulse by typing the following at the Matlab prompt.
27. hspulse = sin(pi*[0:0.01:2]/2);

28. 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.

29.  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.

30. Next let's try a raised cosine (RC) pulse with 30% excess bandwidth.
31. 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...
32. 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.*(1-at*t.^2));

33. Now create an RC pulse by entering the following at the Matlab prompt.
34. rcpulse = rcpuls(.3,[-6:0.01:6]);

35. 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.

36. 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.

37. So you see that effective detection with the sampling receiver is possible, even with overlapping pulses, provided the pulses satisfy Nyquist's criterion.
38. 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.

40. Let's simulate a channel that adds zero-mean 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.

41. Set the parameters of the Gaussian Noise Generator as shown below.

42. Capture the received signal output with a Signal To Workspace block.
43. Run the simulation and plot the received signal.  Over the first ten seconds, it looks like this.

44. 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.

45. 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.

47. Set the parameters to the Discrete-Time Eye Diagram Scope and Discrete-Time Scatter Diagram Scope as follows.
48.

49. Run the simulation.  Two windows will pop up:  The "Eye Diagram" and the "Scatter Plot". We will discuss these diagrams in class.
50.

51. 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 non-Nyquist isipulse used above.

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 non-Nyquist pulses, the eye diagrams closes and the samples shown in the scatter plot are not symbols.

52. Next we want to experiment with timing offset.  Change the impulse response of the transmit filter back to the RC pulse.
53. 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.

54. The full system model should now look something like this.  The new delay filter is indicated.

55. 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.
56.

57. 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.
58.

59. 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