Before we even try to analyze this let's see if it works.

So we take our smooth signal corrupted by noise and

we filter it with a leaky integrator for varying values of lambda.

So if we start with lambda rather small we don't see really see much happening.

But as we increase the value of lambda towards one,

which is really the operating assumption for the derivation of the filter anyway,

we see that we start to smooth the signal as we expected.

And when lambda is very close to one, the smoothing power is comparable to that of

a moving average filter with a very high number of tabs.

But now the difference is that each output value only requires three operations.

Because remember, the value is simply 1 multiplication and

then there's going to be another multiplication and 1 sum.

And this is independent of the value of lambda,

so highest motion power at a fixed price.

Of course the natural question when we have a filter is what

the impulse response is going to be.

And to compute the impulse response of the leaky integrator, all we need to do is

plug the delta function into the recursive equation and see what happens.

So when n is less than 0, since the delta function is 0 from

minus infinity to 0, nothing non-0 has ever happened inside this equation.

And so it's very safe to assume that the output will be 0 for

all values of n less than zero.

Things start to happen when n reaches zero at

which point the delta function kicks and assumes a value of one.

So if we compute the value of the output for n = to 0, we have lambda times

the previous value of the output, which we know to be zero, so this is zero.

Plus 1 minus lambda times the value of delta and 0, which is 1.

And so the output would be 1 minus lambda.

At the next step y of 1 is equal to lambda times the previous value of the output,

which now is not known as 0, it's 1 minus lambda as we computed before.

Plus 1 minus lambda times delta 1, which we know to be 0 and so this is cancelled.

And the final output is lambda times 1 when it's lambda.

At the next step, once again the recursive equation kicks in and we have lambda

times the previous value which we know to be lambda times 1 when it's lambda.

Plus 1 minus lambda delta of 2.

But again delta from now on is going to be 0, so

this term we don't even have to look at.

And so you will have lambda square times 1 minus lambda.