[sim, EstMean, EstSigma] = ld_WindowedMean(sim, events, in, weight, WindowLen)

ld_WindowedMean - Calculte the average of the input singal for a floating window

in * - input signal

weight * - weight for the current sample

EstMean * - the calculated average

EstSigma * - the calculated standard deviation

WindowLen - length of floating window

If weight is less than 0 the filter update is prevented. E.g. if in contains an invalid sample that

shall not be counted in the calculation of the Mean and Variance