|I'm not sure if I got you right ...
Basicly your 2nd code-snippet looks good. But ... what do you want to see in your Textbox 'txtFilterValues' ?
Inside your loop you are overwriting each stored text with the new one ...
My 2nd problem with your code is :
You are using the method 'GetMovingAverage' completely wrong, because it builds it's average (as I described before) from it's own stored values (that you used for the method before).
So your loop must be complete different (and in my opinion the posted method doesn't really solve your problem).
Try as code something like this :
for (int id = 0; id < maxAI; id++)
double AnalogSensorValues = sObj[id].GetAnalogValue();
AnalogSensorAverage = GetMovingAverage(AnalogSensorValues);
sTxt = AnalogSensorValues.ToString("F3");
textSensorValues.Text += sTxt + " ";
txtFilterValues.Text = AnalogSensorAverage.ToString("F3");