EEET2369 – Signals and Systems 1: Assignment 2
- Assignments should be submitted to Blackboard using the eReport
Submission link no later than 11:59 pm on Friday 26th May 2017 (end of
week 12). A 5% penalty per day late applies (including weekends).
- Assignments MUST be submitted in either Word format (.doc or .docx)
or portable document format (.pdf). Due to compatibility issues reports in
other formats including (but not limited to) Open Office format (.odt) or
Mac OS format (.pages) WILL NOT BE ACCEPTED!
- The assignment is an individual task and is worth 10% of the overall
course mark.
- The assignment should be presented as follows:
1. Page 1: Cover Page (example):
RMIT University
School of Engineering
EEET2369 – Signals and Systems 1
Assignment #2
Lecturer: Dr. Katrina Neville
Student Name: …….. Student Number: ………
Submission Due Date: …….
2. Page 2 onwards:
3. Answers to questions with appropriate predictions, calculations,
MATLAB graphs and discussions.
4. References: Any sources used to find out more information. I.e.
textbooks, journal/conference papers, websites, etc. must be in
IEEE style format.
5. Appendix: MATLAB code and other results and calculations.
The assignment will be assessed on the depth of conceptual understanding
shown for each task. It is important not only to present correct results/
graphs/code but also to be able to analyse and discuss what your results are
showing and how they link in with the concepts behind FIR and IIR filters.Assignment 2: FIR & IIR Filters in Stock Market Analysis
This assignment is going to examine how digital filtering techniques can be applied to stock
market analysis. To start with, a simple moving average (SMA) filter will be designed and
applied to the closing prices of different companies (based on your student number).
Secondly a more complex exponential moving average (EMA) filter will be developed and
compared to the SMA.
a) In stock market analysis the simple moving average (SMA) filter (a.k.a running
average filter) is often used to smooth out stock prices, this effectively removes any
‘noise’ from the data and gives clearer indications of trend.
The SMA filter can be applied to short term stock prices (i.e. over a few days or
weeks), this will give an output with more fluctuations but one that will more closely
reflect the trends in the stock market. Alternatively the SMA filter can be applied over
a longer-term (i.e. many weeks or months) this gives a smoother output, but there will
be delays in the filter ‘catching up’ with the trend when significant changes in market
conditions occur.
In MATLAB you will design an SMA filter with the following impulse response:
[ ] n k
L
h n
L k
= ∑ −
− =
1 0
1
[ ] δ
You will then use this to filter the closing prices of stocks for the following companies
(based on the 5th number in your student number):
Student
Number
Company (and Excel file containing stock prices)
1 Seven West Media Ltd. (SevenWest.xlsx)
2 Crown Resorts Ltd. (Crown.xlsx)
3 Newcrest Mining Ltd. (Newcrest.xlsx)
4 Commonwealth Bank of Australia (CBA.xlsx)
5 Nine Entertainment Co. Holdings (Nine.xlsx)
6 National Australia Bank Ltd. (NAB.xlsx)
7 Lendlease Group (Lendlease.xlsx)
8 Westfield Corporation Ltd. (Westfield.xlsx)
9 BlueScope Steel Ltd. (Bluescope.xlsx)
0 Cochlear Ltd (Cochlear.xlsx)
Table 1: Company and Excel file containing stock prices
- For example if your student number was 3210987 you will analyse the closing prices
of stocks for BlueScope Steel Ltd.
- Manually work out (neatly typed) the general transfer function and difference
equation for a running average filter of length (L). Also sketch the general impulse
response of this filter.
- In MATLAB create a short-term SMA filter (~5 days) and a longer-term SMA filter
(~20 days) and apply these to the closing prices of your stocks (use MATLAB’s
filter() function to do this). Plot the outputs in MATLAB.Discuss:
1. How well do these two filters smooth the stock price data?
2. Compare the delay in the two methods. For both filters, how many initial
output samples/data points should be discarded before a reliable indication of
trend can be obtained from this output? Why is this the case?
3. Use the MATLAB freqz() function on these two filters. Do they behave as
low-pass, high-pass, band-pass or band-stop filters? How does the length of
the filter affect the passband region (frequencies that the filter passes)?
b) Another type of filter used in stock market analysis is the exponential moving
average (EMA) filter, whereas the SMA filter behaved as an FIR filter the EMA
filter is effectively an IIR filter with an impulse response of:
h[n] = α ((1 − α )n u[n])
Where
1
2 +
=
L
α and L is the length of time you’re interested in analysing (and how
quickly the impulse response will exponentially decay).
The EMA filter places more weight on the most recent stock prices, this allows the
filter output to react quicker to changes in market trends.
Again the EMA filter can be a short-term or long-term filter and is often used to
indicate to traders the best times to buy and sell stocks; generally if a short-term
average line crosses above a long-term average line this indicates a good time to buy
stocks, when the short-term average line crosses below the long-term average line this
indicates a good time to sell stocks.
- Again manually work out (neatly typed) the general transfer function and difference
equation for this EMA filter (you’ll need to perform a z-transform on the impulse
response to obtain this information, check the section on ‘Inverse z-Transform’ in
lecture 11 for information on how to do this).
- In MATLAB create a short-term EMA filter (~5 days) and a longer-term EMA filter
(~20 days) and again apply these to the closing prices of your stocks (use the filter’s
transfer function (not impulse response) together with MATLAB’s filter()
function to do this). Plot the outputs in MATLAB.
Discuss:
1. Compare the behaviour of the EMA filters with the SMA filters from part a.
2. Using these long and short-term average lines, identify the times when it
would have been good to buy and sell stocks in your company. Justify your
answer from the explanation at:
http://www.asx.com.au/prices/exponential_moving_average.htm
3. Again use the MATLAB freqz() function on these two filters and examine
their frequency responses.Assessment Guide For Signals and Systems Assignment
0-49 Fail
NN
50-59 Pass
PA
60-69 Credit
CR
70-79 Distinction
DI
80-100 High Distinc’n
HD
Results (e.g. MATLAB
figures/output) (30%)
No results presented or
there are fundamental
flaws in the student’s
understanding of the
task and/or MATLAB
code resulting in
meaningless results.
Some results are
correct but many of the
graphs contain errors
resulting from poor
understanding of the
task and/or MATLAB
syntax errors.
Results are mostly
correct.
There may be a couple
of graphs that contain
minor errors and/or
section contains
superfluous or irrelevant
results.
Results presented are
correct.
Minimum required
results presented to
successfully answer
assignment questions.
All results presented in
the report are correct
and well presented.
Student may also have
included extra (relevant)
results to help explain
advanced concepts
relating to the project.
Discussion and
analysis (50%)
No relevant analysis
has been presented in
report.
Student was unable to
make links to theoretical
concepts related to the
topic and may have
included irrelevant facts
to explain results.
Analysis presented in
the report was
superficial and only very
basic links were made
to the theoretical
concepts related to the
topic. Overall student
appears to lack in-depth
understanding.
A reasonable analysis
of the results has been
presented, but it may
lack some depth.
Links have been made
to theoretical concepts
relating to the topic, but
may lack essential
details.
A good analysis of
results has been
presented with only
minor details missing.
Student was able to
make links to theoretical
concepts relating to the
topic to explain results.
Student has presented
an in-depth analysis of
their results and has
made links to advanced
theoretical concepts
relating to the topic to
explain results.
Referencing and
citations (10%)
Poor referencing style
or no references used.
Material may be copied
without citing sources
appropriately.
References were
inappropriate and/or
lacked relevancy (e.g.
Wikipedia or opinion
pieces used).
Citations may be
missing.
References are mostly
appropriate and show
some variation in type.
A good attempt has
been made at using the
IEEE reference format
with only minor errors.
References used are all
appropriate and show
good variation in type.
IEEE referencing format
used correctly with very
few errors.
Has used a wide range
of appropriate
references.
IEEE referencing format
used flawlessly.
Layout (10%) No structure or
structure is highly
disorganised.
Poor use of grammar,
and punctuation. Poor
layout and difficult to
read.
Structure is sufficient to
present the content.
Ideas often presented in
a disorganised manner.
Grammar and spelling
just acceptable.
Content is generally
organised logically with
only some sections
needing more attention.
Few errors in spelling
and grammar, report
easy to navigate.
Structure is sound
throughout and follows
a logical order.
No errors in spelling
and grammar, report
clearly organised.
Outstanding
presentation of material
which supports all
requirements.
Outstanding and
professional use of
language.