LnC1060 AsslgnmenL Þage 1 of 4

!"#$%&% ())*#"+!",
Due Date: Week 11 Ir|day 6pm
Late subm|ss|ons wlll suffer a 30° penalLy Lo Lhe asslgnmenL mark. LaLe submlsslons only allowed
unLll 9am, Monday, Week 12.

1h|s ass|gnment shou|d be comp|eted INDIVIDUALL¥. Þ|ag|ar|sm w||| resu|t |n a mark of zero.
Þ|ag|ar|sm |nc|udes |ett|ng others copy your work and us|ng code w|thout c|t|ng the source. If a
part of your code |s wr|tten |n co||aborat|on w|th c|assmates, say so |n your comments and c|ear|y
state the contr|but|ons of each person.
*"),-./,*0")
uownload !"#$%&!"'()$ from Moodle and updaLe Lhe M-llles named +,&'#, +,-'# eLc wlLh
your asslgnmenL code. uC nC1 rename Lhe M-llles ln Lhe LemplaLe or modlfy ./01&%%'#. Check
your soluLlons Lo C1 and C2 by runnlng ./01&%%'#.
).1+*,,*"# 20.- ())*#"+!",
SubmlL your asslgnmenL onllne uslng Moodle. ?ou musL lnclude Lhe followlng aLLachmenLs:
1) An asslgnmenL cover sheeL wlLh your name and ID (do noL lnclude Lhls ln (2) zlp flle)
2) A 2IÞ flle named afLer your sLudenL lu (NC1 .rar or any other format) conLalnlng Lhe followlng:
a. SoluLlon M-llles for asslgnmenL Lasks named: +,&'#, +,-'# etc…
b. Any addlLlonal funcLlon flles requlred by your M-llles (euler funcLlon eLc)
c. All daLa flles needed Lo run Lhe code, |nc|ud|ng the |nput data prov|ded to you
Follow “LNG1060 Ass|gnment 2IÞ f||e |nstruct|ons.pdf” Lo prepare your zlp flle for submlsslon.

