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

Re: Newsletter 13/2001 available



PureBytes Links

Trading Reference Links

Tomacz,

I am really happy to see this newsletter
I hope it 'll help me to write these
NUTS AND BOLTS

There is no magic to a Gaussian filter. It is just the multiple 
application of an Exponential Moving Average. From my previous 
article the transfer response of an exponential moving average is
H(z) = a / (1 - (1-a) Z-1)
So that applying the exponential moving average "N" times gives a N 
Pole filter response as 
H(z) = aN / (1 - (1-a) Z-1)N
At zero frequency Z-1=1, so this low pass filter has unity gain. 
Also, the denominator assumes the value of aN at zero frequency. The 
corner frequency of the filter is defined as that point where the 
transfer response is down by 3 dB, or .707 in amplitude. When this 
occurs, we have the relationship
(1 - (1-a) Z-1)N = 1.414aN where Z-1 = e-jw and w = 2p/P
Crunching through the complex arithmetic, we arrive at the solution 
for alpha as
a = -b + SQR(b2 + 2b)
Where b = (1 - cos(w)) / (1.4142/N - 1)

This generalized solution for alpha can be used to compute the 
coefficients for any order Gaussian filter. Recalling that the 
filtered output is determined by the equation
f(z) = H(z)g(z)	where g(z) is the input price

If H(z) is of the form 1/(1 - (1-a) Z-1)N we can easily form 
equations for the output in EasyLanguage metaphor because Z-1 is 
synonymous with a one bar lag. These equations are:
One Pole:	f = ag + (1-a)f[1]
Two Poles:	f = a2g + 2(1-a)f[1] - (1-a)2f[2]
Three Poles:	f = a3g + 3(1-a)f[1] - 3(1-a)2f[2] + (1-a)3f[3]
Four Poles:	f = a4g + 4(1-a)f[1] - 6(1-a)2f[2] + 4(1-a)3f[3] - (1-
a)4f[4]
Etc.
> Thank you very much for valuable reference.
> Best Regards
> Dimitris Tsokakis
> --- In amibroker@xxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> > Hello,
> > 
> > I introduced 2nd order IIR filtering because it is wide known
> > filter in acoustics and generally electronics.
> > 
> > The 2nd order filter has less lag and better noise suppression.
> > 
> > As EMA is essential 1st order IIR filter it has worse 
> characteristics
> > than 2nd and higher order filters.
> > 
> > The coefficients can be derived using standard methods
> > used in acoustics. See the following references:
> > http://www.mesasoftware.com/pub/SMOOTHINGFILTERS.EXE
> > SMOOTHING FILTERS . . . . . . . . .Synopsis
> > 
> > Use of smoothing filters is a tradeoff between degree of 
smoothing 
> and acceptable lag. This paper discusses the difference between
> > FIR (Finite Impulse Response) and IIR (Infinite Impulse Response) 
> filters. Equations for higher order filters is provided, as well
> > as a definitive discussion of lag calculation.
> > 
> > also:
> > http://monkey.icu.ac.kr/sslab/rr/HICSS2000/DATA/DTISA04.PDF
> > 
> > and acoustic related ones:
> > 
> > http://svr-www.eng.cam.ac.uk/~ajr/SA95/node13.html
> > 
> 
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/filter.shtml
> > http://www.onu.edu/user/FS/lthede/adfd_txt.htm
> > http://www.gresilog.com/english/excommen/doc/fil_rec.htm
> > 
> > 
> > Best regards,
> > Tomasz Janeczko
> > ===============
> > AmiBroker - the comprehensive share manager.
> > http://www.amibroker.com
> > 
> > ----- Original Message -----
> > From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx>
> > To: <amibroker@xxxx>
> > Sent: Saturday, November 03, 2001 5:15 PM
> > Subject: [amibroker] Re: Newsletter 13/2001 available
> > 
> > 
> > > Dear Tomasz,
> > > Thank you for interesting techniques of Issue 13/2001.
> > > Two preliminary questions, not on the technique but on
> > > the subject itself:
> > > A. In
> > > f0 = 0.2;
> > > f1 = 1.2;
> > > f2 = -0.4;
> > > do you follow some formula or relation between f s ?
> > > I noticed that slight changes form -0.4 to -0.5 have quite
> > > different response.
> > > B. In what sense do you find this ema "better".?
> > > I did not see that.
> > > If the example was just to show the technique, it is O. K.
> > > Best Regards
> > > Dimitris Tsokakis
> > > --- In amibroker@xxxx, "Tomasz Janeczko" <amibroker@xxxx> wrote:
> > > > Hello,
> > > >
> > > > The newsletter issue 13/2001 is available at:
> > > > http://www.amibroker.com/newsletter/13-2001.html
> > > >
> > > > Enjoy.
> > > >
> > > > Best regards,
> > > > Tomasz Janeczko
> > > > ===============
> > > > AmiBroker - the comprehensive share manager.
> > > > http://www.amibroker.com
> > >
> > >
> > >
> > >
> > >
> > > Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/
> > >
> > >
> > >