Applying RunningAverage separately for multiple potentiometers readings

Hello everyone,
Im very new to Arduino (and my math skills arent very well) so i didnt knew exactly what i need to
looking for to solve this problem.
Im using a Pro Micro and i have this code of a simple analog reading of two potentiometers. in my
experiments with analogRead i came to know the issue of the spikes in the signal. i have looked up for a
solution for this and from the many solutions i’v red about (i didn’t tried the 100nf cap method yet - im
waiting for the capacitors to arrive) i found the RunningAverage library which seemed like the best
solution around.

I first tried the example code of the library with a single potentiometer. it worked very well. now, when
im connecting two potentiometers at two different analog inputs, despite my expectation the Runningaverage to work separately for each reading, the RA result in the Serial.println is acting as an
addition/subtraction formula - it shows only one reading as the result of pot1+pot2 (or pot1-pot2 when
the analog reading of one of the two is increased.) So, my question is, there is any way to apply the RunningAverage as a spikes filter for any of the readings separately?

Many many thanks !!!

#include <RunningAverage.h>
const int knobs = 2;
int inputs[knobs] = {A1, A2};
RunningAverage myRA(10);
int samples = 0;

void setup() {
}
void loop() {
  for (int i = 0; i < knobs; i++) {
  //  Serial.println(inputs[i]); - works separately and shows the pin number
// Serial.println(analogRead(inputs[i])); - shows the reading of the two pins separately
long rn = analogRead(inputs[i]);
  myRA.addValue(rn * 0.001);
  samples++;
  Serial.print("Running Average: ");
  Serial.println(myRA.getAverage(), 3);

  if (samples == 300)
  {
    samples = 0;
    // myRA.clear();
  }

 delay(50);
  }
}

despite my expectation the Runningaverage to work separately for each reading

How would the library code know that you were using 2 (or more) different inputs ?

Can you create an array of RunningAverage objects, each with their own data ?

#include <RunningAverage.h>
const int knobs = 2;
const int inputs[knobs] = {A1, A2};
RunningAverage Averages[knobs] = {RunningAverage(10), RunningAverage(10)};
int samples = 0;


void setup()
{
  Serial.begin(115200);  // YOU FORGOT THIS LINE
}


void loop()
{
  for (int i = 0; i < knobs; i++)
  {
    //  Serial.println(inputs[i]); - works separately and shows the pin number
    // Serial.println(analogRead(inputs[i])); - shows the reading of the two pins separately
    Averages[i].addValue(analogRead(inputs[i]) * 0.001);

    Serial.print("Running Average for knob ");
    Serial.print(i);
    Serial.print(": ");
    Serial.println(Averages[i].getAverage(), 3);


    samples++;

    if (samples == 300)
    {
      samples = 0;
      // myRA.clear();
    }


    delay(50);
  }
}

Hello UKHeliBob, johnwasser thanks for the fast answer.
As i know a very little on arrays , my thought of the solution was in the direction of something like myRA.getAverage([ i ]); rather than write a new array integers, and in the Averages*. of the beginning of the function. many thank you both for giving me that solution !!! the code works great.*