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]


57

Secondly, you must decide how many filter weights you are gomg to use. The number you select must be odd.

Finally, you must determine the steepness of skirt slope you desire your filter to have. This means how rapidly the amplitude ratio of the filter rises from 0.0 (at the lower-bound cutoff frequency) to a value of 1.0 (at the lower-bound roiloff frequency). This ratio wiH then remain more or 1 constant over the passband of the filter, until the upper-bound roUoff frequency is reached. It will then start to diminish, becoming zero again at the upper-bound cutoff frequency. The meaning of these terms will become clearer to you as you study the sample filter design of Figure XI-1.

AU three of these quantities are involved in determining filter error. Error in filter design is unavoidable. This means that although we can approach ideal filter characteristics as closely as desu-ed (at the expense of increased computational difficulty), we are never able to achieve the exact performance we want. Filter design is a matter of forming the required compromise in such a way as to accomplish our purposes to the best extent poible.

FlOUtt Hl

,4 .3 .2

J y-fXSKH response.

\ i

* RAQ/VR.-

Typfcal, Digital-Fflter Req>onse Curve

Precision filter error analysis is a very complex subject. To avoid getting into this and yet provide you with workable tools. Figure XI-2 has been prepared. This figure will bring you as close to being able to pre-determine your filter error as you will need to be.

Notice that error is a function of the product of three factors:

1. = frequency difference between cutoff and rofloff frequencies-or the measure of

filter skirt slope, in radians per year.

2. 71 - number of weights you use in your filter design.

3. r = time spacing you choose to use between stock price data points in weeks.



How To Control Tnor" In A Dital Fflter

FIGURE X

-1-1-

1 i

! i .

1 !

(- ......

>0 0 4 0500 00700 9 1 \% i.MWKS. AU.MRAQAR.

These are the same three quantities discussed in previous paragraphs, now related to filter error in percent.

For stock research work you should shoot for an (TtX/X-O)) product of between 500 and 700. This will result in filter errors of about two and a half and one percent respectively.

Keep this in mind as you make your choices: You will want at least six or seven data points in the output of your filter for each cycle of the shortest duration frequency component that can be in your filter output. This will put a basic limit on how big you can make "t." Then, the larger you make the more work you will have to do both in designing and applying the filter, but the smaller you can make (which makes your filter more effective). Similarly, to reduce the amoimt of work, you may reduce 7t but you will then have to make ) larger, reducing filter efficiency. In extreme cases you can even use filter errors of up to five or six percent-and you will still be surprised at how effectively you can extract cycUcalities.

At this stage of filter design you have made the following choices:

1. wi = the lowest frequency of the four: that frequency below which you wish

amplitude ratio to be zero, and for which you wish higher frequencies to start being "passed" by the fiher.

2. =the next higher frequency of the four: that frequency at which you wish

amplitude ratio to first become equal to 1.

3. =the next higher frequency of the four: that frequency at which you wish

amplitude ratio to still equal 1.0, but at which you desire higher frequencies to start to be attenuated.

4. = the highest of the four frequencies you must select: that frequency at which



• Calculate the quantity:

1047

• Calculate the quantity:

Second s«t:

• Calculate the quantity: X =-

• Calculate the quantity: X -

"

• Calculate the quantity: =

• Calculate the quantity: Third set;

• Calculate the quantity: Xj = X, -

• Calculate the quantity; X* = X4 - X3 Fourth set:

• Calculate the quantity: IjrXi

• Calculate the quantity: 2ffXj

• Calculate the quantity; 2 -

• Calculate the quantity; 2X4

• Calculate the quantity; 2jiXs

• Calculate the quantity:

you wish ajTiplitude ratio to hare again reached 0.0, and beyond which you want alJ higher frequencies to be attenuated to zero.

5. t =tiine spacing in weeks between the data points you are going to use repre-

senting stock prices.

6. ?t ~ number of wets in your filter.

These quantities are ilhistrated graphically in Figure XI-1. For this design the number of filter weights is 199. (the measure of skirt slope) is .4 radians per year. The data spacing to be used on stock prices, "t" is seven weeks. The product of these is 557.2, resulting in an error of about two %. The low-end rolloff frequency is cjj. while that for the high end is toj. The low-end cutoff frequency is <Ot. while that for the high end is W4. The shaded areas show the error, or the amount by which actual filter performance is different from the response we were trying to achieve by the design.

These design choices provide 50% or more filter response across a pass-band of frequencies corresponding to sinusoidal components with periods of 2.8 to 6.0 years. Such a fflter is suitable for investigation of oscillations of the order of four and a half years duration-a dominant element of the price-motion model.

Note that ? is simply (6j2-c<),)or (W4-W3). At this stage of your experience you should make equal for both high and low rolloff.

The next step is the computation of several quantities that will be common to the calculation of all >2. weights. Where neceary, these quantities will be assigned symbols so that you can keep them straight.

1. First set:

7t-l



[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]