See other catalogues for
The MathWorks
You may also be interested in
Text version of the page
| | | | | | | | | | |
| | | |
| | | 1 Data Processing | | |
| | | |
| | | vector 6.The output y(n) is a linear combination of current and previous inputs, x(n) x(n - 1)..., and previous outputs, y(n -1) y(n - 2)... . | | |
| | | |
| | | Example: Moving Average Filter You can smooth the data in count.dat using a moving-average filter to see the average traffic flow over a 4-hour window (covering the current hour and the previous 3 hours). This is represented by the following difference equation: y(n) = 4 x(n) + 4 x(n -1) + 4 x(n - 2) + 4 x(n - 3) The corresponding vectors are a = 1; b = [1/4 1/4 1/4 1/4]; 1 Extractthe firstcolumnof count and assign it to the vector x: x = count(:,1); 2 The 4-hour moving average of the data is calculated by y = filter(b,a,x); 3 The filtered data, represented by the solid line in the plot, is the 4-hour moving average of the count data. The original data is represented by the dashed line. | | |
| | | |
| | | 1-12 | | |
| | | |
| | | | | | | | | | |