Final Assignemnt Eng1060 2013S1 Copy

4
ENG1060 Assignment Page 1 of 4 ENG1060 ASSIGNMENT Due Date: Week 11 Friday 6pm Late submissions will suffer a 50% penalty to the assignment mark. Late submissions only allowed until 9am, Monday, Week 12. This assignment should be completed INDIVIDUALLY. Plagiarism will result in a mark of zero. Plagiarism includes letting others copy your work and using code without citing the source. If a part of your code is written in collaboration with classmates, say so in your comments and clearly state the contributions of each person. I NSTRUCTIONS Download template.zip from Moodle and update the M-Files named q1a.m, q1b.m etc with your assignment code. DO NOT rename the M-Files in the template or modify run_all.m. Check your solutions to Q1 and Q2 by running run_all.m. S UBMITTING YOUR A SSIGNMENT Submit your assignment online using Moodle. You must include the following attachments: 1) An assignment cover sheet with your name and ID (do not include this in (2) zip file) 2) A ZIP file named after your student ID (NOT .rar or any other format) containing the following: a. Solution M-Files for assignment tasks named: q1a.m, q1b.m etc… b. Any additional function files required by your M-Files (euler function etc) c. All data files needed to run the code, including the input data provided to you Follow “ENG1060 Assignment ZIP file instructions.pdfto prepare your zip file for submission. We will extract (unzip) your ZIP file and mark you based on the output of run_all.m. It is your responsibility to ensure that everything needed to run your solution are included in your ZIP file. MARKING S CHEME This assignment is worth 10% (1 Mark == 1%). Code will be graded using the following criteria: 1) run_all.m produces results automatically (no additional user interaction needed) 2) Your code produces correct results (printed values, plots, etc) and is well written. A SSIGNMENT HELP 1) You can ask questions in the Discussion Board on Moodle 2) Hints and additional instructions are provided as comments in the assignment template M-Files 3) Hints may also be provided during lectures

Transcript of Final Assignemnt Eng1060 2013S1 Copy

Page 1: Final Assignemnt Eng1060 2013S1 Copy

ENG1060 Assignment Page 1 of 4

ENG1060 ASSIGNMENT Due Date: Week 11 Friday 6pm

Late submissions will suffer a 50% penalty to the assignment mark. Late submissions only allowed until 9am, Monday, Week 12.

This assignment should be completed INDIVIDUALLY. Plagiarism will result in a mark of zero.

Plagiarism includes letting others copy your work and using code without citing the source. If a

part of your code is written in collaboration with classmates, say so in your comments and clearly

state the contributions of each person.

INSTRUCTIONS Download template.zip from Moodle and update the M-Files named q1a.m, q1b.m etc with your assignment code. DO NOT rename the M-Files in the template or modify run_all.m. Check your solutions to Q1 and Q2 by running run_all.m.

SUBMITTING YOUR ASSIGNMENT Submit your assignment online using Moodle. You must include the following attachments: 1) An assignment cover sheet with your name and ID (do not include this in (2) zip file) 2) A ZIP file named after your student ID (NOT .rar or any other format) containing the following:

a. Solution M-Files for assignment tasks named: q1a.m, q1b.m etc… b. Any additional function files required by your M-Files (euler function etc) c. All data files needed to run the code, including the input data provided to you

Follow  “ENG1060 Assignment ZIP file instructions.pdf” to prepare your zip file for submission.

We will extract (unzip) your ZIP file and mark you based on the output of run_all.m. It is your responsibility to ensure that everything needed to run your solution are included in your ZIP file.

MARKING SCHEME This assignment is worth 10% (1 Mark == 1%). Code will be graded using the following criteria: 1) run_all.m produces results automatically (no additional user interaction needed) 2) Your code produces correct results (printed values, plots, etc…) and is well written.

ASSIGNMENT HELP 1) You can ask questions in the Discussion Board on Moodle 2) Hints and additional instructions are provided as comments in the assignment template M-Files 3) Hints may also be provided during lectures

Page 2: Final Assignemnt Eng1060 2013S1 Copy

ENG1060 Assignment Page 2 of 4

QUESTION 1 [3 MARKS]

Assuming that you are part of a project team in a Mobile company, your project is focusing on the following wireless mobile communications between a base station and a mobile handset.

Fig 1 A basic Demonstration of Wireless Mobile Communication System Assume that the base station is transmitting a set of binary bits x = [1 0 0 1 1] to the mobile handset. Firstly, at the transmitter, the Telecom engineers will modulate the binary bits using a Digital

Modulator. The purpose of this (‘modulation’) is to make the sequence easily transmitted and well interfaced to the channel. The function of a digital modulator is to map the digit 0 to -1; and the

digit 1 to 1, as illustrated in Fig 1 (1). When we transmit the signal over the channel, the signal is corrupted by the surrounding noise, which can be modeled as a sequence of random real numbers. Then the received signal will be the

(element-by-element) sum of transmitted signal and noise, i.e., [-1.8147 -0.0942 -0.8730 1.9134 1.6324], as shown in Fig 1 (2). Then the power level of the received signal will be each received element taking power of 2, i.e., P=[1.8147^2, (-0.0942)^2, (-0.8730)^2, 1.9134^2, 1.6324^2]. Then we represent power level in decibels (dB) by taking 10*log10 of each element in P. Q1a) Now following the above example, we transmit a set of 100 binary bits from the base station to mobile handset, and the transmitted data is saved to the file transmitted_bits.txt. The surrounding

