DSPGuy wrote:Here is an alternate algorithm for mean and variance that does not keep any sample history. It is the Knuth ( from Welford) algorithm from https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance.
Here is the corrected link (removed the trailing decimal point).
This probably similar to the algorithm implemented in the ptbypt variance under the condition of "infinite horizon" (set sample lenght=0 as already mentioned by others). No programming needed.
(In any case, I would do a custom reentrant subVI based on Jim's demo that also includes min/max and all the other metrics you want).
If the 200+ channels come in as an array, you could get away with a single subVI that maintains an array of 200+ means, variances, etc., one for each channel. Probably more efficient and more scalable. Just use Jim's, but replace all scalars with arrays. Good luck!