Mon Jul 23 11:33:11 EDT 2012
For large number of samples this is just:
m = \sum x_i
v = \sum (x_i - m)^2
Samples are 10 bit, so there is room for 32 - 10+10 = 12 bits or 2^12
is 4096 samples, though this of course depends on the variance.
What I want is some kind of sliding window. The simplest approach is
to reset the accumulators. Doing it incrementally requires a delay
line and memory to store the samples.
So it seems the tradeoff here is bit depth: we get more effective bits
if we represent the variance in terms of the current mean, and perform
an adjust on every sample. This makes the updates more costly so
probably not worth it.