essentially you want to average the signal change over several samples.
You could do something like this to keep memory usage to a minimum Yn is the smoothed value at step n , Xn is the raw input value at step n
Yn = Yn-1 + (1/k * (Xn - Yn-1))
K Is a smoothing factor having it close to 0 or really high will influence the smoothing. having k < 1 will likely diverge.
Here is a quick table made with excel where I’m varying k from 1, 2, 3, …
You have samples taken on the left side and in the array what the smoothing value would be based on the smoothing factor k which is at the top of the column
To generate the samples I took some random noise around the value 50 (can range between 45 and 55)
this is what it looks like:
you can see the impact of the smoothing factor.
In this formula you only need the current value on input Xn and remembering the last smoothed value Yn-1.
If what you are asking for is obtaining only 1 number smoothing the combined signal from all the input then if all your analog inputs are in the same range and related then just sum your inputs and divide by the number of inputs (i.e. Average your input) to build Xn
If what you are asking for is getting multiple smoothed values, one per each input then
Loop for i varying between 0 and number of analog inputs - 1
read analogInput[i] into an array currentInputValue[i] ,
Keep an array of previousSmoothedOutput[i]
compute in a another array currentSmoothedOutput[i] with the formula above (you can have an array of k[i] if smoothing factors need to be different for each input)
Do something with the currentSmoothedOutput array
Then move each currentSoothedOutput into previousSmoothedOutput
Go back to the loop
(Make sure all values are initialized to something meaningful the first time)
The good thing with this approach is that k can be changed in software so you can adjust the smoothing effect in software.