Matlab code
Exercise One reason that digital signal processing (DSP) techniques are so powerful is that they can be used for very different kinds of signals. A computer can process discrete-time signals which are essentially just sequences of numbers. Therefore DSP may be used in a very wide range of applications. Let's look at an example. A stockbroker wants to see whether the average value of a certain stock is increasing or decreasing. To do this, the daily fluctuations of the stock values must be climinated. A popular business magazine recommends three possible methods for computing this average averagovalue(today) averag evalue(today) ? (value(today)+value(yesterday)+value(2 days ago) 0.8 * averagevalue(yesterday) + 0.2 * (value(today) averag value(yesterday) + ? (value(today)-value(3 days ago)) (6) averag evalue(today) Do the following: For each of these three methods, 1) write a difference equation and 2) draw a system diagram. = Load the tab delimited text file stockrates.txt into Matlab using the import data option. This file contains a vector, called "rate", of daily stock market exchange rates for a publicly traded stock. Apply filters (5) and (6) from above to smooth the stock values. When you apply the filter of (5) you will need to initialize the value of averagevalue (yesterday). Use an initial value of 0. Also set previous values of value () in (6) to 0. Use the subplot command to plot the original stock values, the result of filtering with (5), and the result of filtering with (6). Submit your plots of the original and filtered exchange-rates. Discuss the advantages and disadvantages of the two filters. Exercise One reason that digital signal processing (DSP) techniques are so powerful is that they can be used for very different kinds of signals. A computer can process discrete-time signals which are essentially just sequences of numbers. Therefore DSP may be used in a very wide range of applications. Let's look at an example. A stockbroker wants to see whether the average value of a certain stock is increasing or decreasing. To do this, the daily fluctuations of the stock values must be climinated. A popular business magazine recommends three possible methods for computing this average averagovalue(today) averag evalue(today) ? (value(today)+value(yesterday)+value(2 days ago) 0.8 * averagevalue(yesterday) + 0.2 * (value(today) averag value(yesterday) + ? (value(today)-value(3 days ago)) (6) averag evalue(today) Do the following: For each of these three methods, 1) write a difference equation and 2) draw a system diagram. = Load the tab delimited text file stockrates.txt into Matlab using the import data option. This file contains a vector, called "rate", of daily stock market exchange rates for a publicly traded stock. Apply filters (5) and (6) from above to smooth the stock values. When you apply the filter of (5) you will need to initialize the value of averagevalue (yesterday). Use an initial value of 0. Also set previous values of value () in (6) to 0. Use the subplot command to plot the original stock values, the result of filtering with (5), and the result of filtering with (6). Submit your plots of the original and filtered exchange-rates. Discuss the advantages and disadvantages of the two filters