We wlll exLracL (unzlp) your ZlÞ flle and mark you based on Lhe ouLpuL of ./01&%%'#. lL ls your
responslblllLy Lo ensure LhaL everyLhlng needed Lo run your soluLlon are lncluded ln your ZlÞ flle.
+(-3*"# )/4!+!
1hls asslgnmenL ls worLh 10° (1 Mark == 1°). Code wlll be graded uslng Lhe followlng crlLerla:
1) ./01&%%'# produces resulLs automat|ca||y (no addlLlonal user lnLeracLlon needed)
2) ?our code produces correcL resulLs (prlnLed values, ploLs, eLc…) and ls well wrlLLen.
())*#"+!", 4!56
1) ?ou can ask quesLlons ln Lhe ulscusslon 8oard on Moodle
2) PlnLs and addlLlonal lnsLrucLlons are provlded as commenLs ln Lhe asslgnmenL LemplaLe M-llles
3) PlnLs may also be provlded durlng lecLures
LnC1060 AsslgnmenL Þage 2 of 4
7.!),*0" $ 89 +(-3):
Assumlng LhaL you are parL of a pro[ecL Leam ln a Moblle company, your pro[ecL ls focuslng on Lhe
followlng wlreless moblle communlcaLlons beLween a base sLaLlon and a moblle handseL.
























llg 1 A baslc uemonsLraLlon of Wlreless Moblle CommunlcaLlon SysLem

Assume LhaL Lhe base sLaLlon ls LransmlLLlng a seL of blnary blLs x = [1 0 0 1 1] Lo Lhe moblle handseL.
llrsLly, aL Lhe LransmlLLer, Lhe 1elecom englneers wlll modu|ate Lhe blnary blLs uslng a D|g|ta|
Modu|ator. 1he purpose of Lhls (‘modu|at|on’) ls Lo make Lhe sequence easlly LransmlLLed and well
lnLerfaced Lo Lhe channel. 1he funct|on of a d|g|ta| modu|ator |s to map the d|g|t 0 to -1, and the
d|g|t 1 to 1, as lllusLraLed ln llg 1 (1).

When we LransmlL Lhe slgnal over Lhe channel, Lhe slgnal ls corrupLed by Lhe surroundlng nolse,
whlch can be modeled as a sequence of random real numbers. 1hen Lhe rece|ved s|gna| wlll be the
(e|ement-by-e|ement) sum of transm|tted s|gna| and no|se, l.e., [-1.8147 -0.0942 -0.8730 1.9134
1.6324], as shown ln llg 1 (2). 1hen Lhe power |eve| of the rece|ved s|gna| wlll be each recelved
elemenL Laklng power of 2, l.e., Þ=[1.8147^2, (-0.0942)^2, (-0.8730)^2, 1.9134^2, 1.6324^2].
1hen we represenL power level ln declbels (d8) by Laklng 10*log
10
of each elemenL ln Þ.

Ç1a) now followlng Lhe above example, we LransmlL a seL of 100 b|nary b|ts from Lhe base sLaLlon Lo
moblle handseL, and Lhe LransmlLLed daLa ls saved Lo Lhe flle transm|tted_b|ts.txt. 1he surroundlng


1ransmlLLed 8lnary
Seq. [1 0 0 1 1]
ulglLal
ModulaLor
1ransmlLLed Slgnal
[1 -1 -1 1 1]
1ransmlLLer SlLe aL 8ase sLaLlon
(1)
1ransmlLLed Slgnal
[1 -1 -1 1 1]

+
nolse (random real numbers):
[0.8147 0.9038 0.1270 0.9134 0.6324]
8ecelved Slgnal
[1.8147 -0.0942 -0.8730 1.9134 1.6324]
8ecelved slgnal aL Moblle PandseL
(2)


LnC1060 AsslgnmenL Þage 3 of 4
nolse ls glven ln Lhe flle surround_no|se.txt. WrlLe a MA1LA8 code LhaL wlll address Lhe followlng
requesLs:

llrsLly, Load LransmlLLed_blLs.LxL and surround_nolse.LxL daLa lnLo MA1LA8. 1hen modu|ate Lhe blLs
Lo be elLher +1 or -1, sLrlcLly based on Lhe funcLlon of Lhe modulaLor: 0 becomes -1 and 1 sLays 1.
Þ|ot the modu|ated sequence (x-axls ls Lhe blL number varylng from 1 Lo 100, y-axls ls Lhe modulaLed
sequence) uslng red c|rc|e data marker (No L|nes are used |n th|s p|ot). Add x|abe| us|ng ‘8|t
Number’, and ylabel using ‘Modulated Signal Level’. Finally add title ‘transmitted signal’.

Ç1b) CompuLe Lhe recelved slgnal by summlng Lhe modulaLed sequence and Lhe surroundlng nolse.
1hen we perform Lhe demodu|at|on process:
llrsL, leL us “demap” Lhe recelved slgnal (i.e., use ‘-1’ to represent negative recelved slgnal, use ‘+1’
Lo represenL poslLlve one). 1hen we compare Lhls sequence wlLh modu|ated sequence from Ç1a.
Compare boLh sequences and flnd how many places ln Lhe Lwo sequences are dlfferenL. 1hen use
fpr|ntf w|th ¼d to pr|nt out th|s d|fference, and start a new ||ne after the pr|nt out.

Ç1c) CompuLe Lhe power |eve| of Lhe recelved slgnal ln declbels (d8). ÞloL the power |eve| |n a
f|gure (x-axls ls Lhe blL number varylng from 1 Lo 100, y-axls ls Lhe power level) us|ng b|ack dot data
marker and b|ack so||d ||ne. In this plot, add labels (‘8|t Number’ and ‘Þower Leve|’ are xlabel and
ylabel, respectively). Then add title ‘kece|ved Signal Power Level’. llnally compuLe Lhe mean of
power |eve| (d8s) of Lhe recelved slgnal. ÞrlnL ouL Lhls resulL uslng fprlnLf command and Lhe prlnL-ouL
formaL should be a f|oat|ng po|nt number w|th two dec|ma|s and start a new ||ne afLer Lhls prlnL ouL.

