back start next


[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [ 66 ] [67] [68] [69] [70] [71]


66

appendix four

Frequency Response Characteristics of a Centered Moving Avera

• Response Derivation

• Response Chari»rteristic$

• Application Implications

• Response of the Inverse Centered Moving Average

In order to apply moving averages effectively, the dign parameters and response characteristics to be expected must be known. These are simply derived as foUows:

RESPONSE DERIVATION

1. Defining ˆ. as a cosinusoidal input to the averaging operation:

= a cos (u>t)

2. Determining = the output to be expected from the averapng operation {under the assumption of centering, and taking at the mid-span point):

e„ =1\a cos (wO + cos [ (t + f„)] + a cos - f„)l

-I- A cos [w(r + 2t„)] + cos Mr -2t„)] +..........................••••.......

cos

n- 1

+ >( cos

- 1

.)]}

Where: n = number of elements of the moving average,

r„ = digital data spacing of the data against which the average is applied.

3. This expression can be rewritten as follows:

=j4 cos (wr) + 2A cos (cjf) cos [(1 „)]

+ 2A cos (<j/) cos [(2Xw?„)] + ••••.................

+ 2A cos (cor) cos (•~)in} \



4. Factoring and combining terms;

= cos+ 2 cos (I)(w?„) + 2 cos(2Xwf„)+-+ 2 cos(~-!-) (wr„)]

5. Defining; /= cos (lXwr„) + cos (MuiQ + • •+ cos(5) (wr„)

6. And amplitude ratio ;

,=£. = LLV.ere;

/= cos (lXwf„) + COS (2Xw/„) +•••• + cos() («r„) RESPONSE CHARACTERISTICS

From the derivation we note the following:

• Output is precisely in phase with input over the entire frequency range; 0<cj (except for reverls of phase in the high attenuation areas).

• " f„ is the span of the fdter (in units of time). The time lag is a constant;

L = -- -- (units of time), or one-half of the span,

• The cutoff frequency occurs when/= -Vi, or at a frequency;

This frequency corresponds to a cutoff period of: = nt = span of the avera

• The form of the amplitude response curve is a damped sinusoid, but the major pass-band lobe repeats itself at frequency intervals of 2n. This implies a first high fruency window that can induce frequency-folding effects at;

CO = -, or at a frequency whose period is: /„.

• The amplitude ratio of the first lobe following cutoff frequency is a constant -.23, independent of design parameters. Subsequent error lobes alternate in sign as they diminish in size. Thus, high frequencies appear in the output damped, and either in phase with the input or 180 degrees out of phase with the input, dependent upon design parameters and frequency.

• The characteristics of a centered moving average are totally fixed by the span of the average, nt which is the only design variable.

APPLICATION IMPLICATIONS

The derived response curve for a centered moving average is plotted in Figure A

IV-1.



FREQUENCY RESPONSE OF

MOVING A/ERAGE OPERATION

FK30RE MX-t -WtfS-BAND LOBE

IN-PHASE CAROft LOBES

How A Moving Average Works

The simplicity of the function tells us that we need never plot it again for a specific design. Knowing that amphtude ratio is 1.0 at zero frequency, 0.0 at a

frequency of (corresponding to a period of nt), and that the following error lobe

is negative and reaches a peak of = -.23 is sufficient to allow the curve to be visualized with sufficient accuracy for all practical purposes.

We note that selection of a span of nt„ forces the output to contain no trace of spectral components whose period equals this span. We further know that slightly lower frequencies will come through attenuated, the attenuation diminishing as frequency decreases, reaching zero attenuation at zero frequency. Similarly, slightiy higher frequencies (than that of cutoff) come through attenuated and 180 degrees out of phase. At a still higher frequency, output is again zero. At higher frequencies yet, output is obtained that is still more attenuated and in phase with input again.

It is clear that the centered moving average behaves as a low-pass filter with large-amplitude Gibbs-osciilation error lobes (due to the infinite discontinuities of the derivatives of the square-wave weighting function). Actually, the high-frequency suppression characteristics are sufficiently poor that such an average would not be very effective as a "smoother" of stock price data-except for the fact that the spectrum of

stock prices consistently displays the a.-- relationship between amplitude and

frequency derived in Appendix One. It is only the sharp attenuation of high-frequencies characteristic of stock price motion that permits the utilization of a filter with such relatively poor characteristics.



[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [ 66 ] [67] [68] [69] [70] [71]