Final Exam Group 2 19042021
Final Exam Group 2 19042021
Final Exam Group 2 19042021
Question 1 (6 marks):
The below table shows the falling trend of Bit Error Rate (BER) with increase in Signal to Noise
Ratio (SNR) for four various modulation schemes, i.e., BPSK, QPSK, 8 QAM and 16 QAM.
SNR: 1 2 3 4 5
BPSK 0.0190 0.0100 0.0046 0.0020 0.0008
QPSK 0.1316 0.0941 0.0630 0.0384 0.0202
(BER)
8 QAM 0.0377 0.0202 0.0096 0.0041 0.0016
16 QAM 0.0478 0.0252 0.0119 0.0049 0.0018
Write a MATLAB script to generate the exact replica of the following plots using the given table.
BIT ERROR PERFORMANCE
10 0
BPSK
QPSK
8QAM
16QAM
-1
10
BER
10 -2
-3
10
10 -4
1 1.5 2 2.5 3 3.5 4 4.5 5
SNR
And
BPSK QPSK
10 -1 10 0
-2
10
BER
-1
10
-3
10
-4 -2
10 10
1 2 3 4 5 1 2 3 4 5
SNR SNR
-1
8 QAM -1
16 QAM
10 10
BER
10 -2 10 -2
10 -3 10 -3
1 2 3 4 5 1 2 3 4 5
SNR SNR
1
Question 2 (8 marks):
Use MATLAB to create Matrix A as follows,
… √1000
𝐴 = (√2 √4 )
1 √3 … √999
Write a code to:
a) Find the average value of the elements in an array once each element of that array is made
by the corresponding product of the 1st row and 2nd row of Matrix A. (Hint: the length of
array is 500).
b) Extract all the elements in the 258th through 264th columns of Matrix A.
c) Extract all the elements in 2nd row and 120th through 125th columns of Matrix A.
d) Create a diagonal matrix of the elements of 1st row of Matrix A, i.e.,
√2 0 0 0
D = 0 √4 0 0
0 0 ⋱ 0
[0 0 0 √1000]
Question 3 (8 marks):
If x = [25; 9; 21; 7; 2; 43; 28; 47; 35; 29], use MATLAB to calculate the value of 𝑟𝑖 based on the
following formula and take the sum of 𝑟𝑖 , where 𝑥̅ is the average of the elements of x.
∑10
𝑖=1(𝑥𝑖 − 𝑥̅ )
𝑟𝑖 = , 𝑖 = 1,2, … ,10;
√∑10
𝑖=1(𝑥𝑖 + 𝑥̅ )
2
Question 4 (8 marks):
For the following differential equation:
6𝑦̈ − 3.6𝑦 = tcos 𝑡 + 𝑒 −3𝑡 + 1.5𝑡 0≤𝑡≤6
where 𝑦̇ (0) = 4.2, 𝑦(0) = −6
It is required to:
a) Show the Simulink model structure to plot the solution of the above differential equation
and show the output plots of 𝑦̈ , 𝑦̇ , 𝑎𝑛𝑑 𝑦 on the same scope (The scope consists of 3 rows
and 1 column).
b) Show the required code to solve the differential equations using the “ode45” solver, and
show the output plots of 𝑦̇ and 𝑦. Note: use suitable legends (i.e., ydot and y).
c) Plot the solution of the equation (𝑦) that is determined from a) and b) on the same figure
(The figure consists of two columns and 1 row, where the Simulink figure will be plotted
on the right). Please show the code used and the output figure with suitable titles (i.e., code
results and Simulink results).
2
Question 5 (10 marks):
The gain (G(s)) of a dynamic vehicle longitudinal model is given in the form of a transfer function
as follows,
𝑉(𝑠) 2.4767
𝐺(𝑠) = =
𝑈(𝑠) (𝑠 + 0.0476)(𝑠 + 5)(𝑠 + 1)
where, 𝑉(𝑠) 𝑎𝑛𝑑 𝑈(𝑠) represent output and input of the vehicle model, respectively.
It is required to:
a) Simplify the transfer function and plot the output open loop response (V) and input (U) of
the dynamic vehicle model on a same scope (the scope has only one port) when a step input
(U) with step time = 1s and amplitude = 1 is applied for 0 ≤ 𝑡 ≤ 100.
b) Now similarly plot the output closed-loop response (V) and input (U) of the vehicle
dynamic model in a negative feedback scenario on a same scope.
c) Add a PID controller to the closed-loop system to enhance the output response (V) and
force it to follow the defined step input (U). The PID controller parameters, i.e., Kp, Ki and
Kd, are obtained by two methods namely, Ziegler Nichols method and genetic algorithm
method. The values are given in the table below.
Method Kp Ki Kd
Ziegler Nichols 7.65 5.54 2.64
Genetic algorithm 3.5907 0.163 3.3021
Show the output response and input signals using both methods.