[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More Fun With Filters



PureBytes Links

Trading Reference Links

I figured out that combining the two types of filters results in an
improvement over both.  Here's what you need:

* A 2-pass critical damping filter of a given length L
* A 1-pass normal Butterworth of length L*2/3

(both of which are available from the code I posted).

If you plot these, you'll see that the overshoot of the Butterworth can be
balanced by the lag of the critically-damped filter.  Averaging the two
together, you get a filter that:

* has negligible overshoot (it has a little but it can be tuned out; the
2/3 length multiplier was derived by eyeballing the chart)

* preserves the same fall-off in the frequency spectrum as a length-L
Butterworth

* has a sharper roll-off than either the Butterworth or critically-damped
filter.

The only problem that remains is the fact that the critically damped
filter blows up below a certain value of L.  For the 2-pass critical
damping filter, it blows up when L<=4.6, and starts ringing around L=9.2,
so you wouldn't want the length to be less than 9.2.  There's some
adjustment that needs to be put in the formula somewhere but I haven't
figured out what it is.

The first picture attached shows the 2-pass critical damping filter of
length 40, and a 1-pass 2nd-order Butterworth of length 40*2/3, showing
how the lag of one balances the overshoot of the other.

The second picture shows the frequency spectrum of the filters.

Those of you who get the digest with no attachments should be able to see
them in the purebytes.com archives.

THIS is why I don't make money trading!  I keep getting distracted by
these experiments.

-Alex


Attachment:
temporal3.gif
Description: GIF image
Attachment:

Attachment: Description: "Description: GIF image"

Attachment: Description: "response3.gif"