Transmitted Binary Seq. [1 0 0 1 1]

Digital Modulator

Transmitted Signal [1 -1 -1 1 1]

Transmitter Site at Base station (1)

Transmitted Signal [1 -1 -1 1 1]

+

Noise (random real numbers): [0.8147 0.9058 0.1270 0.9134 0.6324]

Received Signal [1.8147 -0.0942 -0.8730 1.9134 1.6324]

Received signal at Mobile Handset (2)

Page 3: Final Assignemnt Eng1060 2013S1 Copy

ENG1060 Assignment Page 3 of 4

noise is given in the file surround_noise.txt. Write a MATLAB code that will address the following requests: Firstly, Load transmitted_bits.txt and surround_noise.txt data into MATLAB. Then modulate the bits to be either +1 or -1, strictly based on the function of the modulator: 0 becomes -1 and 1 stays 1. Plot the modulated sequence (x-axis is the bit number varying from 1 to 100; y-axis is the modulated sequence) using red circle data marker (No Lines are used in this plot). Add xlabel using ‘Bit

Number’, and ylabel  using  ‘Modulated  Signal  Level’.  Finally  add  title  ‘transmitted  signal’.

Q1b) Compute the received signal by summing the modulated sequence and the surrounding noise. Then we perform the demodulation process: First, let us “demap” the received signal (i.e.,  use  ‘-1’  to  represent  negative  received signal, use  ‘+1’  to represent positive one). Then we compare this sequence with modulated sequence from Q1a.

Compare both sequences and find how many places in the two sequences are different. Then use

fprintf with %d to print out this difference; and start a new line after the print out.

Q1c) Compute the power level of the received signal in decibels (dB). Plot the power level in a

figure (x-axis is the bit number varying from 1 to 100; y-axis is the power level) using black dot data

marker and black solid line. In  this  plot,  add  labels  (‘Bit Number’  and  ‘Power Level’  are  xlabel  and  ylabel,   respectively).   Then   add   title   ‘Received Signal   Power   Level’. Finally compute the mean of power level (dBs) of the received signal. Print out this result using fprintf command and the print-out format should be a floating point number with two decimals and start a new line after this print out.

QUESTION 2 [6 MARKS]

You are investigating the Type A Influenza Virus infection within the global community. Your investigation analyzes the epidemic curve based on historical data. Historical data of number of influenza viruses detected across the globe is available from the World Health Organization (WHO) database  at  “http://apps.who.int/gho/data/node.main.173?lang=en”.  The  data  files  are  provided  in  Moodle in CSV format. The file names are self-explanatory. q2a) Read the weekly data of number of type A influenza viruses and number of H1N1 influenza viruses detected from 1995 – 2013 into MATLAB. Plot the total number of type A influenza viruses

detected (blue solid line with a width of 2) and number of H1N1 (red solid line) influenza viruses

detected on the same figure.

q2b) Extract the data for the first H1N1 outbreak by visual inspection. Fit the extracted data to a generalized bell shape curve given below. Your program should automatically identify the maxima, (posmax, nmax), of the data during the first outbreak period and iteratively find the parameters (width and slope) that give a good fit. The search range for width and slope is, but not limited to, [1, 10].

Page 4: Final Assignemnt Eng1060 2013S1 Copy

ENG1060 Assignment Page 4 of 4

𝑛(𝑥) =

⎩⎪⎨⎪⎧

𝑛1 +

∗ 𝑥 ≤ 𝑝𝑜𝑠

𝑛1 +

∗ 𝑥 ≥ 𝑝𝑜𝑠

Plot the original data (blue asterisks) and the best fit curve (black solid line) on the same figure.

Print the parameters (posmax, nmax, width, slope) in the figure title.

q2c) The Susceptible-Infected-Recovered Model given below can be used to describe a mild, short-lived epidemic with the assumption of a closed population. The following assumptions were made due to limited knowledge on the newly discovered H7N9 virus.

a) The susceptible population is those who possibly have contacts with an infected individual. b) The infected population includes those who contain the virus and can spread to the

susceptible population. c) The recovered population is those who will not be infected again. The death and the

recovered individuals are considered as part of the recovered population as they will not be infected or be able to infect others.

𝑑𝑆𝑑𝑡 = −𝛽𝑆𝐼;  𝑑𝐼𝑑𝑡 = 𝛽𝑆𝐼 − 𝑟𝐼;  𝑑𝑅𝑑𝑡 = 𝑟𝐼;

Read the daily data of the newly discovered H7N9 virus into MATLAB. Make sure that your program can handle any number of rows. Identify the parameters, 𝛽 and r, that gives an ODE solution that best fit the H7N9 data using iterative method. Typical value for 𝛽 is a fraction of thousandth(s) (0.00x) and r is a fraction of tenth(s) (0.x). Solving a system of ODE is as simple as solving multiple ODEs using a single loop. The initial conditions are S(0) = 150, I(0) = 1 and R(0) = 0. Plot the H7N9

data (dots) and the ODE solutions (solid line) in a same figure. Print the value of the parameters (𝛽 and r) in the figure title.

q2d) Based on the results simulated by the ODE above, determine when the assumed short-lived epidemic will reach its peak (maximum infected individuals) and when it will ends (zero infected individuals). Print your findings in the Command Window.

Good Programming Practices (Coding style and Comments) [1 Mark]

(END OF ASSIGNMENT)