"Mark Borgerding" wrote in message
...
Tom wrote:
"Mark Borgerding" wrote in message
...
To make a "leaky integrator" fast cross correlator, I would omit the
second coefficient in your formula, 1-beta.
Leaving,
Sxy(i) = beta*Sxy(i-1) + X(i)*Y(i)
This makes the boundary cases nice and clean:
beta = 0 -- forget everything , use current block only
beta = 1 -- forget nothing , use entire signal
-- Mark
If you do what you suggest you get a dc gain (ie when z=1) which is
1/(1-beta) rather than unity.
Take z-transforms and the TF is
(1-beta)/(1-betaz^-1) ....
I see your argument - you are trying to get back to a pure integrator
when
beta=1 but pure integrators are not a good idea in open-loop - any
slight
dc-offset and off they go for a walk.Best results are obtained with
beta=05
up to 0.9 (ish!).
Tom
I agree pure integration is a bad idea for endless input, but that was
not the problem put forth.
The OP didn't mention anything about an open loop.
FWIW, I don't think the term "unity gain" is very meaningful when
applied to a single buffer answer in cross-correlation.
Let's hop a little further down this bunny trail ...
Both systems' transfer functions contain a single pole on the real axis
with magnitude beta.
I suggest that the unity gain created by the (1-beta) term causes more
problems than
it solves. It certainly declaws the unstable pole when beta == 1 by
setting the gain to zero.
Unfortunately, that happens to be is the useful case of
cross-correlation of two complete sequences.
To have the best of both worlds, I'd split beta and 1-beta up into two
gains: beta and alpha.
y(i) = beta*y(i-1) + alpha*x(i)
For the case when unity gain is desired, alpha = 1-beta. If
integration is the goal, then alpha = beta = 1
Perhaps it comes down to personal preference.
I prefer one algorithm that does two things even if it is slightly more
complicated, rather than needing two algorithms.
In any case, a gain is usually easy to slip in someplace computationally
convenient.
-- Mark
The idea comes from exponential smoothing in time-series analysis
http://www.itl.nist.gov/div898/handb...on4/pmc431.htm
If you don't put in the (1-beta) part then you get an offset ie you have to
re-scale afterwards to get the right
answer.
You will find that integrators (pure) are rarely if ever used on open loop
(as we have here).
For example the LMS algorithm has integrators in it - as does the Kalman
Filter and many such algorithms
w(k+1)=w(k)+2*mu*X(k)*e(k)
but it has an error term ie feedback to keep it in line!It does not matter
whether integrators are analogue or digital, in open loop they are
troublesome.Try putting beta=1 and see if it works.Or simpler still try
integrating a pure sine-wave.Slightest dc and we are in trouble.
Tom