7.!),*0" ; 8& +(-3):
?ou are lnvesLlgaLlng Lhe 1ype A lnfluenza vlrus lnfecLlon wlLhln Lhe global communlLy. ?our
lnvesLlgaLlon analyzes Lhe epldemlc curve based on hlsLorlcal daLa. PlsLorlcal daLa of number of
lnfluenza vlruses deLecLed across Lhe globe ls avallable from Lhe World PealLh CrganlzaLlon (WPC)
database at “hLLp://apps.who.lnL/gho/daLa/node.maln.173?lang=en”. The data files are provided in
Moodle ln CSv formaL. 1he flle names are self-explanaLory.

q2a) 8ead Lhe weekly daLa of number of Lype A lnfluenza vlruses and number of P1n1 lnfluenza
vlruses deLecLed from 1993 – 2013 lnLo MA1LA8. Þ|ot the tota| number of type A |nf|uenza v|ruses
detected (b|ue so||d ||ne w|th a w|dth of 2) and number of n1N1 (red so||d ||ne) |nf|uenza v|ruses
detected on the same f|gure.

q2b) LxLracL Lhe daLa for Lhe flrsL P1n1 ouLbreak by vlsual lnspecLlon. llL Lhe exLracLed daLa Lo a
generallzed bell shape curve glven below. ?our program should auLomaLlcally ldenLlfy Lhe maxlma,
(pos
max
, n
max
), of Lhe daLa durlng Lhe flrsL ouLbreak perlod and lLeraLlvely flnd Lhe parameLers (wldLh
and slope) LhaL glve a good flL. 1he search range for wldLh and slope ls, buL noL llmlLed Lo, [1, 10].
LnC1060 AsslgnmenL Þage 4 of 4
() =






mux
1 +[
x-pos
mcx
wìdthL
¸
2∗sIopcL

mux

mux
1 +[
x-pos
mcx
wìdthR
¸
2∗sIopcR

mux



Þ|ot the or|g|na| data (b|ue aster|sks) and the best f|t curve (b|ack so||d ||ne) on the same f|gure.
Þr|nt the parameters (pos
max
, n
max
, w|dth, s|ope) |n the f|gure t|t|e.

q2c) 1he SuscepLlble-lnfecLed-8ecovered Model glven below can be used Lo descrlbe a mlld, shorL-
llved epldemlc wlLh Lhe assumpLlon of a closed populaLlon. 1he followlng assumpLlons were made
due Lo llmlLed knowledge on Lhe newly dlscovered P7n9 vlrus.
a) 1he suscepLlble populaLlon ls Lhose who posslbly have conLacLs wlLh an lnfecLed lndlvldual.
b) 1he lnfecLed populaLlon lncludes Lhose who conLaln Lhe vlrus and can spread Lo Lhe
suscepLlble populaLlon.
c) 1he recovered populaLlon ls Lhose who wlll noL be lnfecLed agaln. 1he deaLh and Lhe
recovered lndlvlduals are consldered as parL of Lhe recovered populaLlon as Lhey wlll noL be
lnfecLed or be able Lo lnfecL oLhers.

= −;

= −;

= ;
8ead Lhe dally daLa of Lhe newly dlscovered P7n9 vlrus lnLo MA1LA8. Make sure LhaL your program
can handle any number of rows. ldenLlfy Lhe parameLers, and !, LhaL glves an CuL soluLlon LhaL
besL flL Lhe P7n9 daLa uslng lLeraLlve meLhod. 1yplcal value for ls a fracLlon of LhousandLh(s)
(0.00x) and ! ls a fracLlon of LenLh(s) (0.x). Solvlng a sysLem of CuL ls as slmple as solvlng mulLlple
CuLs uslng a slngle loop. 1he lnlLlal condlLlons are S(0) = 130, l(0) = 1 and 8(0) = 0. Þ|ot the n7N9
data (dots) and the CDL so|ut|ons (so||d ||ne) |n a same f|gure. Þr|nt the va|ue of the parameters (
and !) |n the f|gure t|t|e.

q2d) 8ased on Lhe resulLs slmulaLed by Lhe CuL above, deLermlne when Lhe assumed shorL-llved
epldemlc wlll reach lLs peak (maxlmum lnfecLed lndlvlduals) and when lL wlll ends (zero lnfecLed
lndlvlduals). Þr|nt your f|nd|ngs |n the Command W|ndow.



#<<= 6><?>@AABC? 6>@DEBDFG H/<=BC? GEIJF @C= /<AAFCEGK 8$ +@>L:


H!"M 0N ())*#"+!",K