Lab sheet1

advertisement
Telecom. B by Dr. Mohab Mangoud
ENB7060
TELECOMMUNICATIONS B
LABORATORY SHEET 1
Name:- (Type Your Name Here)
Student ID :- (Type Your Student ID Here)
Objective
The objective of this assignment is to become more familiar with matlab communications
toolbox, Simulink and generating digital and random signals
Learning Outcome:
This lab assignment satisfies the learning outcome #1, which is, to evaluate and compare
different modulation techniques
Apparatus

MatLab installed on PC in Lab
Method
This lab has been designed to simulate and plot different digital, determinstic and random
electronic signals. Read this document carefully and insert the information required where
indicated. This document is to be submitted to the tutor by hardcopy next lab period and
also by email in the due time announced.
Marking Scheme
Assignment I
Assignment II
Assignment III
Assignment IV
Assignment V
Conclusions + Discussion
Total
Marks
Assigned
10
20
20
20
20
10
100
1
Telecom. B by Dr. Mohab Mangoud
Representation of Digital and Random
Signals in Matlab and Simulink
Objectives
The main objectives of this experiment are:
PART I
to learn how to generate Random signals using MATLAB.
PART II
to getting familiar with SIMULINK and demonstrate how to use it to
simulate simple digital transmission system.
Laboratory Procedure
Every communication system has one or more signal sources. This lab describes
how to use communications toolbox to generate random signals, which are useful for
simulating noise, errors, or signal sources as follows.
A. “White Gaussian Noise”
B. “Random Symbols”
C. “Random Integers”
D. “Random Bit Error Patterns”
2
Telecom. B by Dr. Mohab Mangoud
Part I. Random signals Generation using MATLAB
(Communications Toolbox)
Assignment I
i)
White Gaussian Noise
The wgn function generates random matrices using a white Gaussian noise
distribution. You specify the power of the noise in either dBW (decibels
relative to a watt), dBm, or linear units. You can generate either real or
complex noise.
Y = WGN(M,N,P) generates an M-by-N matrix of white Gaussian noise. P specifies the
power of the output noise in dBW.
Q1. Use the command “WGN” to generate a column vector of length 50 containing real
white Gaussian noise whose power is 2 dBW. The function assumes that the load
impedance is 1 ohm. Show the command and the answers below.
Answer:
3
Telecom. B by Dr. Mohab Mangoud
B. Random Symbols
“randsrc” function generates random matrices whose entries are chosen
independently from an alphabet that you specify, with a distribution that you
specify. A special case generates bipolar matrices.
Q2. Use this command to generate a 5-by-4 matrix whose entries are independently chosen
and uniformly distributed in the set {1,3,5}. (Your results might vary because these are
random numbers.) show the commands and the output below.
Answer:
4
Telecom. B by Dr. Mohab Mangoud
The command “randsrc” can be used to prescribe the skewed distribution
Q3. If you want 1 to be twice (probability of 0.5) as likely to occur as either 2 or 4
(probability of 0.25), Use the command to generate output matrix {b} with three arguments
to generate a 4-by-3 matrix defined in the first two arguments and use a third input
argument with two rows, one of which indicates the possible values of the output (b) {1,2,4}
and the other indicates the probability of each value.
Answer
5
Telecom. B by Dr. Mohab Mangoud
C. Random intergers
The “randint” function generates random integer matrices whose entries are in a range that
you specify. A special case generates random binary matrices.
Q4. Use the command “randint” to generates a 5-by-4 matrix containing random integers
between 2 and 10.
Q5. Repeat the command if your desired range is [0,10] instead of [2,10]
Answer:
6
Telecom. B by Dr. Mohab Mangoud
D. Random bit error patterns
The “randerr” function generates matrices whose entries are either 0 or 1.
However, its options are different from those of randint, because randerr is meant
for testing error-control coding.
Q6. Use the command “ randerr” to generate a 5-by-4 binary matrix, where each row
contains exactly one 1. For example consider a binary code that consist of five four
bit codeword. To introduce exactly one error into each codeword , Add the random
matrix f to the code matrix (modulo 2).
Q7. On the other hand, To introduce one error with probability 0.4 and two errors with with
probability 0.6 to each codeword use the command below. (Note: The probability matrix
that is the third argument of randerr affects only the number of 1s in each row, not their
placement).
Answer:
7
Telecom. B by Dr. Mohab Mangoud
Assignment II
Q1. Plot a sine wave with frequency 10 MHz and signal Power = 10 dB, and add white
Gaussian noise with different noise power = 1, 7 and 10 dB. Check out the original signal
and the noisy signal on the same plot. (use: wgn command)
Q2. Repeat (1) using the function awgn command.
Q3. Generate an equiprobable binary 100 element column vector using all the three
function such as
randsrc
randint
randerr
round(rand … )
Add WGN to it and plot the original stream and the noisy one on top of each
others for different values of noise power.
8
Telecom. B by Dr. Mohab Mangoud
Part II. To demonstrate how to simulate digital transmission
system using MATLAB SIMULINK
Assignment III: Getting Started with SIMULINK
-
Simulate the examples in the attached file to this lab sheet
“getting familiar with Simulink Link.pdf” and also from the web link [1]
[1] http://ece.wpi.edu/courses/es3011/sim/simulink.html
Paste here summary of your model and outputs in less than two pages.
Useful video link: http://www.youtube.com/watch?v=TfXBw51xKr0
9
Telecom. B by Dr. Mohab Mangoud
Assignment VI.
Q1. Simulate the following circuit of PAM Transmission (ON-OFF Keying) example
and show your scope output.
Si ne Wave
Scope
Bernoul l i
Bi nary
Bernoul l i Bi nary
Generator
Swi tch
Ground
10
Telecom. B by Dr. Mohab Mangoud
Assignment V.
Generate two sine waves 10MHz and 10GHz. Also, generate random binary stream using
Bernoulli generator with data rate =1Mbps. Show the three signals on the scope
simultaneously.
11
Telecom. B by Dr. Mohab Mangoud
Conclusions and Discussion:
12
Download